pelagia-portal/App/lib
Hardik e308d86e93 feat: Companies — multi-company PO support with admin CRUD and export integration
Schema:
- New Company model (name, gstNumber, address, telephone, mobile, email, invoiceAddress, isActive)
- PurchaseOrder.companyId FK (optional, SET NULL on company delete)
- Migration: 20260530000003_add_company

Admin:
- /admin/companies page with full CRUD (create, edit, deactivate, delete)
- Companies table shows name, GST, contact details, status
- Companies link added to Admin section of sidebar (Briefcase icon)

PO forms (new / edit / import / manager-edit):
- Company dropdown appears at the top of Order Information when companies exist
- Pre-populated with first active company; selection persisted to DB via companyId

Import form:
- parseSheet() now extracts companyName from Excel row 1 (col A)
- Import preview auto-matches detected company name against known companies
- Shows detected name as a hint; user can override before saving

Export (PDF + XLSX):
- Company constants (CO_NAME, CO_ADDR, CO_TEL, INV_ADDR, INV_GST) are now
  derived from the linked Company record when present, falling back to the
  original Pelagia Marine hardcoded defaults when no company is set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 19:31:34 +05:30
..
validations feat: Companies — multi-company PO support with admin CRUD and export integration 2026-05-30 19:31:34 +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
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: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
po-import-parser.ts feat: Companies — multi-company PO support with admin CRUD and export integration 2026-05-30 19:31:34 +05:30
po-state-machine.ts feat(payments): partial/advance payment support 2026-05-27 04:17:19 +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 feat(payments): partial/advance payment support 2026-05-27 04:17:19 +05:30