2026-04-22. Fifth cycle of R1 (NIX-OS-67 Phase 3 POS): order numbers now follow spec §8.8 —
POS{configId}-{seq}, zero-padded, reset at midnight in the tenant's local
timezone. Example: POS01-0001 → POS01-0002 …
POS01-9999. The counter is atomic even with concurrent cashiers.
INSERT … ON CONFLICT DO UPDATE … RETURNING holds the row lock so no two orders
can share a number. Timezone math verified: 18:00 UTC in Asia/Phnom_Penh resolves to the
next day — cashiers close shift at 22:00 local, not UTC.
POS{N}-0001),
verify cafe.pos_sequences has a row with next_seq=2, and confirm
Odoo pos.order.name carries the NIX-issued number too.
lib/db/pos_sequences.ts (new) — advanceSequence via
atomic UPSERT+RETURNING, peekSequence, businessDateForTimezone,
formatPosOrderNumber. Table cafe.pos_sequences already shipped
in R1.2 — no new migration.lib/tenant.ts — TenantConfig gains timezone
(read from public.tenants.timezone, default Asia/Phnom_Penh).lib/odoo/queries.ts — createPosOrder accepts optional
overrideName; when provided, it rides on both pos.order.name
and pos_reference so receipts and order history both show it./api/odoo/order — advances the per-register daily sequence before
calling Odoo, formats the NIX order number, passes as overrideName. Gracefully
falls back to Odoo's auto-generated name if sequencing fails (log + continue).Register / PaymentModal — client now sends
posConfigId in the order POST so the API has what it needs.Loading…
Loading…