using Cortex.Mediator.Notifications;
using CortexMediatorDemo.API.CQRS.Queries;
using Serilog;

namespace CortexMediatorDemo.API.CQRS.NotificationHandlers;

/// <summary>
/// Handles notifications related to the publishing of books by their unique identifier.
/// </summary>
/// <remarks>
/// This class is an implementation of <see cref="INotificationHandler{TNotification}"/> for the <see cref="BookByIdQuery"/> notification.
/// It logs an information message whenever a notification is sent for a book with a specific ID.
/// </remarks>
public class BookPublisherNotificationHandler : INotificationHandler<BookByIdQuery>
{
    public async Task Handle(BookByIdQuery notification, CancellationToken cancellationToken)
    {
        Log.Information("##Notification sent to the publisher for the book with id: {NotificationId}", notification.Id);
    }
}