diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderCompletedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderCompletedIntegrationEventHandler.cs deleted file mode 100644 index dcc3f0c43..000000000 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderCompletedIntegrationEventHandler.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.IntegrationEvents.EventHandling; - -public class OrderCompletedIntegrationEventHandler : IIntegrationEventHandler -{ - private readonly IMediator _mediator; - private readonly ILogger _logger; - - public OrderCompletedIntegrationEventHandler( - IMediator mediator, - ILogger logger) - { - _mediator = mediator; - _logger = logger ?? throw new System.ArgumentNullException(nameof(logger)); - } - - /// - /// Event handler which confirms order is completed. - /// - /// - /// - /// - public async Task Handle(OrderCompletedIntegrationEvent @event) - { - using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) })) - { - _logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event); - - var command = new SetAwaitingValidationOrderStatusCommand(@event.OrderId); - - _logger.LogInformation( - "Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})", - command.GetGenericTypeName(), - nameof(command.OrderNumber), - command.OrderNumber, - command); - - await _mediator.Send(command); - } - } -} diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderCompletedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderCompletedIntegrationEvent.cs deleted file mode 100644 index 555cb1ee4..000000000 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderCompletedIntegrationEvent.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.IntegrationEvents.Events; - -public record OrderCompletedIntegrationEvent : IntegrationEvent -{ - public int OrderId { get; } - - public OrderCompletedIntegrationEvent(int orderId) => - OrderId = orderId; -} - diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index e3bd21f2a..cab0e0b95 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -35,7 +35,6 @@ services.AddScoped(); // Add integration event handlers. services.AddTransient, GracePeriodConfirmedIntegrationEventHandler>(); -services.AddTransient, OrderCompletedIntegrationEventHandler>(); services.AddTransient, OrderPaymentFailedIntegrationEventHandler>(); services.AddTransient, OrderPaymentSucceededIntegrationEventHandler>(); services.AddTransient, OrderStockConfirmedIntegrationEventHandler>(); @@ -53,7 +52,6 @@ var eventBus = app.Services.GetRequiredService(); eventBus.Subscribe>(); eventBus.Subscribe>(); -eventBus.Subscribe>(); eventBus.Subscribe>(); eventBus.Subscribe>(); eventBus.Subscribe>();