Project

General

Profile

Actions

Feature #138

open
SV SV

[HR][P0] Foundations

Feature #138: [HR][P0] Foundations

Added by Sravan V S about 2 months ago. Updated 10 days ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Target version:
-
Start date:
09/28/2026
Due date:
% Done:

0%

Estimated time:
Resolved By:

Description

Build apps/portal/src/guards/ui-conventions.test.ts from scratch (does not exist yet): ban em dash, window.confirm, raw error text in a toast, toast.success with no API call, static AI badge, local components/ui folder, plus HR-specific bans on toISOString().slice(0,10) and DateOnly.FromDateTime(DateTime.UtcNow) outside a shared clock helper. Add friendlyError. Add one hospital-local-day clock helper shared by API and portal. Remove dead code.

Size: M

Source: clinq-docs/modules/hr/reviews/2026-09-28-ui-audit/ (branch docs/hr-ui-audit-2026-09-28)

Findings covered:

  • A-23
  • A-22
  • A-32
  • A-42
  • A-15
  • A-16
  • B-44

SV Updated by Sravan V S about 2 months ago Actions #1

  • Assignee set to Sravan V S

S- Updated by SK - 13 days ago Actions #2

  • Assignee changed from Sravan V S to SK -

S- Updated by SK - 13 days ago Actions #3

  • Status changed from New to Resolved
  • Assignee changed from SK - to Roshni Harish.
  • Resolved By set to SK -

Fixed and merged to dev on nuvita-hr.

Worked from the ticket's own description - the source audit document this ticket's "Findings covered" list points to (clinq-docs/modules/hr/reviews/2026-09-28-ui-audit/, branch docs/hr-ui-audit-2026-09-28) does not exist anywhere in clinq-docs or nuvita-hr, local or remote. Flagging that separately (see #137) rather than guessing at the missing finding-code detail; this ticket's own text was self-contained enough to act on directly.

  • Added apps/portal/src/guards/ui-conventions.test.ts (new - didn't exist), built from nuvita-opd's and nuvita-diagnostics's existing guards (same rule shape, PENDING/EXEMPT convention). Bans em-dash, window.confirm, a raw error surfaced directly in a toast, a fake toast.success with no real mutation behind it, a static "AI" label, a local components/ui folder, plus the HR-specific ban on .toISOString().slice(0,10) outside the new clock helper. The backend half of that ban (DateOnly.FromDateTime(DateTime.UtcNow)) can't be enforced by this guard (it's a frontend-only text scanner) - documented as a code-review convention instead, since no backend text-scanning guard exists anywhere on this platform to extend.
  • Added a friendlyError helper (ported from OPD/diagnostics' equivalent, trimmed to HR's actual error shape).
  • Added one hospital-local-day clock helper shared by API and portal (HrIstDay / hospital-day.ts), following the exact pattern nuvita-pharmacy and nuvita-billing already established for this same problem. Wired through 5 call sites as a working demonstration (2 frontend, 2 backend, plus validation logic) - 31 more backend call sites and a few frontend ones are intentionally left unmigrated per the ticket's own "don't migrate every call site" instruction; flagged with exact locations in case someone wants to continue that sweep.
  • Removed one confirmed-dead export (buildProxyUrl, zero references anywhere).

Flagged, not fixed here (belongs to #141's "Truth" scope, which is running in parallel): a fake "Save draft" toast.success in leave-requests/new/page.tsx with no backing API call.

Tests: HR backend unit 1221/1221 passed; HR frontend 103/103 files, 790/790 tests passed, type-check clean.

RH Updated by Roshni Harish. 10 days ago Actions #4

  • Assignee changed from Roshni Harish. to Sravan V S
Actions

Also available in: PDF Atom