Fixed Form Vlidation

This commit is contained in:
Shubhankar45
2026-09-22 10:36:55 +00:00
parent 8fdd20b29f
commit 2ed3945b5d
2435 changed files with 892940 additions and 32 deletions
+6
View File
@@ -52,5 +52,11 @@ export const humanize = (key: string) =>
.map((word) => (ACRONYMS.has(word) ? word.toUpperCase() : word.charAt(0).toUpperCase() + word.slice(1)))
.join(" ");
/** Column labels that read wrong once spelled out from their key. The stored column is still
* "aug_sales" (the printed form's own field, matching the database and the PDF) — this is only
* what the app displays, since "Aug Sales" is misleading once the row can be any month. */
const COLUMN_LABEL_OVERRIDES: Record<string, string> = { aug_sales: "Month Sales" };
export const columnLabel = (key: string) => COLUMN_LABEL_OVERRIDES[key] ?? humanize(key);
export const errorMessage = (error: unknown, fallback = "Something went wrong") =>
error instanceof Error ? error.message : fallback;