pelagia-portal/App/app/(portal)/approvals/[id]
Claude (auto-fix) 66f2e133b1 fix(inventory): add items to inventory on PO approval, not on closure
Moves the ItemInventory upsert from confirmReceipt (CLOSED) to approvePo
(MGR_APPROVED) so site inventory is visible as soon as a purchase order
is manager-approved, without waiting for full closure.

- approvePo: fetch lineItems, upsert ItemInventory per site PO line item
  that has a productId; revalidate the site admin path.
- confirmReceipt: remove the now-redundant inventory update block.
- Rename approvepo → approvePo for consistency (fixes import mismatch
  in the existing integration test file).
- Add three integration test cases covering: site PO inventory increment,
  line items without productId are skipped, vessel-only POs are untouched.

Fixes #7

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 03:15:56 +05:30
..
actions.ts fix(inventory): add items to inventory on PO approval, not on closure 2026-06-19 03:15:56 +05:30
approval-actions.tsx fix(inventory): add items to inventory on PO approval, not on closure 2026-06-19 03:15:56 +05:30
manager-edit-po-form.tsx feat: Companies — multi-company PO support with admin CRUD and export integration 2026-05-30 19:31:34 +05:30
manager-line-edit-actions.ts chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
manager-line-items-editor.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
manager-po-edit-actions.ts feat: Companies — multi-company PO support with admin CRUD and export integration 2026-05-30 19:31:34 +05:30
page.tsx feat: structured PO numbers, import closed, auto-vendor/product, company code, inventory flag 2026-05-31 01:56:33 +05:30