201 előtti mentés
This commit is contained in:
@@ -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
|
||||
@@ -32,7 +32,7 @@ class AssetCatalogResponse(BaseModel):
|
||||
class AssetResponse(BaseModel):
|
||||
""" A konkrét járműpéldány (Asset) teljes válaszmodellje. """
|
||||
id: UUID
|
||||
vin: str = Field(..., min_length=17, max_length=17)
|
||||
vin: str = Field(..., min_length=1, max_length=50)
|
||||
license_plate: Optional[str] = None
|
||||
name: Optional[str] = None
|
||||
year_of_manufacture: Optional[int] = None
|
||||
@@ -58,7 +58,7 @@ class AssetResponse(BaseModel):
|
||||
|
||||
class AssetCreate(BaseModel):
|
||||
""" Jármű létrehozásához szükséges adatok. """
|
||||
vin: str = Field(..., min_length=17, max_length=17, description="VIN szám (17 karakter)")
|
||||
vin: Optional[str] = Field(None, min_length=1, max_length=50, description="VIN szám (1-50 karakter, opcionális draft módban)")
|
||||
license_plate: str = Field(..., min_length=2, max_length=20, description="Rendszám")
|
||||
catalog_id: Optional[int] = Field(None, description="Opcionális katalógus ID (ha ismert a modell)")
|
||||
organization_id: int = Field(..., description="Szervezet ID, amelyhez a jármű tartozik")
|
||||
@@ -17,9 +17,11 @@ class UserResponse(UserBase):
|
||||
subscription_plan: str
|
||||
scope_level: str
|
||||
scope_id: Optional[str] = None
|
||||
ui_mode: str = "personal"
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
class UserUpdate(BaseModel):
|
||||
first_name: Optional[str] = None
|
||||
last_name: Optional[str] = None
|
||||
preferred_language: Optional[str] = None
|
||||
preferred_language: Optional[str] = None
|
||||
ui_mode: Optional[str] = None
|
||||
Reference in New Issue
Block a user