eShopOnContainers icon indicating copy to clipboard operation
eShopOnContainers copied to clipboard

Event order

Open onurkanbakirci opened this issue 3 years ago • 0 comments

When user gives an order, basket service sends UserCheckoutAcceptedIntegrationEvent to order service. After that, order service immediately triggers OrderStartedIntegrationEvent event and basket service listens this event. When OrderStartedIntegrationEvent is fired, basket service's OrderStartedIntegrationEventHandler removes basket items from basket. But i think that removing basket items should be after successful payment. Because after creating order there will be some problems in payment or order service and in this case basket should not be removed. I think that removing basket items after OrderStatusChangedToPaidIntegrationEvent is best place. By the way, basket service should listen this event and should removes items inside of OrderStatusChangedToPaidIntegrationEventHandler's Handlemethod.

onurkanbakirci avatar Aug 02 '22 13:08 onurkanbakirci

Hi @onurkanbakirci, Thanks for posting and raising your query here. Yeah, I agree with your observation in a real scenario. But, here, we are just trying to showcase how integration events work and this is the end idea behind it, we have created it as a sample, yeah I agree in a real scenario, however, this is a reference sample, so we have mocked the payment services, we refrain from making these kinds of changes, but feel free to create a sample, we can link it further. I am closing this issue, however, feel free to continue the conversation in case of any further queries.

erjain avatar Sep 05 '22 11:09 erjain