Public-safe OrderReadPort for the storefront confirmation (ADR 0026) - #6
Merged
Merged
Conversation
…0026)
Add a read counterpart to CartPort so a storefront can render an itemised order
confirmation without touching Commerce's tables or its PII. `OrderReadPort::get(ref)`
returns an ALLOW-LISTED projection — reference, status, total, placed_at, and lines
{sku_code, qty, unit_price, line_total} — built field-by-field by OrderReadAdapter
over OrderBook::get. It deliberately DROPS customer_email, internal ids, and stock
location: never spreads the raw row, so a future commerce_order column can't leak
onto a public page. Provided via services() (ADR 0019).
Reviewed via both skills (platform + security), security-green. Test asserts the
projection carries no customer_email / id / location and computes line_total.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
A read counterpart to
CartPortso a storefront can render an itemised order confirmation without touching Commerce's tables or its PII.OrderReadPort::get(ref)→ an allow-listed projection:reference, status, total, placed_at, lines[{sku_code, qty, unit_price, line_total}].OrderReadAdapterbuilds it field-by-field overOrderBook::getand never spreads the raw row — socustomer_email, internal ids, and stocklocationcan't leak, and a future column can't auto-leak onto a public page.services()(ADR 0019).Reviewed via both skills, security-green. Test asserts the projection carries no
customer_email/id/locationand computesline_total.Consumed by the storefront confirmation + Aurora receipt (separate PRs).
🤖 Generated with Claude Code