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

namespace CMSMicroservice.Application.RoleCQ.EventHandlers;

public class CreateNewRoleEventHandler : INotificationHandler<CreateNewRoleEvent>
{
    private readonly ILogger<CreateNewRoleEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
