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

namespace CMSMicroservice.Application.ProductsCQ.EventHandlers;

public class UpdateProductsEventHandler : INotificationHandler<UpdateProductsEvent>
{
    private readonly ILogger<
        UpdateProductsEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
