WFDASH-WEBAPP/src/app/(mobile)/manager/layout.tsx
Dave b212d0fcd8 feat(manager): a mobile orders board for the managers at /manager
A hidden, installable PWA: one link, opened on a phone, showing where
every order is. New / Processing / Completed, with a tap-to-preview
popup and the invoice/line detail Gary needs. Read-only, and NOT in
the sidebar — the route lives outside `(app)`, so `<Sidebar />` never
renders there.

The preview popup is reused, not rebuilt: the service emits
`UniversalHit`s and the page hands them to the existing
`SearchPreviewDialog`, so the manager gets the desk's quick-overview
verbatim.

Also fixes the /orders Completed tab, which was matching ZERO orders.
`delivered_at` is stamped on only 2 of 12,957 delivered lines and the
business stopped writing `delivered` on 2026-08-14 (the live pipeline
now ends at `invoiced` / `checked_in`), so the old filter never
matched. "Settled" is now defined once — `SETTLED_STATUSES` +
`SETTLED_DATE_FIELDS` — and dated per status: `invoiced_date` for
invoiced (the only properly stamped field, 2,199 lines), `delivered_at`
for delivered, `updated` only where no dedicated column exists.

`delivery_note` and `checked_in` move into `completed` as instructed,
and the standalone `post_processing` tab is retired (a DN is not a
stage of its own). `invoiced` stays in `collected` as well, so
invoiced orders don't vanish from the workflow tabs.

Completed tab: 0 -> 341 orders over 30 days, 112 over 7.
2026-10-26 23:09:01 +02:00

42 lines
1.2 KiB
TypeScript

import type { Metadata, Viewport } from "next";
import type { ReactNode } from "react";
import { MobileAuthGate } from "./auth-gate";
export const metadata: Metadata = {
title: "WFDASH — Orders",
description:
"Manager's phone view of the order pipeline: what's new, what's processing, and what finished this week.",
manifest: "/manifest-manager.json",
icons: {
apple: "/apple-touch-icon.png",
},
appleWebApp: {
capable: true,
statusBarStyle: "default",
title: "Orders",
},
other: {
// Next 16 emits only the standardised `mobile-web-app-capable` for
// `appleWebApp.capable`, and iOS ignores that name — so without
// this the home-screen icon opens as a Safari bookmark rather than
// a standalone app. See the same note in `(mobile)/m/layout.tsx`.
"apple-mobile-web-app-capable": "yes",
},
};
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
viewportFit: "cover",
themeColor: "#0b1020",
};
export default function ManagerLayout({ children }: { children: ReactNode }) {
return (
<MobileAuthGate>
<main className="min-h-screen bg-background text-foreground antialiased">
{children}
</main>
</MobileAuthGate>
);
}