Coverage for backend \ app \ Productos \ models \ productoModel.py: 100.00%
20 statements
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-29 16:13 -0500
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-29 16:13 -0500
1from sqlalchemy import Column, Integer, String, Boolean, Float, ForeignKey
2from sqlalchemy.orm import relationship
3from app.database import Base
5class Producto(Base):
6 __tablename__ = "producto"
7 idProducto = Column(Integer, primary_key=True, autoincrement=True)
8 idCategoriaProducto = Column(Integer, ForeignKey("categoriaproducto.idCategoriaProducto"), nullable=False)
9 idProveedor = Column(Integer, ForeignKey("proveedor.idProveedor"), nullable=False)
10 nombreProducto = Column(String(100), nullable=False)
11 descripcionProducto = Column(String(255), nullable=True)
12 precioUnitarioVenta = Column(Float, nullable=False)
13 precioUnitarioCompra = Column(Float, nullable=False)
14 tieneIva = Column(Boolean, default=True, nullable=False)
15 activoProducto = Column(Boolean, default=True, nullable=False)
17 categoria = relationship("CategoriaProducto", back_populates="productos")
18 proveedor = relationship("Proveedor", back_populates="productos")
19 inventario = relationship("Inventario", back_populates="producto")
20 detallesPedido = relationship("DetallePedido", back_populates="producto")
21 promociones = relationship("Promocion", back_populates="producto")
22 detallesVenta = relationship("DetalleVenta", back_populates="producto")