feat: pricing on v2 (platform-v2 step 6.7)

- manager src/pages/pricing: price rules, price groups, deals, discounts on the tokens,
  English and Greek; the rules as data in pricingLogic.js (tests/pricing.test.mjs)
- routers/pricing: set-up needs pricing.manage, broadcasts pricing.changed; incomplete
  conditions refused (pricing.bad_condition); venue discount settings saved again (the
  date-as-text bug) with empty = no limit (pricing.bad_limit), old "None" tolerated
- nav: Offers & pricing needs pricing.manage
- tests: test_pricing_setup.py (a happy-hour rule prices a counter quote), manager.mjs e2e

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 15:40:51 +02:00
co-authored by Claude Opus 5.5
parent c1af7770cf
commit fd3254aa31
28 changed files with 2040 additions and 2118 deletions
+4
View File
@@ -325,5 +325,9 @@
"waste": {
"not_found": "Throwaway entry not found.",
"not_today": "Only throwaways of the open business day can be deleted."
},
"pricing": {
"bad_limit": "A discount limit must be a number of 0 or more, or empty for no limit.",
"bad_condition": "A condition is incomplete: fill in all its values."
}
}
+253
View File
@@ -1844,5 +1844,258 @@
"seconds_other": "{{count}} seconds",
"minutes_one": "{{count}} minute",
"minutes_other": "{{count}} minutes"
},
"pricing": {
"pageTitle": "Offers & pricing",
"intro": "Rules that change prices by themselves (happy hour, a season, a sales point), switches that turn several on at once, deals the waiters offer, and how much discount each person may give. New prices apply to what is added to orders from then on.",
"tabs": {
"rules": "Price rules",
"groups": "Price groups",
"deals": "Deals",
"discounts": "Discounts"
},
"name": "Name",
"description": "Description (optional)",
"colour": "Colour",
"save": "Save",
"cancel": "Cancel",
"delete": "Delete",
"edit": "Edit",
"remove": "Remove",
"add": "Add",
"up": "Higher priority",
"down": "Lower priority",
"turnOn": "Turn on",
"turnOff": "Turn off",
"on": "On",
"off": "Off",
"saved": "Saved.",
"deleted": "Deleted.",
"choose": "Choose…",
"search": "Search",
"nothingFound": "Nothing found.",
"newTag": "Another tag",
"missing": "Fill in: {{list}}.",
"target": {
"type": "Which products",
"add": "Add products",
"types": {
"all": "All products",
"any": "Any product",
"item": "Some products",
"category": "Categories",
"prep_zone": "Prep zones (kitchen, bar…)",
"tag": "Tags"
}
},
"condition": {
"type": "Condition",
"add": "Add a condition",
"from": "From",
"to": "To",
"date": "A date",
"timeHint": "In the venue's time. \"To\" earlier than \"From\" crosses midnight (e.g. 22:00 to 02:00).",
"ofTheDish": "or more of the same product in the order",
"orderTotal": "€ or more in the order",
"fromCategory": "or more from",
"noGroups": "Make a price group first",
"placeholder": "An old condition that does nothing (it can be removed).",
"types": {
"time_range": "Time of day",
"day_of_week": "Days of the week",
"date_range": "Between two dates",
"specific_date": "On some dates",
"price_group_active": "A price group is on",
"order_channel": "Sales point",
"min_item_quantity": "At least some of the product",
"min_category_qty": "At least some from a category",
"min_order_value": "Order total at least"
},
"fields": {
"min_item_quantity": "How many",
"min_category_qty": "How many",
"min_order_value": "Amount",
"category_id": "Category",
"price_group_id": "Price group"
}
},
"actions": {
"add_percent": "± a percentage",
"add_amount": "± an amount",
"set": "A new price",
"valueLabel": {
"add_percent": "Percentage (%)",
"add_amount": "Amount (€)",
"set": "The new price (€)"
},
"minusHint": "A minus makes it cheaper (−10 = 10% off); a plus makes it dearer."
},
"roundings": {
"none": "No rounding",
"0_05": "To the nearest €0.05",
"0_10": "To the nearest €0.10",
"0_20": "To the nearest €0.20",
"0_50": "To the nearest €0.50",
"x_99": "To x.99 (e.g. 4.99)",
"x_00": "To a whole euro"
},
"rules": {
"title": "Price rules",
"new": "New price rule",
"edit": "Edit the price rule",
"intro": "A rule changes the price of some products while its conditions hold, for example \"drinks −20% from 17:00 to 19:00 on weekdays\". The counter, the phones, the tablets and online orders use it for what is added from then on.",
"none": "No price rules yet",
"noneHint": "Make one for a happy hour, a season or a sales point.",
"orderHint": "Higher in the list = first. Of the rules that don't stack, only the first that applies to a product counts; the stacking ones then all apply. The final price is rounded to €0.10.",
"namePlaceholder": "e.g. Happy hour drinks",
"allProducts": "All products",
"someProducts_one": "{{count}} group of products",
"someProducts_other": "{{count}} groups of products",
"conditions_one": "{{count}} condition",
"conditions_other": "{{count}} conditions",
"always": "always (while it's on)",
"stacks": "stacks",
"pages": {
"what": "Products",
"when": "When",
"price": "Price"
},
"scopes": {
"global": "Products, categories, tags…",
"item": "One product"
},
"product": "Product",
"targetsHint": "The rule changes the products of any of these rows.",
"conditionsHint": "All the conditions must hold at the moment a product is added. With none, the rule applies whenever it is on.",
"on": "On",
"onHint": "Off: it never applies, whatever the conditions.",
"rounding": "Rounding",
"example": "A product at {{before}} costs {{after}}.",
"stack": "Stacks with other rules",
"stackTip": "A rule that stacks applies after the first non-stacking rule, on its result (e.g. −10% then −€0.50). One that doesn't stack applies only if no rule above it already did.",
"deleteTitle": "Delete the price rule?",
"deleteBody": "\"{{name}}\" will no longer change any price. Lines already on orders keep their price.",
"problems": {
"name": "the name",
"product": "the product",
"targets": "which products",
"conditions": "every condition's values",
"value": "the price"
}
},
"groups": {
"title": "Price groups",
"new": "New price group",
"edit": "Edit the price group",
"intro": "A price group is a switch, like \"Happy hour\" or \"Summer\". Price rules and deals with the condition \"a price group is on\" follow it, so one switch turns several on. Turn it on by hand, or give it a weekly schedule.",
"none": "No price groups yet",
"noneHint": "Make one to turn several price rules on and off together.",
"namePlaceholder": "e.g. Happy hour",
"byHand": "On and off by hand",
"scheduled": "On {{from}}–{{to}}, {{days}}",
"onNow": "On now",
"onNowHint": "With a schedule it is also on inside the schedule's hours; outside them this switch decides.",
"schedule": "Weekly schedule (optional)",
"scheduleHint": "From, to and at least one day, in the venue's time; \"To\" earlier than \"From\" crosses midnight.",
"deleteTitle": "Delete the price group?",
"deleteBody": "Rules and deals with the condition \"{{name}} is on\" will no longer apply until you change them.",
"problems": {
"name": "the name",
"schedule": "the whole schedule (from, to and a day) or none of it"
}
},
"deals": {
"title": "Deals",
"new": "New deal",
"edit": "Edit the deal",
"intro": "A deal is offered to the waiter when an order has the right products, e.g. \"3 beers → the 4th free\". The waiter's phone shows it and the waiter accepts or skips it: nothing is applied by itself.",
"none": "No deals yet",
"noneHint": "e.g. \"Buy 3 beers, get 1 free\".",
"namePlaceholder": "e.g. 3 beers + 1 free",
"descriptionHint": "The waiter sees it with the offer.",
"pages": {
"when": "When",
"gives": "What it gives"
},
"targetsHint": "The order must have products of any of these rows.",
"conditionsHint": "And, optionally, all of these conditions.",
"on": "On",
"actions": {
"free_item": "A free product",
"free_choice": "A free product of the guest's choice",
"apply_modifier": "A price rule",
"set_price": "A new price",
"add_amount": "± an amount",
"add_percent": "± a percentage"
},
"freeProduct": "Free product",
"freeFrom": {
"item": "From these products",
"category": "From these categories",
"tag": "With these tags"
},
"quantity": "How many free",
"rule": "Price rule",
"ruleHint": "Only rules without conditions (they apply when the waiter accepts the deal).",
"noManualRules": "No rule without conditions yet",
"givesFree_one": "{{count}} × {{name}} free",
"givesFree_other": "{{count}} × {{name}} free",
"givesChoice_one": "{{count}} free of their choice",
"givesChoice_other": "{{count}} free of their choice",
"givesRule": "Rule: {{name}}",
"deleteTitle": "Delete the deal?",
"deleteBody": "\"{{name}}\" will no longer be offered.",
"problems": {
"name": "the name",
"targets": "which products",
"conditions": "every condition's values",
"modifier": "the price rule",
"freeItem": "the free product",
"freeChoice": "what the guest chooses from",
"value": "the amount",
"quantity": "how many"
}
},
"discounts": {
"title": "Discounts",
"intro": "Who may give discounts and how much. The venue's limits and each person's both apply: the first one reached stops the discount. Past a limit, the person needs a manager's approval on the spot, unless their role may \"give discounts beyond the limits\". An empty box means no limit.",
"venue": "The whole venue",
"venueHint": "For everyone, on top of each person's limits.",
"enabled": "Discounts allowed",
"enabledHint": "Off: nobody can give a discount, not even with a manager's approval.",
"person": "Each person",
"personHint": "Their own limits. Choose a person, change, save.",
"who": "Person",
"nobody": "No active staff.",
"can": "May give discounts",
"canHint": "Off: this person can't give any discount by themselves.",
"noLimit": "no limit",
"items": "items",
"badNumber": "A number of 0 or more (whole for items), or empty.",
"venueLimits": {
"max_total_value_workday": "Most per business day",
"max_total_value_workdayHint": "All the discounts of the day, everyone together.",
"max_total_value_shift": "Most during a shift",
"max_total_value_shiftHint": "All discounts given since the waiter's shift began, everyone together.",
"max_items_per_shift": "Most items during a shift",
"max_items_per_shiftHint": "Discounted items since the waiter's shift began, everyone together."
},
"personLimits": {
"max_discount_percent": "Most per discount",
"max_discount_percentHint": "The highest percentage at a time.",
"max_discount_amount": "Most off one item",
"max_discount_amountHint": "The most taken off one item's price.",
"max_total_value_shift": "Most per shift",
"max_total_value_shiftHint": "Their discounts in one shift.",
"max_total_value_workday": "Most per business day",
"max_total_value_workdayHint": "Their discounts in one day.",
"max_items_per_shift": "Items per shift",
"max_items_per_shiftHint": "Discounted items in one shift.",
"max_items_per_workday": "Items per business day",
"max_items_per_workdayHint": "Discounted items in one day.",
"max_items_per_order": "Items per order",
"max_items_per_orderHint": "Discounted items on one order."
}
}
}
}