feat(ordering): orders priced by the server (platform-v2 step 4.4)

The waiter app (and the manager's ordering tab) send what was chosen, by id; the
server prices it with the counter's code. No app sends a price any more.

- POST /api/orders/{id}/items takes `lines` (pos_cart's line + course_id,
  price_adjustment, is_service_item): sales point checked first, refusals name the
  product and line (order.line.*, order.not_sold_here); prices or selected_options in a
  line -> order.line.client_price, the old `items` shape -> order.lines_required; a
  by-hand price change needs ordering.prices.modify or a manager's approval (audited
  PRICE_SET_BY_HAND). add_priced_items is the one writer of priced items (pos too).
- POST /api/orders/quote: the cart's total before sending; /api/pos/quote shares
  pos_cart.quote().
- pos_cart: a preference set left out takes its default; a set at its free default
  isn't stored; a default that costs is charged (the waiter never sent it: fixed);
  an extra's sub-choice is charged per extra (the counter charged it once: fixed).
- @xenia/api lines.js: lineFromOptions / wireLine / estimate / LineError.
- Waiter: lines on send; cart total from the quote ("≈ estimate" offline); summary
  shows the same prices; offline orders queued by id, priced on sync, refused lines
  shown on a "Δεν στάλθηκαν" sheet (no empty order opened); dead ItemOptionsModal gone.
- Tests: test_order_lines.py (14), lines.test.mjs, waiter e2e +6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 03:35:03 +02:00
co-authored by Claude Opus 5.5
parent bcf91bf6e9
commit 8e0a786bbc
25 changed files with 1052 additions and 656 deletions
+10 -1
View File
@@ -62,7 +62,16 @@
},
"order": {
"not_found": "Η παραγγελία {{order_id}} δεν βρέθηκε.",
"not_sold_here": "Το {{name}} δεν πωλείται για αυτό το είδος παραγγελίας."
"not_sold_here": "Το {{name}} δεν πωλείται για αυτό το είδος παραγγελίας.",
"lines_required": "Αυτή η εφαρμογή έστειλε την παραγγελία σε παλιά μορφή. Ενημερώστε την εφαρμογή και στείλτε ξανά.",
"line": {
"product_unavailable": "Το «{{name}}» δεν είναι πια διαθέσιμο (γραμμή {{line}}).",
"option_gone": "«{{name}}»: μια επιλογή δεν υπάρχει πια (γραμμή {{line}}). Αφαιρέστε το και προσθέστε το ξανά.",
"choice_missing": "«{{name}}»: λείπει μια υποχρεωτική επιλογή (γραμμή {{line}}).",
"quantity": "«{{name}}»: αυτή η ποσότητα δεν επιτρέπεται (γραμμή {{line}}).",
"price": "«{{name}}»: αυτή η αλλαγή τιμής δεν επιτρέπεται (γραμμή {{line}}).",
"client_price": "«{{name}}»: η εφαρμογή έστειλε δικές της τιμές, ενώ οι τιμές έρχονται από τον server (γραμμή {{line}}). Ενημερώστε την εφαρμογή."
}
},
"notification": {
"not_found": "Η ειδοποίηση {{notification_id}} δεν βρέθηκε."
+10 -1
View File
@@ -62,7 +62,16 @@
},
"order": {
"not_found": "Order {{order_id}} not found.",
"not_sold_here": "{{name}} isn't sold for this kind of order."
"not_sold_here": "{{name}} isn't sold for this kind of order.",
"lines_required": "This app sent the order in an old format. Update the app and send it again.",
"line": {
"product_unavailable": "{{name}} isn't available any more (line {{line}}).",
"option_gone": "{{name}}: a chosen option doesn't exist any more (line {{line}}). Remove it and add it again.",
"choice_missing": "{{name}}: a required choice is missing (line {{line}}).",
"quantity": "{{name}}: that quantity isn't allowed (line {{line}}).",
"price": "{{name}}: that price change isn't allowed (line {{line}}).",
"client_price": "{{name}}: the app sent its own prices, but prices come from the server (line {{line}}). Update the app."
}
},
"notification": {
"not_found": "Notification {{notification_id}} not found."