feat(backend,waiter,terminal,manager): +1 on a sent line and changing a line's quantity
Owner 2026-11-23 (plan 6F.5). Product flag one_more_enabled (off by default; product editor).
POST /api/orders/{id}/items/{item}/again: a new line like the old one (choices, removed, note,
course), priced now, sent to the kitchen like any new line. Waiter app and the counter's table
panel: +1 beside such lines; the first tap arms it, more taps count up, 'Send +N' sends, 4 s idle
disarms (no stray sends).
POST /api/orders/{id}/items/{item}/quantity: venue setting orders.quantity_change (off | add_only |
add_and_remove, default off), key ordering.items.change_quantity (owner, store manager; Alembic 0049
grants it); up only changes the line, down cuts a cancelled part ('quantity lowered', split_from_id)
and prints a cancellation only when asked (the dialog presets yes while the kitchen hasn't finished).
Waiter: 'Change quantity' in a line's actions (now -> new, -/+). cut_part() now shared with split.
GET /api/orders/{id} items carry the product's one_more_enabled / unit_type, deal ids, split_from_id,
cancel_reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,8 @@ class AddItemsRequest(BaseModel):
|
||||
class ProductNameOut(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
one_more_enabled: bool = False # 6F.5: the line shows +1
|
||||
unit_type: Optional[str] = None
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
|
||||
@@ -386,6 +386,7 @@ class ProductBase(BaseModel):
|
||||
cost_breakdown: Optional[List[CostBreakdownItem]] = None
|
||||
# Quick Add
|
||||
quick_add_enabled: bool = True
|
||||
one_more_enabled: bool = False # 6F.5
|
||||
# Tags
|
||||
tags: Optional[List[str]] = None
|
||||
# The EU allergens (plan step 6.3): {key: "contains" | "may_contain"}, core/allergens.py
|
||||
@@ -437,6 +438,7 @@ class ProductUpdate(BaseModel):
|
||||
cost_breakdown: Optional[List[CostBreakdownItem]] = None
|
||||
# Quick Add
|
||||
quick_add_enabled: Optional[bool] = None
|
||||
one_more_enabled: Optional[bool] = None # 6F.5
|
||||
# Tags
|
||||
tags: Optional[List[str]] = None
|
||||
allergens: Optional[Dict[str, str]] = None # None = unchanged, {} = none
|
||||
@@ -510,6 +512,7 @@ class ProductOut(ProductBase):
|
||||
'cost_simple': data.cost_simple,
|
||||
'cost_breakdown': parsed,
|
||||
'quick_add_enabled': getattr(data, 'quick_add_enabled', True),
|
||||
'one_more_enabled': bool(getattr(data, 'one_more_enabled', False)),
|
||||
'tags': json.loads(data.tags) if isinstance(getattr(data, 'tags', None), str) else (getattr(data, 'tags', None) or []),
|
||||
'allergens': _allergens_of(data),
|
||||
'translations': _menu_tr_of(data),
|
||||
|
||||
Reference in New Issue
Block a user