pelagia-portal/App/prisma/migrations
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
..
20260503171522_add_item_db chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260503180801_add_product_catalogue_size_manager_edit chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260505114211_add_po_export_fields chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260505121423_structured_tc_fields chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260510215950_add_line_item_name chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260510221329_add_product_vendor_price chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260514060941_add_site_inventory_consumption chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260514091124_vendor_pincode chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260514185519_ chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260514191638_vendor_contacts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260516103013_partial_receipt chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260516103515_user_profile_signature chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260516104351_notification_isread_link chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
20260521000000_remove_vessel_imo_number feat(vessels): remove IMO number tracking 2026-05-22 17:14:40 +05:30
20260527000000_partial_payment feat(payments): partial/advance payment support 2026-05-27 04:17:19 +05:30
20260527010000_vessel_code feat(admin): auto-generate structured IDs for users, vendors, accounts and cost centres 2026-05-27 15:02:50 +05:30
20260528000000_optional_password_hash_for_sso feat(auth): add Microsoft 365 SSO via Azure Entra ID 2026-05-28 22:48:37 +05:30
20260530000000_vessel_optional_cost_centre feat: Cost Centre covers vessels and sites, vessel codes, Accounting Code rename, vessel-site assignment 2026-05-30 03:04:29 +05:30
20260530000001_account_hierarchy feat(accounts): hierarchical accounting codes with 6-digit format and category tree 2026-05-30 03:27:31 +05:30
20260530000002_vessel_no_site_po_vessel_required refactor: revert cost centre to vessels only, remove vessel-site link 2026-05-30 18:14:24 +05:30
20260530000003_add_company feat: Companies — multi-company PO support with admin CRUD and export integration 2026-05-30 19:31:34 +05:30
migration_lock.toml chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30