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

namespace CMSMicroservice.Application.UserCartsCQ.EventHandlers;

public class UpdateUserCartsEventHandler : INotificationHandler<UpdateUserCartsEvent>
{
    private readonly ILogger<
        UpdateUserCartsEventHandler> _logger;

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

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

        return Task.CompletedTask;
    }
}
