Snapshot of in-progress work across local_backend, manager_dashboard, and waiter_pwa (pricing, chat, fiscal, prep zones, recovery codes, CRM, inventory, permissions), plus the nginx/docker-compose deploy fixes for the Unraid + NPM reverse-proxy setup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
46 lines
1.2 KiB
Python
46 lines
1.2 KiB
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
|
|
|
|
PROTOCOLS = ["escpos_tcp"] # extend later as needed
|
|
|
|
# Known printer profiles — (codepage_n, python_encoding)
|
|
# codepage_n: the n byte in ESC t n sent on connect
|
|
# python_encoding: used to encode Greek text to bytes
|
|
PRINTER_PROFILES = {
|
|
"jolimark": {"label": "Jolimark TP850UE", "codepage_n": 29, "encoding": "cp737"},
|
|
"samas": {"label": "S4MAS Giant 100", "codepage_n": 29, "encoding": "cp737"},
|
|
"netum": {"label": "NETUM NT8330L", "codepage_n": 14, "encoding": "cp737"},
|
|
}
|
|
DEFAULT_PROFILE = "jolimark"
|
|
|
|
|
|
class PrinterBase(BaseModel):
|
|
name: str
|
|
ip_address: str
|
|
port: int = 9100
|
|
is_active: bool = True
|
|
protocol: str = "escpos_tcp"
|
|
line_width: int = 48
|
|
codepage_n: int = 29
|
|
|
|
|
|
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
|
|
codepage_n: Optional[int] = None
|
|
|
|
|
|
class PrinterOut(PrinterBase):
|
|
id: int
|
|
|
|
model_config = {"from_attributes": True}
|