pelagia-portal/App/lib
Claude (auto-fix) fdc3ebdac9 fix(dashboard): count all POs approved this month, not just current MGR_APPROVED
The manager dashboard "Approved This Month" card only counted POs whose
current status is MGR_APPROVED, so approvals that had already moved on to
payment, delivery, or closure dropped out of the count. Managers could not
see what happened to the POs they approved this month.

- Count every PO whose `approvedAt` falls in the current month across all
  post-approval statuses (MGR_APPROVED → ... → CLOSED). `approvedAt` is set
  once at approval and persists, so it is the correct anchor.
- Introduce a shared `POST_APPROVAL_STATUSES` constant (includes the
  previously-omitted PARTIALLY_CLOSED). This also fixes Total Approved Spend
  and the vessel/monthly breakdowns, which were silently dropping
  partially-received POs.
- Make the card a link into /history with an approval-date filter applied
  (?approvedFrom=<startOfMonth>) so a click shows the full set with each PO's
  current status, as requested.
- Add `approvedFrom`/`approvedTo` filtering to the history page, its filter
  UI, and the reports export route so the deep-link and exports stay in sync.

Scope note: the count remains org-wide, consistent with every other card on
the manager dashboard.

Adds an integration test covering the moved-on case and the date window.

Fixes #32
2026-06-19 12:07:53 +05:30
..
validations feat(po): allow submitter to set an optional PO date 2026-06-16 13:06:12 +05:30
cart.ts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
cost-centre-groups.ts refactor: revert cost centre to vessels only, remove vessel-site link 2026-05-30 18:14:24 +05:30
db.ts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
feature-flags.ts feat: structured PO numbers, import closed, auto-vendor/product, company code, inventory flag 2026-05-31 01:56:33 +05:30
forgejo.ts feat(automation): issue-to-deploy pipeline — Report Issue button, Claude watcher, tag-triggered deploy 2026-06-11 16:39:43 +05:30
geo.ts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
id-generators.ts feat(admin): auto-generate structured IDs for users, vendors, accounts and cost centres 2026-05-27 15:02:50 +05:30
notifier.ts fix(notifications): rationalise who gets which email 2026-05-27 03:45:40 +05:30
permissions.ts chore(perm): manager permissions fix 2 2026-06-15 12:00:49 +05:30
po-import-parser.ts feat: structured PO numbers, import closed, auto-vendor/product, company code, inventory flag 2026-05-31 01:56:33 +05:30
po-number.ts fix(po-number): floor at 9000, imported POs keep original PO number 2026-05-31 02:33:42 +05:30
po-state-machine.ts chore(perm): manager permissions fix 2 2026-06-15 12:00:49 +05:30
storage.ts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
upload-files.ts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
utils.ts fix(dashboard): count all POs approved this month, not just current MGR_APPROVED 2026-06-19 12:07:53 +05:30