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 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 09:53:07 +02:00
co-authored by Claude Opus 5.5
parent 91da3aeb27
commit c699542565
+1 -2
View File
@@ -1572,8 +1572,7 @@ def apply_waiter_discount(
discount_value=body.discount_percent, discount_value=body.discount_percent,
applied_by=user.id, applied_by=user.id,
reason=body.note, reason=body.note,
price_before=price_before, # before/after prices live in price_event_log (the audit spine, CS-4) below
price_after=price_after,
)) ))
# Write to price_event_log (immutable audit spine) # Write to price_event_log (immutable audit spine)