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

namespace CMSMicroservice.Application.ProductsCQ.EventHandlers;

public class CreateNewProductsEventHandler : INotificationHandler<CreateNewProductsEvent>
{
    private readonly ILogger<
        CreateNewProductsEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
