feat(manager,waiter): money and weights typed with a comma or a dot everywhere

Owner 2026-11-23 (plan 6F.2): new DecimalInput / MoneyInput in @xenia/ui (keeps what is typed,
reports a number, null when empty, NaN when not a number) on parseNumber. The waiter app's starting
cash, weighed quantity and typed prices were type=number + parseFloat (a Greek keypad's comma was
dropped: 12,50 became 12 or nothing); now text fields read with parseNumber, and a wrong starting
cash shows a message. The manager's price rules, deals and order-total condition use the new
fields; every Number(x.replace(',', '.')) now reads through parseNumber (1.234,50 too). Guard test
packages/i18n/tests/typed-numbers.test.mjs refuses parseFloat, .replace(',', '.') and decimal
type=number fields in the apps. e2e: shift close with 20,50, waiter starting cash 25,50.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 07:08:54 +02:00
co-authored by Claude Opus 5.5
parent e708202f3a
commit e3f4f3eeee
27 changed files with 216 additions and 46 deletions
@@ -2,11 +2,12 @@
// evaluated by the backend's engine (local_backend/services/fees.py, the same file the cloud
// runs); this file only turns forms into request bodies and rules into readable lines.
// Pure: unit-tested in Node (tests/fees.test.mjs).
import { parseNumber } from '@xenia/i18n/number'
export const ACTIONS = ['set', 'add', 'percent', 'free', 'minimum']
export const DAYS = [0, 1, 2, 3, 4, 5, 6] // Monday = 0
const num = v => (v === '' || v == null ? null : Number(String(v).replace(',', '.')))
const num = v => (v === '' || v == null ? null : (parseNumber(String(v)) ?? NaN))
/** Postcodes typed with commas, semicolons or new lines → a tidy list without duplicates. */
export function parsePostcodes(text) {