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

namespace CMSMicroservice.Application.ProductCategoryCQ.EventHandlers;

public class CreateNewProductCategoryEventHandler : INotificationHandler<CreateNewProductCategoryEvent>
{
    private readonly ILogger<
        CreateNewProductCategoryEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
