Files
plantillas-proyectos/backend/api/v1/modules/a76/items/series/models.py
AlexeerCT 196525c684 Enhance invoice processing to support export and import differentiation
- Updated the invoice processing route to automatically detect and handle invoice types based on the operation_type.
- Introduced error handling for non-existent invoices, returning a 404 status when an invoice is not found.
- Added a new field 'serie_row' in the Serie model to accommodate additional data for export scenarios.
2026-03-17 22:43:53 -05:00

24 lines
1.2 KiB
Python

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)) # 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