feat(manager): the overview, online orders and the day summary on v2 (platform-v2 step 6.2)

- DashboardPage (2.8k lines) → src/pages/overview/: OverviewPage + cards (shifts, tables,
  pending prints, notes, bookings, messages) and dialogs (order at a glance, shift review /
  end with the cash handover, day summary with cash count and checks); arithmetic in
  overviewLogic.js (tests/overview.test.mjs). Data via useLiveQuery: orders and tables
  live, day and shifts every 15 s. Bookings typed in venue time; decline reason in a dialog.
- OnlineOrdersPage → src/pages/online/ on react-query + live events; unused API helpers dropped.
- WorkdaySummaryModal → overview/DaySummaryDialog + DaySummaryTabs.
- Every text in manager.json (en + el, 342 keys); tokens only; v2.json adds overview, hooks.
- Backend: business day open/close answer only with codes (license.locked, license.expired,
  business_day.orders_open); XeniaError's v1 `detail` removed.
- @xenia/i18n: formatDateTime with Intl options threw "unknown date style" (fixed, tested).
- e2e manager.mjs: open the day, a shift (start, stats, end short), a live table, a booking,
  day stats, Greek, close the day (forced), online orders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 09:01:51 +02:00
co-authored by Claude Opus 5.5
parent 2dc5da446e
commit 8a02173450
32 changed files with 3161 additions and 4126 deletions
+3 -2
View File
@@ -51,7 +51,8 @@ export function createFormatters({ language = 'en', timeZone = DEFAULT_TIMEZONE,
if (!cache.has(k)) cache.set(k, make())
return cache.get(k)
}
const dtf = (style, zone) => intl('dt', `${style}|${zone}`, () => {
// style: a DATE_STYLES name or an Intl options object (cached by its JSON)
const dtf = (style, zone) => intl('dt', `${typeof style === 'string' ? style : JSON.stringify(style)}|${zone}`, () => {
const options = typeof style === 'string' ? DATE_STYLES[style] : style
if (!options) throw new Error(`unknown date style "${style}"`)
return new Intl.DateTimeFormat(locale, { ...options, timeZone: zone })
@@ -61,7 +62,7 @@ export function createFormatters({ language = 'en', timeZone = DEFAULT_TIMEZONE,
function formatDateTime(value, style = 'datetime') {
if (typeof value === 'string' && DATE_ONLY.test(value)) return formatDate(value, style)
const d = toDate(value)
return d ? dtf(typeof style === 'string' ? style : JSON.stringify(style), timeZone).format(d) : ''
return d ? dtf(style, timeZone).format(d) : ''
}
const formatTime = (value, style = 'time') => formatDateTime(value, style)