- Rearranged imports in multiple files for consistency and clarity. - Updated logging middleware to exclude specific paths from logging. - Enhanced security module by cleaning up token handling and improving tenant validation. - Added tenant and company scoped mixins for better database model management. - Implemented generic CRUD routes for tenant-scoped resources. - Improved error handling and response management in API routes. - Cleaned up login and logout processes to ensure proper session management. - Introduced mechanisms to clear local storage and cookies on tenant change. - Enhanced company store to detect tenant changes and clear data accordingly. - Added new DTO mixins for currency and value affect flags.
25 lines
966 B
Python
25 lines
966 B
Python
from api.v1.common.base_models import TenantScopedMixin
|
|
from core.database import Base
|
|
from sqlalchemy import Column, ForeignKey, ForeignKeyConstraint, String
|
|
|
|
|
|
class Trailer(Base, TenantScopedMixin):
|
|
__tablename__ = "trailer"
|
|
__table_args__ = (
|
|
ForeignKeyConstraint(["company_id"], ["a76.company.id"]),
|
|
ForeignKeyConstraint(["tenant_id"], ["a76.tenants.id"]),
|
|
{"schema": "a76"},
|
|
)
|
|
|
|
trailer_number = Column(String(20), primary_key=True, nullable=False)
|
|
ace_trailer_number = Column(String(10), nullable=True)
|
|
trailer_type_key = Column(
|
|
String(2), ForeignKey("a76.trailer_type.trailer_type_key"), nullable=True
|
|
)
|
|
seal = Column(String(15), nullable=True)
|
|
entity_code = Column(String(1), nullable=True)
|
|
plate_number = Column(String(17), nullable=True)
|
|
state = Column(String(30), nullable=True)
|
|
country = Column(String(3), nullable=True)
|
|
container_key = Column(String(3), nullable=True)
|