feat(backend): sync endpoints + all models + seed + order workflow
- All business models: Vehicle, Order, OrderLine, Invoice, Appointment, CatalogMarca/Model/Ansamblu/Norma/Pret/TipDeviz/TipMotor, Mecanic - Sync endpoints: GET /sync/full, GET /sync/changes?since=, POST /sync/push with tenant isolation and last-write-wins conflict resolution - Order CRUD with state machine: DRAFT -> VALIDAT -> FACTURAT Auto-recalculates totals (manopera + materiale) - Vehicle CRUD: list, create, get, update - Seed data: 24 marci, 11 ansamble, 6 tipuri deviz, 5 tipuri motoare, 3 preturi - Alembic migration for all business models - 13 passing tests (auth + sync + orders) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
18
backend/app/orders/schemas.py
Normal file
18
backend/app/orders/schemas.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class CreateOrderRequest(BaseModel):
|
||||
vehicle_id: str
|
||||
tip_deviz_id: str | None = None
|
||||
km_intrare: int | None = None
|
||||
observatii: str | None = None
|
||||
|
||||
|
||||
class AddLineRequest(BaseModel):
|
||||
tip: str # manopera | material
|
||||
descriere: str
|
||||
ore: float = 0
|
||||
pret_ora: float = 0
|
||||
cantitate: float = 0
|
||||
pret_unitar: float = 0
|
||||
um: str | None = None
|
||||
Reference in New Issue
Block a user