43 lines
967 B
Python
43 lines
967 B
Python
from pydantic import BaseModel
|
|
from typing import Optional, List
|
|
from datetime import datetime
|
|
|
|
|
|
class QuickTemplateCreate(BaseModel):
|
|
body: str
|
|
sort_order: Optional[int] = 0
|
|
|
|
|
|
class QuickTemplateUpdate(BaseModel):
|
|
body: Optional[str] = None
|
|
sort_order: Optional[int] = None
|
|
is_active: Optional[bool] = None
|
|
|
|
|
|
class QuickTemplateOut(BaseModel):
|
|
id: int
|
|
body: str
|
|
sort_order: int
|
|
is_active: bool
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class SendMessageRequest(BaseModel):
|
|
body: str
|
|
target_waiter_ids: List[int] # empty = all active waiters
|
|
table_ids: Optional[List[int]] = []
|
|
|
|
|
|
class StaffMessageOut(BaseModel):
|
|
id: int
|
|
sender_id: int
|
|
sender_name: Optional[str] = None
|
|
body: str
|
|
target_waiter_ids: str # raw JSON string — frontend parses
|
|
table_ids: str
|
|
created_at: datetime
|
|
acked_by: List[int] = [] # waiter ids who have acked
|
|
|
|
model_config = {"from_attributes": True}
|