pelagia-portal/App/components/po
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
..
cancel-po-controls.tsx fix(po): make cancel buttons red & visible (use defined danger tokens) 2026-06-21 12:59:20 +05:30
delivery-location-field.tsx feat(po): admin-managed delivery locations + Place of Delivery dropdown (#19) 2026-06-24 02:08:59 +05:30
discard-draft-button.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
email-vendor-button.tsx feat(po): email PO to vendor — PDF link in an Outlook draft (#14) 2026-06-24 02:45:48 +05:30
file-uploader.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
po-detail.tsx feat(po): user-defined T&C categories + dynamic PO terms editor (#11) 2026-06-24 04:43:24 +05:30
po-line-items-editor.tsx feat(po): add week, month, year to line-item unit options 2026-06-21 00:32:39 +05:30
po-status-badge.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
po-terms-editor.tsx feat(po): user-defined T&C categories + dynamic PO terms editor (#11) 2026-06-24 04:43:24 +05:30
submit-draft-button.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30