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
+5 -2
View File
@@ -955,8 +955,11 @@ try {
await page.keyboard.press('Escape')
await ovRow.getByTestId('shift-end').click()
await page.getByTestId('shift-next').click()
await page.getByTestId('shift-counted').fill('18')
r.check(`${ov} ending it: €18 handed over shows "short"`, await page.getByTestId('shift-check').getAttribute('data-state').catch(() => '') === 'short')
// a comma or a dot for the cents (6F.2): "20,50" is exactly the expected €20.50, "18.5" is short
await page.getByTestId('shift-counted').fill('20,50')
r.check(`${ov} ending it: "20,50" typed with a comma is exactly what's expected`, await page.getByTestId('shift-check').getAttribute('data-state').catch(() => '') === 'even')
await page.getByTestId('shift-counted').fill('18.5')
r.check(`${ov} ending it: €18.5 handed over shows "short"`, await page.getByTestId('shift-check').getAttribute('data-state').catch(() => '') === 'short')
await page.screenshot({ path: path.join(OUT, 'manager-overview-shift.png') })
await page.getByTestId('shift-end-confirm').click()
await ovRow.waitFor({ state: 'detached', timeout: 8000 }).catch(() => {})