Repository navigation
Add item reservation across checkout, payment, and order status - #11
ivanmilevtues wants to merge 2 commits into
Conversation
💡 Codex ReviewWhen a client reads a product before checkout reserves it and submits that product afterward, this concurrency token does not prevent overwriting the allocation. eShop/src/Catalog.API/Reservations/ItemReservationConfiguration.cs Lines 22 to 23 in 1fd62bf After a product participates in any successful reservation, this restrictive foreign key prevents deleting it even after payment completes or the reservation releases its quantities. Neither terminal transition removes the If Ordering exits after publishing ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
CodeBoarding reviewStatus: 13 changed components See the full change in CodeBoarding. graph LR
n_Mobile_and_Desktop_Client["Mobile and Desktop Client"]
n_Order_Management_Service["Order Management Service"]
n_Catalog_and_Identity_Services["Catalog and Identity Services"]
n_Web_and_Hybrid_Frontend["Web and Hybrid Frontend"]
n_Webhook_Notification_Service["Webhook Notification Service"]
n_Integration_Event_Bus["Integration Event Bus"]
n_Shopping_Basket_Service["Shopping Basket Service"]
n_Host_and_Service_Defaults["Host and Service Defaults"]
n_Payment_Background_Processor["Payment Background Processor"]
n_Order_Management_Service -- "persists integration event logs in" --> n_Catalog_and_Identity_Services
n_Order_Management_Service -- "publishes order events to" --> n_Integration_Event_Bus
n_Order_Management_Service -- "configures defaults using" --> n_Host_and_Service_Defaults
n_Catalog_and_Identity_Services -- "dispatches item reservation contracts to" --> n_Order_Management_Service
n_Catalog_and_Identity_Services -- "publishes catalog events to" --> n_Integration_Event_Bus
n_Web_and_Hybrid_Frontend -- "subscribes to events through" --> n_Integration_Event_Bus
n_Web_and_Hybrid_Frontend -- "applies configuration and telemetry from" --> n_Host_and_Service_Defaults
n_Webhook_Notification_Service -- "migrates database using" --> n_Catalog_and_Identity_Services
n_Webhook_Notification_Service -- "subscribes to domain events through" --> n_Integration_Event_Bus
n_Webhook_Notification_Service -- "consumes service defaults from" --> n_Host_and_Service_Defaults
n_Integration_Event_Bus -- "dispatches integration events to" --> n_Order_Management_Service
n_Integration_Event_Bus -- "pushes status events to" --> n_Web_and_Hybrid_Frontend
n_Integration_Event_Bus -- "triggers webhook handlers via" --> n_Webhook_Notification_Service
n_Integration_Event_Bus -- "notifies basket of order creation via" --> n_Shopping_Basket_Service
n_Integration_Event_Bus -- "routes confirmed orders to" --> n_Payment_Background_Processor
n_Integration_Event_Bus -- "delivers order events to" --> n_Catalog_and_Identity_Services
n_Shopping_Basket_Service -- "subscribes to event bus through" --> n_Integration_Event_Bus
n_Shopping_Basket_Service -- "configures authentication using" --> n_Host_and_Service_Defaults
n_Payment_Background_Processor -- "publishes payment results through" --> n_Integration_Event_Bus
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Order_Management_Service,n_Catalog_and_Identity_Services,n_Web_and_Hybrid_Frontend,n_Integration_Event_Bus,n_Host_and_Service_Defaults,n_Payment_Background_Processor modified;
linkStyle 3 stroke:#0b5d23,stroke-width:2px;
|
Amp-Thread-ID: https://ampcode.com/threads/T-01a2259d-bdc2-74fd-bb00-e66e8763e3d5 Co-authored-by: Amp <amp@ampcode.com>
CodeBoarding reviewStatus: 13 changed components See the full change in CodeBoarding. graph LR
n_Mobile_and_Desktop_Client["Mobile and Desktop Client"]
n_Order_Management_Service["Order Management Service"]
n_Catalog_and_Identity_Services["Catalog and Identity Services"]
n_Web_and_Hybrid_Frontend["Web and Hybrid Frontend"]
n_Webhook_Notification_Service["Webhook Notification Service"]
n_Integration_Event_Bus["Integration Event Bus"]
n_Shopping_Basket_Service["Shopping Basket Service"]
n_Host_and_Service_Defaults["Host and Service Defaults"]
n_Payment_Background_Processor["Payment Background Processor"]
n_Order_Management_Service -- "persists integration event logs in" --> n_Catalog_and_Identity_Services
n_Order_Management_Service -- "publishes order events to" --> n_Integration_Event_Bus
n_Order_Management_Service -- "configures defaults using" --> n_Host_and_Service_Defaults
n_Catalog_and_Identity_Services -- "dispatches reservation events conforming to" --> n_Order_Management_Service
n_Catalog_and_Identity_Services -- "publishes catalog events to" --> n_Integration_Event_Bus
n_Web_and_Hybrid_Frontend -- "subscribes to events through" --> n_Integration_Event_Bus
n_Web_and_Hybrid_Frontend -- "applies configuration and telemetry from" --> n_Host_and_Service_Defaults
n_Webhook_Notification_Service -- "migrates database using" --> n_Catalog_and_Identity_Services
n_Webhook_Notification_Service -- "subscribes to domain events through" --> n_Integration_Event_Bus
n_Webhook_Notification_Service -- "consumes service defaults from" --> n_Host_and_Service_Defaults
n_Integration_Event_Bus -- "dispatches integration events to" --> n_Order_Management_Service
n_Integration_Event_Bus -- "pushes status events to" --> n_Web_and_Hybrid_Frontend
n_Integration_Event_Bus -- "triggers webhook handlers via" --> n_Webhook_Notification_Service
n_Integration_Event_Bus -- "notifies basket of order creation via" --> n_Shopping_Basket_Service
n_Integration_Event_Bus -- "routes confirmed orders to" --> n_Payment_Background_Processor
n_Integration_Event_Bus -- "delivers order events to" --> n_Catalog_and_Identity_Services
n_Shopping_Basket_Service -- "subscribes to event bus through" --> n_Integration_Event_Bus
n_Shopping_Basket_Service -- "configures authentication using" --> n_Host_and_Service_Defaults
n_Payment_Background_Processor -- "publishes payment results through" --> n_Integration_Event_Bus
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Order_Management_Service,n_Catalog_and_Identity_Services,n_Web_and_Hybrid_Frontend,n_Integration_Event_Bus,n_Host_and_Service_Defaults,n_Payment_Background_Processor modified;
linkStyle 3 stroke:#0b5d23,stroke-width:2px;
|
Item reservation across checkout, payment, and order status
Checkout now reserves every requested item atomically for ten minutes. Timely payment completes the reservation; cancellation, failed payment, or expiry releases it exactly once. Successful payment after release produces a visible Payment review needed state and blocks fulfillment.
This is a new lecture/demo example based on
main, independent of PR #8. Customer-facing wording and new components use item reservation. Existing internalStockConfirmedwire names remain for compatibility.System changes
Demo
ItemReservationDemo=late-payment aspire runshows a 15-second reservation followed by successful simulated payment after 25 seconds. Other scenarios cover completion, cancellation, failed payment, and expiry.Demo instructions and architecture decisions · Presenter walkthrough
Validation
eShop.Web.slnfbuild passed.Review decisions
This remains a demo with a simulated payment provider. Late payment is surfaced for human review; automated refund/void handling is deliberately outside this feature. Production adoption needs a coordinated migration for in-flight orders, bounded message retries/dead-letter handling, clock synchronization, and outbox/tombstone retention. The guide explains those trade-offs rather than treating green tests as approval to ship.