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

namespace CMSMicroservice.Application.UserContractCQ.EventHandlers;

public class CreateNewUserContractEventHandler : INotificationHandler<CreateNewUserContractEvent>
{
    private readonly ILogger<
        CreateNewUserContractEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
