using CMSMicroservice.Domain.Events;
using Microsoft.Extensions.Logging;

namespace CMSMicroservice.Application.UserOrderCQ.EventHandlers;

public class CreateNewUserOrderEventHandler : INotificationHandler<CreateNewUserOrderEvent>
{
    private readonly ILogger<CreateNewUserOrderEventHandler> _logger;

    public CreateNewUserOrderEventHandler(ILogger<CreateNewUserOrderEventHandler> logger)
    {
        _logger = logger;
    }

    public Task Handle(CreateNewUserOrderEvent notification, CancellationToken cancellationToken)
    {
        _logger.LogInformation("Domain Event: {DomainEvent}", notification.GetType().Name);

        return Task.CompletedTask;
    }
}
