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

namespace CMSMicroservice.Application.PackageCQ.EventHandlers;

public class CreateNewPackageEventHandler : INotificationHandler<CreateNewPackageEvent>
{
    private readonly ILogger<CreateNewPackageEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
