pelagia-portal/App/app/(portal)/admin
Hardik 3babfe26ef
All checks were successful
PR checks / checks (pull_request) Successful in 45s
PR checks / integration (pull_request) Successful in 32s
feat(po): user-defined T&C categories + dynamic PO terms editor (#11)
Follow-up to the merged #11 PR (which shipped the enum-based catalogue): make
categories user-defined data and the PO T&C a dynamic editor.

- categories are a TermsCategory TABLE (not an enum) — admins add new ones;
- every PO T&C line is 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 (components/po/po-terms-editor.tsx), used by new/edit/manager-edit.

Migration: the already-released 20260624140000 migration is untouched; a new
20260624150000 FORWARD migration renames the enum, creates the table, migrates
existing enum clauses onto category rows, adds isDefault/sortOrder + the two
fixed lines under General, and adds PurchaseOrder.terms (JSON snapshot that
supersedes the legacy tc* columns for export/detail; old POs fall back to tc*).

Tests rewritten for category creation + catalogue/default helpers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 04:43:24 +05:30
..
accounts feat(accounts): hierarchical accounting codes with 6-digit format and category tree 2026-05-30 03:27:31 +05:30
companies feat(companies): move add/edit from dialog to dedicated pages 2026-06-21 01:45:59 +05:30
crew fix(crewing): make rank-held universal, ex-hand an admin-only flag 2026-06-23 21:33:50 +05:30
crew-strength feat(crewing): admin crew management — direct placement, CRUD, strength config 2026-06-22 21:23:31 +05:30
delivery-locations feat(po): admin-managed delivery locations + Place of Delivery dropdown (#19) 2026-06-24 02:08:59 +05:30
products feat(items): separate editable/read-only detail pages, same as vendors 2026-05-31 06:28:37 +05:30
ranks feat(crewing): foundations — SITE_STAFF role, ranks reference data + admin (flagged) 2026-06-22 13:26:04 +05:30
sites feat(po): cancel POs (manager/superuser) + optional supersede link (#53) 2026-06-21 12:20:54 +05:30
superuser-requests feat(crewing): foundations — SITE_STAFF role, ranks reference data + admin (flagged) 2026-06-22 13:26:04 +05:30
terms feat(po): user-defined T&C categories + dynamic PO terms editor (#11) 2026-06-24 04:43:24 +05:30
users feat(crewing): foundations — SITE_STAFF role, ranks reference data + admin (flagged) 2026-06-22 13:26:04 +05:30
vendors feat(po): cancel POs (manager/superuser) + optional supersede link (#53) 2026-06-21 12:20:54 +05:30
vessels feat(po): cancel POs (manager/superuser) + optional supersede link (#53) 2026-06-21 12:20:54 +05:30