pelagia-portal/App/prisma/migrations
Hardik 0b10ba5e54
All checks were successful
PR checks / checks (pull_request) Successful in 32s
feat(po): cancel POs (manager/superuser) + optional supersede link (#53)
Managers and superusers can cancel a PO from any state via a confirmation modal
that requires typing "cancel" and a mandatory reason. A cancelled PO becomes a
terminal CANCELLED state and drops out of every spend tracker/graph (those filter
on POST_APPROVAL_STATUSES / explicit whitelists, none of which include CANCELLED).

A cancelled PO may optionally be linked to the existing PO that supersedes it
(by PO number); the replacement shows the reciprocal "supersedes" link. No
vessel/account/vendor match is enforced and the link can be added any time.

Cancelled POs remain visible (greyed in history) and exportable, with a diagonal
"CANCELLED" watermark on both the PDF and XLSX exports.

- schema: POStatus CANCELLED; cancelledAt/cancellationReason; self-referential
  supersededById relation; ActionType CANCELLED/SUPERSEDED (+ migration)
- state machine canCancel(); cancel_po permission (MANAGER + SUPERUSER)
- cancelPo / supersedePo server actions + PO_CANCELLED notification
- cancel modal + supersede form; cancelled banner with reciprocal links
- exhaustive CANCELLED entries in all status label/variant maps
- diagonal CANCELLED watermark embedded for PDF (CSS) and XLSX (image)
- integration tests (cancel from any state, reason/role guards, supersede)

Inventory reversal on cancel is deferred to #55 (inventory is feature-flagged off).

Closes #53

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 12:20:54 +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
20260531000000_company_invoice_email feat(companies): add invoiceEmail field separate from contact email 2026-05-31 01:32:17 +05:30
20260531000001_company_code feat: structured PO numbers, import closed, auto-vendor/product, company code, inventory flag 2026-05-31 01:56:33 +05:30
20260531000002_po_payment_date feat(payments): compulsory payment date when Accounts records payment 2026-06-10 08:59:25 +05:30
20260616000000_add_po_date feat(po): allow submitter to set an optional PO date 2026-06-16 13:06:12 +05:30
20260621000000_company_branding_assets feat(po): per-company logo, stamp & brand bar on exported POs 2026-06-21 01:17:23 +05:30
20260621100000_po_cancel_supersede feat(po): cancel POs (manager/superuser) + optional supersede link (#53) 2026-06-21 12:20:54 +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