Initial commit: SIBU 2.0 MISSION
This commit is contained in:
26
backend/app/models/taxi.py
Normal file
26
backend/app/models/taxi.py
Normal file
@ -0,0 +1,26 @@
|
||||
"""Taxi model."""
|
||||
from sqlmodel import SQLModel, Field, Column
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from uuid import UUID, uuid4
|
||||
from sqlalchemy import DateTime, func
|
||||
|
||||
|
||||
class Taxi(SQLModel, table=True):
|
||||
"""Taxi model representing an authorized taxi."""
|
||||
|
||||
__tablename__ = "taxis"
|
||||
|
||||
id: Optional[UUID] = Field(default_factory=uuid4, primary_key=True)
|
||||
owner_name: str
|
||||
phone_number: str
|
||||
license_plate: str = Field(unique=True, index=True)
|
||||
cooperative: Optional[str] = None
|
||||
corregimiento: str = Field(index=True)
|
||||
shift: str = "day" # day, night, 24h
|
||||
rating: float = Field(default=5.0)
|
||||
english_speaking: bool = Field(default=False)
|
||||
image_url: Optional[str] = None
|
||||
is_active: bool = Field(default=True)
|
||||
created_at: Optional[datetime] = Field(sa_column=Column(DateTime, server_default=func.now()))
|
||||
updated_at: Optional[datetime] = Field(sa_column=Column(DateTime, server_default=func.now(), onupdate=func.now()))
|
||||
Reference in New Issue
Block a user