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:
2026-02-08 23:41:07 +00:00
parent 451900ae1a
commit 24d35fe0c1
34 changed files with 709 additions and 347 deletions

View File

@@ -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

View File

@@ -28,7 +28,15 @@ class UserKYCComplete(BaseModel):
phone_number: str
birth_place: str
birth_date: date
mothers_name: str
mothers_last_name: str
mothers_first_name: str
# Hibrid Címmezők
address_zip: str
address_city: str
address_street_name: str
address_street_type: str
address_house_number: str
address_hrsz: Optional[str] = None # Helyrajzi szám
identity_docs: Dict[str, DocumentDetail]
ice_contact: ICEContact
@@ -36,7 +44,6 @@ class UserKYCComplete(BaseModel):
class PasswordResetRequest(BaseModel):
email: EmailStr
# EZ HIÁNYZOTT KORÁBBAN:
class PasswordResetConfirm(BaseModel):
email: EmailStr
token: str