- 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>
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
from sqlalchemy import Integer, String, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.db.base import Base, UUIDMixin, TenantMixin, TimestampMixin
|
|
|
|
|
|
class Vehicle(Base, UUIDMixin, TenantMixin, TimestampMixin):
|
|
__tablename__ = "vehicles"
|
|
nr_inmatriculare: Mapped[str] = mapped_column(String(20))
|
|
vin: Mapped[str | None] = mapped_column(String(17))
|
|
marca_id: Mapped[str | None] = mapped_column(String(36))
|
|
model_id: Mapped[str | None] = mapped_column(String(36))
|
|
an_fabricatie: Mapped[int | None] = mapped_column(Integer)
|
|
tip_motor_id: Mapped[str | None] = mapped_column(String(36))
|
|
capacitate_motor: Mapped[str | None] = mapped_column(String(20))
|
|
putere_kw: Mapped[str | None] = mapped_column(String(20))
|
|
client_nume: Mapped[str | None] = mapped_column(String(200))
|
|
client_telefon: Mapped[str | None] = mapped_column(String(20))
|
|
client_email: Mapped[str | None] = mapped_column(String(200))
|
|
client_cui: Mapped[str | None] = mapped_column(String(20))
|
|
client_adresa: Mapped[str | None] = mapped_column(Text)
|