- examples/fixture-invoicing/: FastAPI + Vue + Postgres demo (4-entity invoice fixture)
- cfg/sample/: wraps the fixture (managed.repos points at examples/)
- ctrl/kind-{up,down,status}.sh + per-room k8s render in soleprint/ctrl/k8s/
- build.py: relative repo paths, resilient rmtree, optional k8s render hook
- cfg/.gitignore: stop ignoring sample/ and standalone/ template rooms
Manifests render cleanly but kind cluster has not been run end-to-end yet.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
59 lines
1.1 KiB
Python
59 lines
1.1 KiB
Python
from datetime import datetime
|
|
from decimal import Decimal
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class CustomerIn(BaseModel):
|
|
name: str
|
|
email: str
|
|
|
|
|
|
class CustomerOut(CustomerIn):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
created_at: datetime
|
|
|
|
|
|
class LineItemIn(BaseModel):
|
|
description: str
|
|
quantity: int = 1
|
|
unit_price: Decimal = Decimal("0")
|
|
|
|
|
|
class LineItemOut(LineItemIn):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
invoice_id: int
|
|
|
|
|
|
class PaymentIn(BaseModel):
|
|
amount: Decimal
|
|
method: str = "cash"
|
|
|
|
|
|
class PaymentOut(PaymentIn):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
invoice_id: int
|
|
paid_at: datetime
|
|
|
|
|
|
class InvoiceIn(BaseModel):
|
|
number: str
|
|
customer_id: int
|
|
due_at: datetime | None = None
|
|
status: str = "draft"
|
|
|
|
|
|
class InvoiceOut(InvoiceIn):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
id: int
|
|
issued_at: datetime
|
|
|
|
|
|
class InvoiceDetail(InvoiceOut):
|
|
line_items: list[LineItemOut] = []
|
|
payments: list[PaymentOut] = []
|
|
customer: CustomerOut
|