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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user