feat: delivery areas and fee rules with "test an order" (platform-v2 3S, S.3)
- models/fees.py + Alembic 0018: delivery_areas, fee_rules; key connect_orders.fees (owner, store manager; existing ones get it). - services/fees.py: the pure engine (set / add / % / free / minimum, conditions: sales points, areas, products total, item count, days, time incl. past midnight, stop), the same file as the cloud's; tests/fixtures/fee_cases.json shared, plus a test that the cloud copy is identical. - routers/fees.py at /api/connect/fees: areas and rules CRUD (validated), order, preview. - Snapshot carries fees + the venue's time zone; a change to products, pricing or fees pushes the menu within ~5 s (middleware -> cloud_sync.request_menu_push). - Manager: Online -> Delivery fees page (@xenia/ui): rules in order with words for each, areas with postcodes, "Test an order"; en/el texts; feesLogic.js unit-tested. - Tests: test_fees.py (39), manager unit +5, manager.mjs +7 on the real page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,5 +97,11 @@
|
||||
"invalid": "This refund doesn't add up ({{reason}}).",
|
||||
"too_old": "Only payments from today's business day can be refunded at the counter.",
|
||||
"items_changed": "Some of these items were refunded in the meantime. Check the order and try again."
|
||||
},
|
||||
"fees": {
|
||||
"area_not_found": "Delivery area {{area_id}} not found.",
|
||||
"rule_not_found": "Fee rule {{rule_id}} not found.",
|
||||
"area_in_use": "This area is used by fee rules: {{rules}}. Change those rules first.",
|
||||
"order_invalid": "The new order must list every rule once."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user