Remove old integration event call from OrderStockConfirmedIntegrationEventHandler

This commit is contained in:
Christian Arenas 2017-05-11 18:41:34 +02:00
parent 7dd91bc244
commit b88c15abe3
2 changed files with 0 additions and 14 deletions

View File

@ -22,20 +22,10 @@
public async Task Handle(OrderStockConfirmedIntegrationEvent @event)
{
//TODO: 1) Updates the state to "StockValidated" and any meaningful OrderContextDescription message saying that all the items were confirmed with available stock, etc
var order = await _orderRepository.GetAsync(@event.OrderId);
CheckValidSagaId(order);
order.SetOrderStockConfirmed();
//Create Integration Event to be published through the Event Bus
var payOrderCommandMsg = new PayOrderCommandMsg(order.Id);
// Achieving atomicity between original Catalog database operation and the IntegrationEventLog thanks to a local transaction
await _orderingIntegrationEventService.SaveEventAndOrderingContextChangesAsync(payOrderCommandMsg);
// Publish through the Event Bus and mark the saved event as published
await _orderingIntegrationEventService.PublishThroughEventBusAsync(payOrderCommandMsg);
}
private void CheckValidSagaId(Order orderSaga)

View File

@ -34,10 +34,6 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling
.Select(c => c.ProductId);
orderToUpdate.SetOrderStockConfirmed(orderStockNotConfirmedItems);
var payOrderCommandMsg = new PayOrderCommandMsg(orderToUpdate.Id);
await _orderingIntegrationEventService.SaveEventAndOrderingContextChangesAsync(payOrderCommandMsg);
await _orderingIntegrationEventService.PublishThroughEventBusAsync(payOrderCommandMsg);
}
private void CheckValidSagaId(Order orderSaga)