Skip to content

Commit b88c15a

Browse files
committed
Remove old integration event call from OrderStockConfirmedIntegrationEventHandler
1 parent 7dd91bc commit b88c15a

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,10 @@ public OrderStockConfirmedIntegrationEventHandler(IOrderRepository orderReposito
2222

2323
public async Task Handle(OrderStockConfirmedIntegrationEvent @event)
2424
{
25-
//TODO: 1) Updates the state to "StockValidated" and any meaningful OrderContextDescription message saying that all the items were confirmed with available stock, etc
2625
var order = await _orderRepository.GetAsync(@event.OrderId);
2726
CheckValidSagaId(order);
2827

2928
order.SetOrderStockConfirmed();
30-
31-
//Create Integration Event to be published through the Event Bus
32-
var payOrderCommandMsg = new PayOrderCommandMsg(order.Id);
33-
34-
// Achieving atomicity between original Catalog database operation and the IntegrationEventLog thanks to a local transaction
35-
await _orderingIntegrationEventService.SaveEventAndOrderingContextChangesAsync(payOrderCommandMsg);
36-
37-
// Publish through the Event Bus and mark the saved event as published
38-
await _orderingIntegrationEventService.PublishThroughEventBusAsync(payOrderCommandMsg);
3929
}
4030

4131
private void CheckValidSagaId(Order orderSaga)

src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockNotConfirmedIntegrationEventHandler.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ public async Task Handle(OrderStockNotConfirmedIntegrationEvent @event)
3434
.Select(c => c.ProductId);
3535

3636
orderToUpdate.SetOrderStockConfirmed(orderStockNotConfirmedItems);
37-
38-
var payOrderCommandMsg = new PayOrderCommandMsg(orderToUpdate.Id);
39-
await _orderingIntegrationEventService.SaveEventAndOrderingContextChangesAsync(payOrderCommandMsg);
40-
await _orderingIntegrationEventService.PublishThroughEventBusAsync(payOrderCommandMsg);
4137
}
4238

4339
private void CheckValidSagaId(Order orderSaga)

0 commit comments

Comments
 (0)