Initial commit

This commit is contained in:
marianesaldana
2026-05-23 08:59:34 -06:00
commit 80dbd947e5
36446 changed files with 3729147 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
from sqlalchemy import Column, Integer, String, DateTime, Float
from datetime import datetime
from ..database import Base
class Truck(Base):
"""Flotilla de recolección de basura del Gobierno de Celaya."""
__tablename__ = "trucks"
id = Column(Integer, primary_key=True, index=True)
unit_number = Column(String, unique=True, index=True, nullable=False) # CEL-001
plate = Column(String, unique=True, nullable=True) # GTO-123-A
model = Column(String, nullable=True)
year = Column(Integer, nullable=True)
capacity_kg = Column(Integer, nullable=True)
fuel_type = Column(String, default="DIESEL")
status = Column(String, default="OPERATIVO")
# OPERATIVO | EN_RUTA | TALLER | MANTENIMIENTO | FUERA_SERVICIO | RESERVA
route_id = Column(String, nullable=True, index=True)
base = Column(String, nullable=True) # Patio Norte | Patio Sur | etc.
odometer_km = Column(Integer, default=0)
fuel_level_pct = Column(Integer, default=80)
last_maintenance = Column(DateTime, nullable=True)
next_maintenance_km = Column(Integer, nullable=True)
created_at = Column(DateTime, default=datetime.utcnow)