7f7da15965
Completed: - Phase 0: Project Setup (T001-T003) - Docker Compose, FastAPI skeleton, React SPA - Phase 1: Auth System (T004-T008) - DB models, JWT auth, RBAC middleware, user management - Phase 2: Contacts & Tags (T009-T011) - CRUD API + UI - Phase 3: Equipment Catalog (T012-T014) - Models, API, UI with barcode/QR - Phase 4: Crew Management (T015-T017) - Models, availability, UI - Phase 5: Vehicle Fleet (T018-T020) - Models, assignments, UI - Phase 6: Projects (T021-T023) - Project hierarchy models, CRUD API, list/detail UI
40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
"""Pydantic schemas for StockLocation."""
|
|
|
|
from datetime import datetime
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class StockLocationCreateRequest(BaseModel):
|
|
"""Request body for creating a new stock location."""
|
|
name: str = Field(..., max_length=255)
|
|
address: str | None = Field(None, max_length=500)
|
|
is_default: bool = False
|
|
|
|
|
|
class StockLocationUpdateRequest(BaseModel):
|
|
"""Request body for updating a stock location."""
|
|
name: str | None = Field(None, max_length=255)
|
|
address: str | None = Field(None, max_length=500)
|
|
is_default: bool | None = None
|
|
|
|
|
|
class StockLocationResponse(BaseModel):
|
|
"""Public stock location representation."""
|
|
id: str
|
|
account_id: str
|
|
name: str
|
|
address: str | None = None
|
|
is_default: bool
|
|
created_at: str
|
|
updated_at: str
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class StockLocationListResponse(BaseModel):
|
|
"""Paginated list of stock locations."""
|
|
items: list[StockLocationResponse]
|
|
total: int
|
|
page: int
|
|
size: int
|