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

namespace CMSMicroservice.Application.CategoryCQ.EventHandlers;

public class CreateNewCategoryEventHandler : INotificationHandler<CreateNewCategoryEvent>
{
    private readonly ILogger<CreateNewCategoryEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}

