Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+75
@@ -0,0 +1,75 @@
|
||||
import type { VMState } from "../index.js";
|
||||
import type { HrReminderCadenceKind } from "./reminder-cadence.js";
|
||||
|
||||
/**
|
||||
* HR upload-reminder admin view-model (AK-P17b). Pure function. Lists reminder
|
||||
* definitions with cadence/audience/status labels and dispatch counts. No React,
|
||||
* no Prisma, no app imports. `HrReminderCadenceKind` is reused from
|
||||
* reminder-cadence.js to keep a single source of truth for the cadence union.
|
||||
*/
|
||||
|
||||
export type HrReminderStatus = "active" | "paused" | "completed";
|
||||
|
||||
export interface HrReminderRow {
|
||||
readonly id: string;
|
||||
readonly title: string;
|
||||
readonly cadenceKind: HrReminderCadenceKind;
|
||||
readonly cadenceLabelKey: string;
|
||||
readonly intervalMonths: number | null;
|
||||
readonly documentKindKey: string;
|
||||
readonly audienceLabelKey: string;
|
||||
readonly mandatory: boolean;
|
||||
readonly escalateToManager: boolean;
|
||||
readonly status: HrReminderStatus;
|
||||
readonly statusLabelKey: string;
|
||||
readonly dueIso: string | null;
|
||||
readonly pendingCount: number;
|
||||
readonly detailHref: string;
|
||||
}
|
||||
|
||||
export interface HrReminderListData {
|
||||
readonly rows: readonly HrReminderRow[];
|
||||
readonly createHref: string;
|
||||
readonly emptyHeadlineKey: string;
|
||||
readonly emptyBodyKey: string;
|
||||
}
|
||||
|
||||
export type HrReminderListVM = VMState<HrReminderListData>;
|
||||
|
||||
export interface HrReminderInputRow {
|
||||
readonly id: string;
|
||||
readonly title: string;
|
||||
readonly cadenceKind: HrReminderCadenceKind;
|
||||
readonly intervalMonths: number | null;
|
||||
readonly documentKind: string;
|
||||
readonly audienceKind: string;
|
||||
readonly mandatory: boolean;
|
||||
readonly escalateToManager: boolean;
|
||||
readonly status: HrReminderStatus;
|
||||
readonly dueIso: string | null;
|
||||
readonly pendingCount: number;
|
||||
readonly detailHref: string;
|
||||
}
|
||||
|
||||
export function buildHrReminderListVM(input: { rows: readonly HrReminderInputRow[]; createHref: string }): HrReminderListVM {
|
||||
const rows: HrReminderRow[] = input.rows.map((row) => ({
|
||||
id: row.id,
|
||||
title: row.title,
|
||||
cadenceKind: row.cadenceKind,
|
||||
cadenceLabelKey: `hr.reminders.cadence.${row.cadenceKind}`,
|
||||
intervalMonths: row.intervalMonths,
|
||||
documentKindKey: `hr.document.kind.${row.documentKind}`,
|
||||
audienceLabelKey: `hr.audience.${row.audienceKind}`,
|
||||
mandatory: row.mandatory,
|
||||
escalateToManager: row.escalateToManager,
|
||||
status: row.status,
|
||||
statusLabelKey: `hr.reminders.status.${row.status}`,
|
||||
dueIso: row.dueIso,
|
||||
pendingCount: row.pendingCount,
|
||||
detailHref: row.detailHref,
|
||||
}));
|
||||
return {
|
||||
status: "ready",
|
||||
data: { rows, createHref: input.createHref, emptyHeadlineKey: "hr.reminders.empty.headline", emptyBodyKey: "hr.reminders.empty.body" },
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user