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

namespace CMSMicroservice.Application.UserRoleCQ.EventHandlers;

public class CreateNewUserRoleEventHandler : INotificationHandler<CreateNewUserRoleEvent>
{
    private readonly ILogger<CreateNewUserRoleEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
