- New reservations module: model, schema, router (CRUD + status updates + upcoming alerts) and background task for auto-expiring stale reservations - Reports: print_products, print_categories, print_tables analytics endpoints plus meta_products and business_day_summary for workday close/view flow - printer_service: configurable font sizes/weights, donut/bar chart print layout helpers, analytics print blocks per printer - tables/schemas: surfaced color, zone, and other new fields on Table, Product, User, Printer - demo_seed.py for quick dev DB population; wipe_database.py utility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
664 B
Python
34 lines
664 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
|
|
|
|
PROTOCOLS = ["escpos_tcp"] # extend later as needed
|
|
|
|
|
|
class PrinterBase(BaseModel):
|
|
name: str
|
|
ip_address: str
|
|
port: int = 9100
|
|
is_active: bool = True
|
|
protocol: str = "escpos_tcp"
|
|
line_width: int = 48
|
|
|
|
|
|
class PrinterCreate(PrinterBase):
|
|
pass
|
|
|
|
|
|
class PrinterUpdate(BaseModel):
|
|
name: Optional[str] = None
|
|
ip_address: Optional[str] = None
|
|
port: Optional[int] = None
|
|
is_active: Optional[bool] = None
|
|
protocol: Optional[str] = None
|
|
line_width: Optional[int] = None
|
|
|
|
|
|
class PrinterOut(PrinterBase):
|
|
id: int
|
|
|
|
model_config = {"from_attributes": True}
|