From c699542565da59a192667bd92c47cab756ab1135 Mon Sep 17 00:00:00 2001 From: bonamin Date: Fri, 13 Nov 2026 09:53:07 +0200 Subject: [PATCH] fix(backend): waiter discounts crashed after order_discounts.price_before/after were dropped Revision 0001_v2_baseline dropped order_discounts.price_before/price_after as unused, but POST /api/orders/{id}/items/discount still passed them to OrderDiscount, so every waiter discount failed with a 500 on platform-v2. Nothing reads them from order_discounts: the before/after prices are recorded in price_event_log (CS-4). Found while testing step 1.9 (manager override of discount limits). Co-Authored-By: Claude Opus 5.5 --- local_backend/routers/orders.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/local_backend/routers/orders.py b/local_backend/routers/orders.py index 2a9fc66..341480a 100644 --- a/local_backend/routers/orders.py +++ b/local_backend/routers/orders.py @@ -1572,8 +1572,7 @@ def apply_waiter_discount( discount_value=body.discount_percent, applied_by=user.id, reason=body.note, - price_before=price_before, - price_after=price_after, + # before/after prices live in price_event_log (the audit spine, CS-4) below )) # Write to price_event_log (immutable audit spine)