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

namespace CMSMicroservice.Application.TransactionsCQ.EventHandlers;

public class CreateNewTransactionsEventHandler : INotificationHandler<CreateNewTransactionsEvent>
{
    private readonly ILogger<
        CreateNewTransactionsEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
