The Project Management screen (/pm, view only) with Overview, Projects & units, Bottlenecks & aging, Hours vs target, Quality & issues and Find jobs, the period picker, health per unit and per project, drill down, Excel (CSV) per table and for all, and the PESCO production status report PDF with the controlled-copy stamp; every export logged as "report exported". The find bar on every home screen: the full search set, the dropdowns, quick flags with Mine, the flag kinds, Board and List with sorts, filters saved per browser; every filter applied by the server on the list and the boards, with facets. Presence in packets with role, lock and revoke drop; the motion switch with reduced motion honoured, card glides, glow and count-up; Back restores the scroll spot; sheet placement and the iPad layout pass. The data book compared page by page with the old build and six layout differences fixed. Tests for the PM aggregates, search, filters, presence and exports; Playwright scenarios for the PM screen, the find bar and presence at desktop and iPad viewports. Docs updated; PLAN.md questions 38 to 42. Co-Authored-By: Claude Fable 5.1 <[email protected]>
25 lines
1.2 KiB
TypeScript
25 lines
1.2 KiB
TypeScript
// The warehouse board (phase 4 contract, api/warehouse.py).
|
|
import { api } from "./client";
|
|
import { qs } from "./query";
|
|
import { normaliseFacets, type BoardQuery, type BoardResponse, type PacketCard } from "./types";
|
|
|
|
const COLUMNS = ["incoming", "pulling", "hold", "pulled", "released"] as const;
|
|
|
|
/** Every column and number present, even when the server leaves one out. */
|
|
function normalise(raw: Partial<BoardResponse> | null): BoardResponse {
|
|
const cols = (raw?.columns ?? {}) as Partial<Record<(typeof COLUMNS)[number], PacketCard[]>>;
|
|
const columns = Object.fromEntries(COLUMNS.map((c) => [c, Array.isArray(cols[c]) ? cols[c] : []])) as BoardResponse["columns"];
|
|
const facets = normaliseFacets(raw?.facets);
|
|
return {
|
|
kpis: { waiting: 0, pulling: 0, hold: 0, pulled: 0, open_shorts: 0, released_24h: 0, ...(raw?.kpis ?? {}) },
|
|
columns,
|
|
shorts: Array.isArray(raw?.shorts) ? raw.shorts : [],
|
|
...(facets ? { facets } : {}),
|
|
};
|
|
}
|
|
|
|
export const warehouseApi = {
|
|
board: async (q: BoardQuery = {}, signal?: AbortSignal): Promise<BoardResponse> =>
|
|
normalise(await api.get<Partial<BoardResponse> | null>(`/api/warehouse/board${qs({ ...q })}`, signal)),
|
|
};
|