pelagia-portal/App/tests/integration
Hardik 5764403f1c feat(po): user-defined T&C categories + dynamic PO terms editor (#11)
Reworks the T&C feature per review:
- categories are user-defined DATA, not a fixed enum — admins add new ones;
- ALL PO T&Cs are catalogued, incl. the previously-fixed boilerplate (seeded
  under a "General" category) and an "Others" bucket;
- the PO form is a dynamic editor: "+ Add term", pick a category, type/pick a
  clause.

- schema: TermsCategory (name/sortOrder/isActive) + TermsCondition (categoryId
  FK + text + isDefault + isActive). PurchaseOrder.terms Json snapshot. Migration
  seeds every standard line as a clause (named slots, the two fixed lines under
  General, empty Others); isDefault rows pre-fill new POs.
- admin /admin/terms: Add/Edit clause form's category is a combobox — typing a
  new name creates the category; isDefault checkbox.
- PO editor components/po/po-terms-editor.tsx: dynamic rows (category + clause
  comboboxes), used by new/edit/manager-edit forms; new POs pre-fill from
  getDefaultPoTerms, edits load po.terms or legacyPoTerms (old tc* + fixed lines).
- storage: PurchaseOrder.terms ([{category,text}]) supersedes tc* for export +
  detail; null on old POs falls back to tc* + fixed lines. parsePoTerms validates.
- export route + po-detail render from terms when present.
- tests rewritten for category creation + catalogue/default helpers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 04:08:30 +05:30
..
admin-ranks.test.ts feat(crewing): foundations — SITE_STAFF role, ranks reference data + admin (flagged) 2026-06-22 13:26:04 +05:30
applications.test.ts feat(crewing): enforce recruitment vetting gates C5 + partial C3 2026-06-22 23:40:08 +05:30
appraisal.test.ts feat(crewing): Phase 5b — appraisal (flagged) 2026-06-22 22:09:32 +05:30
approval-actions.test.ts feat(po): manager sets advance payment on approval (issue #92) 2026-06-24 01:40:20 +05:30
approved-this-month.test.ts fix(dashboard): count all POs approved this month, not just current MGR_APPROVED 2026-06-19 12:07:53 +05:30
cancel-supersede.test.ts feat(po): cancel POs (manager/superuser) + optional supersede link (#53) 2026-06-21 12:20:54 +05:30
candidates.test.ts fix(crewing): make rank-held universal, ex-hand an admin-only flag 2026-06-23 21:33:50 +05:30
company-branding.test.ts feat(po): per-company logo, stamp & brand bar on exported POs 2026-06-21 01:17:23 +05:30
company-crud.test.ts test(companies): cover createCompany/updateCompany actions 2026-06-21 02:05:32 +05:30
confirm-receipt.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
create-po.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
crew-pii-page.test.ts fix(crewing): mask Aadhaar/PAN document numbers server-side 2026-06-22 23:29:11 +05:30
crew-records.test.ts refactor(crewing): correct audit action types + atomic auto-raise backfills 2026-06-22 23:46:23 +05:30
crewing-admin.test.ts feat(crewing): admin crew management — direct placement, CRUD, strength config 2026-06-22 21:23:31 +05:30
crewing-followups.test.ts feat(crewing): resolve self-contained deferred follow-ups (flagged) 2026-06-22 22:28:23 +05:30
crewing-gates.test.ts refactor(crewing): correct audit action types + atomic auto-raise backfills 2026-06-22 23:46:23 +05:30
delivery-locations.test.ts feat(po): admin-managed delivery locations + Place of Delivery dropdown (#19) 2026-06-24 02:08:59 +05:30
discard-po.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
email-vendor.test.ts feat(po): email PO to vendor — PDF link in an Outlook draft (#14) 2026-06-24 02:45:48 +05:30
epfo.test.ts test(crewing): cover EPFO stub contract + /api/epfo permission gate 2026-06-22 23:56:14 +05:30
helpers.ts test(integration): green the last 3 behavioural-drift tests (108/108) 2026-06-21 02:39:41 +05:30
import-api.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
leave-attendance.test.ts feat(crewing): clash detection by required strength (Option A) 2026-06-22 21:14:21 +05:30
leave-clash.test.ts test(crewing): lock in R2/R8/R11 gates + R6 clash overlap boundaries 2026-06-22 22:58:48 +05:30
manager-po-creation.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
onboarding.test.ts fix(crewing): harden onboardCandidate (D1 guard, D3 metadata, atomic contract) 2026-06-22 23:32:30 +05:30
payment-actions.test.ts test(integration): green the last 3 behavioural-drift tests (108/108) 2026-06-21 02:39:41 +05:30
products-search.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
requisitions.test.ts feat(crewing): complete requisition list A3 (candidate count + filters) 2026-06-22 23:52:05 +05:30
signoff.test.ts feat(crewing): Phase 4c — sign-off & experience (flagged) 2026-06-22 21:34:29 +05:30
terms.test.ts feat(po): user-defined T&C categories + dynamic PO terms editor (#11) 2026-06-24 04:08:30 +05:30
vendor-approval.test.ts test(integration): green the last 3 behavioural-drift tests (108/108) 2026-06-21 02:39:41 +05:30
verification.test.ts feat(crewing): EPFO/UAN assisted verification (GstService pattern, flagged) 2026-06-22 22:43:24 +05:30