Skip to content

Phase 43: /admin/ops operations dashboard (D-3) + checklist findings in reports (KI-015)#253

Merged
RJK134 merged 5 commits into
mainfrom
feature/43-ops-dashboard
Jun 12, 2026
Merged

Phase 43: /admin/ops operations dashboard (D-3) + checklist findings in reports (KI-015)#253
RJK134 merged 5 commits into
mainfrom
feature/43-ops-dashboard

Conversation

@RJK134

@RJK134 RJK134 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Phase 43 — /admin/ops operations dashboard (June-10 deferral D-3) + KI-015

Overnight multi-agent build authorised by Freddie (2026-06-12). Read-only operations roll-up + the reports completeness fix.

Scope

  • /admin/ops (ADMIN-gated, mobile-first cards, sidebar entry after the go-live readiness board): overdue/pending invoices (Phase 39 AR queries → /finance/invoices), open tasks by owner (→ /tasks), visit requests awaiting action incl. urgent count (→ /triage), recalls due with dental/vaccination split + competition count (→ /recalls), low-stock products (→ /admin/inventory). Every block = count + top-5 + link through. Zero new write paths; prisma/ and .github/ diffs vs main are empty.
  • KI-015 resolved-with-notes: /reports finding-frequency now folds DentalChart.checklist JSON findings in at read time (lib/dental/checklist-finding-stats.ts) — one count per present section per chart, de-duped per chart+category against linked in-range ClinicalFinding rows; malformed/legacy JSON contributes nothing and never throws. Deliberate slight undercount on the double-fracture edge, documented in the KI entry.

Verification

Gates all green: lint ✓ typecheck ✓ prisma validate ✓ build ✓ (/[locale]/admin/ops + /api/admin/ops-dashboard in the manifest), tests 2,621 → 2,655 (+34). EN/FR parity independently verified 1,741 = 1,741.

Notes for reviewers

  • The ops API returns the payload unwrapped (successResponse has no data envelope) — pinned by a route test; don't "fix" the page to read .data.
  • Future tests touching reports.service must arm dentalChart.findMany in the prisma mock.
  • Shares docs/JUN10_OVERNIGHT_BUILD.md edits with the Phase 42 PR (adjacent deferral rows) — I'll rebase whichever merges second. The last commit here was pushed via the GitHub API during a transient git-proxy outage; content matches the local branch exactly.

Suggested merge order tonight: Phase 44 PR → this → Phase 41 → Phase 42. Final merge with Richard / Freddie as always.

https://claude.ai/code/session_01VzJJTUcvzZgS9jN8aap9iv


Generated by Claude Code

claude and others added 3 commits June 12, 2026 19:48
…indings in reports

- New lib/services/ops-dashboard.service.ts: read-only roll-up reusing
  invoiceService.summary/list (Phase 39 AR), Task groupBy by owner,
  visitRequest awaiting-action counts (UNTRIAGED/READY_FOR_REVIEW),
  recall counts with dental/vaccination split + competition priority,
  and inventoryService.reorderList (low stock). Pure helpers
  (buildTaskOwnerRows, topShortfallRows, moneyString) unit-tested.
- New GET /api/admin/ops-dashboard (ADMIN) + /admin/ops page: mobile-first
  cards, each block = count + top-5 list + link through (/finance/invoices,
  /tasks, /triage, /recalls, /admin/inventory). Sidebar entry after the
  go-live readiness board.
- KI-015: reports findingFrequency now folds DentalChart.checklist JSON
  findings in at read time via lib/dental/checklist-finding-stats.ts
  (section->FindingCategory map, one count per present section per chart,
  de-dup against the chart's own linked in-range ClinicalFinding rows;
  malformed/legacy JSON contributes nothing and never throws).
- i18n: new opsDashboard namespace + nav.opsDashboard (EN/FR parity
  1741=1741); reports.findings.subtitle updated to stop claiming checklist
  findings are excluded.
- Tests: +31 (18 checklist stats, 9 ops service, 4 route gating) and 3 new
  reports KI-015 cases; reports mock gains dentalChart.findMany.
- BUILD_PLAN: Phase 43 entry — /admin/ops operations dashboard (D-3)
  placement rationale (new ADMIN page, not more /reports tiles; WP-E
  OpsRollup stays as the all-staff quick tiles), KI-015 read-time fold
  summary, gate results (2,621 -> 2,655 tests, en/fr parity
  1,741 = 1,741) and deferred notes (digests, per-practitioner metrics,
  chart libraries, per-row remaining balance).
- KNOWN_ISSUES: KI-015 struck through and marked resolved in Phase 43
  with the approximation notes (once-per-chart section counting,
  per-chart+category de-dup against linked findings, deliberate slight
  undercount on the double-fracture edge, malformed JSON never throws).

https://claude.ai/code/session_01VzJJTUcvzZgS9jN8aap9iv
Pushed via API — the container's git push path is intermittently failing
(remote end hung up); content identical to the local commit.

https://claude.ai/code/session_01VzJJTUcvzZgS9jN8aap9iv

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7578845. Configure here.

Comment thread lib/services/ops-dashboard.service.ts Outdated
Comment thread lib/services/ops-dashboard.service.ts
…petition per action row

Bugbot findings on #253: raw lt/gte/lte date windows disagreed with the
floored-day buckets /recalls uses at the edges, and competition counted
distinct horses where /recalls counts action rows. The recall block now
fetches the same row set as /api/recalls and classifies through bucketFor
in a pure, tested tallyRecallRows helper. Gates green locally
(2,656 tests). Pushed via API per the documented git-proxy workaround.

https://claude.ai/code/session_01VzJJTUcvzZgS9jN8aap9iv

@RJK134 RJK134 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

@RJK134 RJK134 merged commit 9fb5121 into main Jun 12, 2026
6 checks passed
@RJK134 RJK134 deleted the feature/43-ops-dashboard branch June 12, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants