201 előtti mentés

This commit is contained in:
Roo
2026-03-26 07:09:44 +00:00
parent 89668a9beb
commit 03258db091
124 changed files with 13619 additions and 13347 deletions

View File

@@ -43,4 +43,72 @@ class TCOSummaryResponse(BaseModel):
class TCOErrorResponse(BaseModel):
"""Error response for TCO endpoints."""
detail: str = Field(..., description="Error description")
vehicle_id: Optional[int] = Field(None, description="Related vehicle ID if applicable")
vehicle_id: Optional[int] = Field(None, description="Related vehicle ID if applicable")
class DashboardMonthlyCost(BaseModel):
"""Monthly cost data for dashboard charts."""
month: str = Field(..., description="Month abbreviation (e.g., 'Jan', 'Feb')")
maintenance: float = Field(..., description="Maintenance costs")
fuel: float = Field(..., description="Fuel costs")
insurance: float = Field(..., description="Insurance costs")
total: float = Field(..., description="Total monthly cost")
class Config:
from_attributes = True
class DashboardFuelEfficiency(BaseModel):
"""Fuel efficiency trend data."""
month: str = Field(..., description="Month abbreviation")
efficiency: float = Field(..., description="Fuel efficiency in km per liter")
class Config:
from_attributes = True
class DashboardCostPerKm(BaseModel):
"""Cost per km trend data."""
month: str = Field(..., description="Month abbreviation")
cost: float = Field(..., description="Cost per kilometer")
class Config:
from_attributes = True
class DashboardFunFacts(BaseModel):
"""Fun facts for dashboard."""
total_km_driven: float = Field(..., description="Total kilometers driven")
total_trees_saved: int = Field(..., description="Total trees saved (eco metric)")
total_co2_saved: float = Field(..., description="Total CO2 saved in tons")
total_money_saved: float = Field(..., description="Total money saved in EUR")
moon_trips: int = Field(..., description="Number of moon trips equivalent")
earth_circuits: int = Field(..., description="Number of Earth circuits equivalent")
class Config:
from_attributes = True
class DashboardBusinessMetrics(BaseModel):
"""Business metrics for fleet management."""
fleet_size: int = Field(..., description="Number of vehicles in fleet")
average_vehicle_age: float = Field(..., description="Average vehicle age in years")
total_monthly_cost: float = Field(..., description="Total monthly cost for fleet")
average_cost_per_km: float = Field(..., description="Average cost per kilometer")
utilization_rate: float = Field(..., description="Fleet utilization rate in percentage")
downtime_hours: int = Field(..., description="Total downtime hours per month")
class Config:
from_attributes = True
class DashboardResponse(BaseModel):
"""Complete dashboard data response."""
monthly_costs: List[DashboardMonthlyCost] = Field(..., description="Monthly cost breakdown")
fuel_efficiency_trends: List[DashboardFuelEfficiency] = Field(..., description="Fuel efficiency trends")
cost_per_km_trends: List[DashboardCostPerKm] = Field(..., description="Cost per km trends")
fun_facts: DashboardFunFacts = Field(..., description="Fun facts and eco metrics")
business_metrics: DashboardBusinessMetrics = Field(..., description="Business metrics")
class Config:
from_attributes = True