feat: Implement general catalogs for ports, unit conversions, and units of measure
- Added models, DTOs, services, and routes for ports, including CRUD operations. - Introduced unit conversions with corresponding models, DTOs, services, and routes. - Developed units of measure with detailed models, DTOs, services, and routes for various types. - Ensured all new features are integrated with FastAPI and SQLAlchemy for seamless database interactions.
This commit is contained in:
@@ -1,19 +1,13 @@
|
||||
from api.v1.common.base_models import TenantScopedMixin
|
||||
from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
|
||||
from core.database import Base
|
||||
from sqlalchemy import Column, ForeignKey, ForeignKeyConstraint, Integer, String, UniqueConstraint, PrimaryKeyConstraint
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
|
||||
class CustomsBroker(Base, TenantScopedMixin):
|
||||
class CustomsBroker(Base, TenantScopedMixin, TimestampMixin):
|
||||
__tablename__ = "customs_brokers"
|
||||
__table_args__ = (
|
||||
PrimaryKeyConstraint("id", name="customs_brokers_pkey"),
|
||||
ForeignKeyConstraint(
|
||||
["tenant_id"], ["a76.tenants.id"], name="fk_customs_brokers_tenants"
|
||||
),
|
||||
ForeignKeyConstraint(
|
||||
["company_id"], ["a76.company.id"], name="fk_customs_brokers_company"
|
||||
),
|
||||
UniqueConstraint("broker_key", "tenant_id", "company_id", name="uq_broker_key_tenant_company"),
|
||||
{"schema": "a76"},
|
||||
)
|
||||
@@ -45,7 +39,7 @@ class CustomsBroker(Base, TenantScopedMixin):
|
||||
)
|
||||
|
||||
|
||||
class CustomsBrokerVU(Base):
|
||||
class CustomsBrokerVU(Base, TenantScopedMixin, TimestampMixin):
|
||||
__tablename__ = "customs_brokers_vu"
|
||||
__table_args__ = {"schema": "a76"}
|
||||
|
||||
@@ -77,7 +71,7 @@ class CustomsBrokerVU(Base):
|
||||
customs_broker = relationship("CustomsBroker", back_populates="vu")
|
||||
|
||||
|
||||
class CustomsBrokerPersonnel(Base):
|
||||
class CustomsBrokerPersonnel(Base, TenantScopedMixin, TimestampMixin):
|
||||
__tablename__ = "customs_brokers_personnel"
|
||||
__table_args__ = {"schema": "a76"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user