TODOS de configuracion general lista

This commit is contained in:
2026-04-13 18:02:39 -05:00
parent 1d53ca9562
commit e5fa5f0326
49 changed files with 1678 additions and 1233 deletions

View File

@@ -14,7 +14,6 @@ from core.database import Base
from api.v1.modules.a76.classes.models import Class
from api.v1.modules.a76.general_catalogs.units_of_measure.models import UnitOfMeasure
from api.v1.modules.a76.general_catalogs.identifiers.models import IdentifierDetail
if TYPE_CHECKING:
from .line_financials.models import LineFinancial
@@ -22,8 +21,6 @@ if TYPE_CHECKING:
from .line_customs.models import LineCustom
from .line_descriptions.models import LineDescription
from .line_references.models import LineReference
from api.v1.modules.a24.fa.fa_item_lines.models import FaLineItem
from api.v1.modules.a76.parts.models import Part
from api.v1.modules.a76.invoices.models import InvoiceHeader
@@ -222,7 +219,7 @@ class LineItem(Base, TenantScopedMixin, TimestampMixin):
uselist=False,
)
identifiers: Mapped[List["IdentifierDetail"]] = relationship(
IdentifierDetail,
"IdentifierDetail",
back_populates="line",
cascade="all, delete-orphan",
)
@@ -231,6 +228,11 @@ class LineItem(Base, TenantScopedMixin, TimestampMixin):
foreign_keys=[part_number_id],
viewonly=True,
)
component_part_info: Mapped[Optional["Part"]] = relationship(
"Part",
foreign_keys=[component_part_number_id],
viewonly=True,
)
# ============================================================================
@@ -387,3 +389,14 @@ MIGRATION STRATEGY FROM ORIGINAL TABLES TO NORMALIZED SCHEMA:
)
```
"""
# ============================================================================
# RUNTIME IMPORTS FOR MAPPER RESOLUTION
# ============================================================================
# We import these specialized models at the bottom to ensure they are registered
# in the SQLAlchemy metadata for relationship resolution while avoiding
# circular import issues in the module head.
from api.v1.modules.a24.fa.fa_item_lines.models import FaLineItem
from api.v1.modules.a76.parts.models import Part
from api.v1.modules.a76.items.series.models import Serie
from api.v1.modules.a76.general_catalogs.identifiers.models import IdentifierDetail