Files
plantillas-proyectos/backend/api/v1/modules/a24/inv/inv_classes/models.py
acazares 6225122832 feat: Implement client and provider management dashboard
- Added data table component for displaying clients and providers with infinite scroll functionality.
- Created dropdown actions for each client/provider including copy ID, copy RFC, view details, edit, toggle status, and delete.
- Implemented dialogs for creating, editing, viewing details, and deleting clients/providers.
- Integrated API calls for fetching, creating, editing, deleting, and toggling status of clients/providers.
- Enhanced error handling and loading states for better user experience.
- Updated server-side logic to handle pagination and company selection for client/provider data retrieval.
2025-11-12 16:08:42 -06:00

27 lines
1.1 KiB
Python

from api.v1.common.base_models import TenantScopedMixin
from core.database import Base
from sqlalchemy import ForeignKeyConstraint, Integer, PrimaryKeyConstraint, String
from sqlalchemy.orm import Mapped, mapped_column
class SClasses(Base, TenantScopedMixin):
__tablename__ = "inv_classes" # SClases
__table_args__ = (
ForeignKeyConstraint(
["tenant_id"], ["a76.tenants.id"], name="fk_sclasses_tenants"
),
ForeignKeyConstraint(
["company_id"], ["a76.company.id"], name="fk_sclasses_company"
),
ForeignKeyConstraint(
["class_id"], ["a76.clases.class_id"], name="fk_sclasses_classes"
),
PrimaryKeyConstraint("id", name="sclases_pk"),
{"schema": "a24"},
)
id: Mapped[int] = mapped_column(Integer, primary_key=True)
class_id: Mapped[int] = mapped_column(Integer, nullable=False) # Id de clase
stock_um: Mapped[str] = mapped_column(String(5)) # Unidad de medida para existencia
us_tariff_code: Mapped[str] = mapped_column(String(19)) # Fracción americana (USA)