M12: complete daily operations cycle
This commit is contained in:
@@ -17,6 +17,28 @@ class PasswordLoginRequest(BaseModel):
|
||||
password: str = Field(min_length=8, max_length=256)
|
||||
|
||||
|
||||
class UserOut(BaseModel):
|
||||
public_ref: str
|
||||
email: str | None
|
||||
display_name: str
|
||||
role: Role
|
||||
active: bool
|
||||
|
||||
|
||||
class CreateUserRequest(BaseModel):
|
||||
email: str = Field(min_length=3, max_length=320)
|
||||
display_name: str = Field(min_length=2, max_length=120)
|
||||
role: Role
|
||||
password: str = Field(min_length=8, max_length=256)
|
||||
|
||||
|
||||
class UpdateUserRequest(BaseModel):
|
||||
display_name: str | None = Field(default=None, min_length=2, max_length=120)
|
||||
role: Role | None = None
|
||||
active: bool | None = None
|
||||
password: str | None = Field(default=None, min_length=8, max_length=256)
|
||||
|
||||
|
||||
class CurrentUser(BaseModel):
|
||||
public_ref: str
|
||||
display_name: str
|
||||
@@ -88,6 +110,25 @@ class CancelBookingRequest(BaseModel):
|
||||
reason: str = Field(min_length=3, max_length=500)
|
||||
|
||||
|
||||
class CheckoutBookingRequest(BaseModel):
|
||||
start_odometer_km: Annotated[int, Field(ge=0)]
|
||||
fuel_level_percent: Annotated[int, Field(ge=0, le=100)]
|
||||
cleanliness_ok: bool
|
||||
damage_reported: bool = False
|
||||
technical_warning: bool = False
|
||||
notes: str | None = Field(default=None, max_length=2000)
|
||||
|
||||
|
||||
class CheckoutBookingResult(BaseModel):
|
||||
booking_ref: str
|
||||
vehicle_ref: str
|
||||
inspection_ref: str
|
||||
booking_status: str
|
||||
resulting_vehicle_status: str
|
||||
activated: bool
|
||||
attention_reasons: list[str]
|
||||
|
||||
|
||||
class BookingPageOut(BaseModel):
|
||||
items: list[BookingOut]
|
||||
page: int
|
||||
@@ -158,6 +199,19 @@ class MaintenanceOut(BaseModel):
|
||||
summary: str
|
||||
|
||||
|
||||
class CreateMaintenanceRequest(BaseModel):
|
||||
occurred_at: datetime
|
||||
odometer_km: Annotated[int, Field(ge=0)]
|
||||
category: Literal["periodic_service", "repair", "inspection", "tyres", "other"]
|
||||
summary: str = Field(min_length=3, max_length=2000)
|
||||
next_service_km: Annotated[int | None, Field(default=None, ge=0)]
|
||||
mark_maintenance: bool = True
|
||||
|
||||
|
||||
class ReleaseVehicleRequest(BaseModel):
|
||||
reason: str = Field(min_length=3, max_length=500)
|
||||
|
||||
|
||||
class DataQualityIssueOut(BaseModel):
|
||||
public_ref: str
|
||||
rule_type: str
|
||||
|
||||
Reference in New Issue
Block a user