zeroframework/Services/DeviceCenter/ZeroFramework.DeviceCenter.Application/IntegrationEvents/EventHandling/Ordering/OrderPaymentSucceededDynamicIntegrationEventHandler.cs

17 lines
608 B
C#
Raw Normal View History

2023-12-05 09:22:48 +00:00
using MediatR;
using ZeroFramework.DeviceCenter.Application.Commands.Ordering;
using ZeroFramework.EventBus.Abstractions;
namespace ZeroFramework.DeviceCenter.Application.IntegrationEvents.EventHandling.Ordering
{
public class OrderPaymentSucceededDynamicIntegrationEventHandler(IMediator mediator) : IDynamicIntegrationEventHandler
{
private readonly IMediator _mediator = mediator;
public async Task HandleAsync(dynamic eventData)
{
var command = new SetPaidOrderStatusCommand(eventData.OrderId);
await _mediator.Send(command);
}
}
}