feat: stabilize KYC, international assets and multi-currency schema
- Split mother's name in KYC (last/first) - Added mileage_unit and fuel_type to Assets - Expanded AssetCost for international VAT and original currency - Fixed SQLAlchemy IndexError in asset catalog lookup - Added exchange_rate and ratings tables to models
This commit is contained in:
@@ -1,27 +1,43 @@
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
from datetime import datetime
|
||||
|
||||
class AssetCreate(BaseModel):
|
||||
catalog_id: int = Field(..., description="A kiválasztott katalógus elem ID-ja")
|
||||
vin: str = Field(..., min_length=17, max_length=17, description="17 karakteres alvázszám")
|
||||
license_plate: str = Field(..., min_length=1, max_length=20)
|
||||
name: Optional[str] = Field(None, description="Egyedi elnevezés (pl. 'Céges furgon')")
|
||||
organization_id: int = Field(..., description="Melyik flottába kerüljön")
|
||||
# Alapadatok
|
||||
make: str = Field(..., example="Ford")
|
||||
model: str = Field(..., example="Mondeo")
|
||||
vin: str = Field(..., min_length=17, max_length=17, description="Alvázszám")
|
||||
license_plate: Optional[str] = Field(None, max_length=20, example="RRR-555")
|
||||
|
||||
# Opcionális: Kezdő km óra állás, szín, stb. később bővíthető
|
||||
# Nemzetközi és Admin szempontok
|
||||
vehicle_class: str = Field("land", description="land, sea, air - Admin által bővíthető")
|
||||
fuel_type: str = Field(..., example="Diesel", description="Admin által definiált üzemanyag típusok")
|
||||
|
||||
# Technikai adatok
|
||||
engine_description: Optional[str] = Field(None, example="2.0 TDCI")
|
||||
year_of_manufacture: int = Field(..., ge=1900, le=2100)
|
||||
|
||||
# Kezdő állapot
|
||||
current_reading: int = Field(..., ge=0, description="Kezdő km/üzemóra állás")
|
||||
reading_unit: str = Field("km", description="km, miles, hours - Nemzetközi beállítás")
|
||||
|
||||
# Felhasználói adatok
|
||||
name: Optional[str] = Field(None, description="Egyedi elnevezés")
|
||||
|
||||
class AssetResponse(BaseModel):
|
||||
id: UUID
|
||||
uai: str
|
||||
catalog_id: int
|
||||
organization_id: int
|
||||
name: str
|
||||
asset_type: str
|
||||
current_plate_number: str
|
||||
status: str
|
||||
catalog_id: Optional[int]
|
||||
vin: str
|
||||
license_plate: Optional[str] = None # JAVÍTVA: Lehet None a válaszban
|
||||
name: Optional[str] = None
|
||||
fuel_type: str
|
||||
vehicle_class: str
|
||||
is_verified: bool
|
||||
year_of_manufacture: int
|
||||
system_mileage: int
|
||||
quality_index: float
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user