feat: model purchaseOrderNumber on carts - #422
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 0923e86 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
mvantellingen
approved these changes
Aug 27, 2026
A cart's purchaseOrderNumber could not be exercised at all: the draft field was dropped on create and setPurchaseOrderNumber was not implemented, even though the equivalent has been on orders all along. B2B checkout captures the buyer's purchase order number on the cart before the order exists, so the round trip had no coverage available. The order created from a cart now carries the cart's purchaseOrderNumber, which is the point of capturing it there. CartSetPurchaseOrderNumberAction exists only on the full and associate-scoped cart endpoints, and those share this repository with /me carts; no separate handler is needed for the associate scope. Fixes #411
korsvanloon
force-pushed
the
feat/cart-purchase-order-number
branch
from
August 27, 2026 14:10
e949307 to
0923e86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #411.
Three small pieces:
CartDraft.purchaseOrderNumberis stored on create — it was dropped, so a cart created with one read back without it.setPurchaseOrderNumberis implemented onCartUpdateHandler; omittingpurchaseOrderNumberunsets it, matching the action's optional field.purchaseOrderNumber. That is the point of capturing it on the cart, andcreateFromCartwas not copying it.CartSetPurchaseOrderNumberActionexists only on the full and associate-scoped cart endpoints. The associate scope sharesCartRepository, so it needs no separate handler;/mecarts share it too, so the action is reachable there as well even thoughMyCartSetPurchaseOrderNumberActiondoes not exist — the mock does not filter actions per scope for any resource today, so this PR does not introduce that.Coverage
cart.test.ts: set then unset the number, and a draft-created cart whose number survives into the order created from it.Full suite: 792 passing.