from typing import Optional
from sqlalchemy import Boolean, ForeignKey, Integer, String
from sqlalchemy.orm import Mapped, mapped_column
from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
from core.database import Base

class Serie(Base, TenantScopedMixin, TimestampMixin):
    __tablename__ = "item_line_series"
    __table_args__ = {
        "schema": "a76",
    }
    
    id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
    line_item_id: Mapped[int] = mapped_column(ForeignKey("a76.item_lines.id"))  # LINEAIMPO / LINEAEXPO
    row: Mapped[int] = mapped_column(Integer)  # RENGLON
    serial_numbers: Mapped[Optional[str]] = mapped_column(String(50))  # SERIEEXPO
    model: Mapped[Optional[str]] = mapped_column(String(50))  # MODELOEXPO
    sub_model: Mapped[Optional[str]] = mapped_column(String(50))  # SUBMODELOEXPO
    brand: Mapped[Optional[str]] = mapped_column(String(50))  # MARCA
    # expo_brand: Mapped[Optional[str]] = mapped_column(String(50))  # MARCAEXPO
    number_id: Mapped[Optional[str]] = mapped_column(String(25))  # NUMIDEXPO
    discharge: Mapped[Optional[bool]] = mapped_column(Boolean)  # MARCA
    serie_row: Mapped[Optional[int]] = mapped_column(Integer)  # LINEASERIEIMPO <-- IN CASE OF EXPO
    # import_invoice: Mapped[Optional[str]] = mapped_column(String(15))  # FACTURAIMPO
    # import_line: Mapped[Optional[int]] = mapped_column(Integer)  # LINEAIMPO
    image_path: Mapped[Optional[str]] = mapped_column(String(255))  # PATH DE IMAGEN (MEX)
        
    
    