fix: Add items to inventory on PO approval, not on closure #20

Merged
shad0w merged 2 commits from claude/issue-7 into master 2026-06-18 21:53:21 +00:00
Owner

Automated fix by Claude Code for #7.

Closes #7

Review, merge, then create a release tag (vX.Y.Z) to deploy.

Automated fix by Claude Code for #7. Closes #7 Review, merge, then create a release tag (vX.Y.Z) to deploy.
shad0w added 1 commit 2026-06-18 21:46:13 +00:00
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>
shad0w added 1 commit 2026-06-18 21:52:54 +00:00
shad0w merged commit 5a7145e0cb into master 2026-06-18 21:53:21 +00:00
Sign in to join this conversation.
No description provided.