Files
plantillas-proyectos/backend/api/v1/modules/a76/transportation/drivers/models.py
acazares dc0fac9b3e 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.
2025-12-08 10:13:02 -06:00

41 lines
1.7 KiB
Python

from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
from core.database import Base
from sqlalchemy import Column, ForeignKey, ForeignKeyConstraint, Integer, String
class Driver(Base, TenantScopedMixin, TimestampMixin):
__tablename__ = "driver"
__table_args__ = (
{"schema": "a76"},
)
transporter_key = Column(
String(5),
ForeignKey("a76.transporter.transporter_key", ondelete="CASCADE"),
primary_key=True,
nullable=False,
)
line = Column(Integer, primary_key=True, nullable=False)
driver_name = Column(String(80), nullable=True)
license_number = Column(String(29), nullable=True)
express_line_id = Column(String(17), nullable=True)
ace_id = Column(String(20), nullable=True)
birth_date = Column(Integer, nullable=True)
gender = Column(String(1), nullable=True)
birth_country = Column(String(3), nullable=True)
hazardous_material_auth = Column(String(2), nullable=True)
hazardous_material_state = Column(String(30), nullable=True)
first_name = Column(String(20), nullable=True)
last_name = Column(String(20), nullable=True)
id_key1 = Column(String(40), nullable=True)
id_number1 = Column(String(20), nullable=True)
id_state1 = Column(String(30), nullable=True)
id_country1 = Column(String(3), nullable=True)
id_key2 = Column(String(40), nullable=True)
id_number2 = Column(String(20), nullable=True)
id_state2 = Column(String(30), nullable=True)
id_country2 = Column(String(3), nullable=True)
badge_number = Column(String(20), nullable=True)
class_type = Column(String(1), nullable=True)
unique_badge_number = Column(String(100), nullable=True)