""" Modelos ORM para gestión de localización """ from typing import Optional from api.v1.common.base_models import TenantScopedMixin from core.database import Base from sqlalchemy import Integer, PrimaryKeyConstraint, String, UniqueConstraint from sqlalchemy.orm import Mapped, mapped_column class Location(Base, TenantScopedMixin): """ Modelo para la tabla Location - Localización """ __tablename__ = "location" # SLocalizacion __table_args__ = ( PrimaryKeyConstraint("id", name="location_pkey"), UniqueConstraint("code", name="location_code_unique"), {"schema": "a24"}, ) # Primary key id: Mapped[int] = mapped_column( Integer, primary_key=True, autoincrement=True) # Location code (unique) code: Mapped[str] = mapped_column(String(5), nullable=False, unique=True) # Location description description: Mapped[Optional[str]] = mapped_column(String(200)) def __repr__(self): return f""