using MassTransit;
using TakeoutSaaS.Application.Identity.Abstractions;
using TakeoutSaaS.Application.Identity.Events;

namespace TakeoutSaaS.Infrastructure.Logs.Publishers;

/// <summary>
/// 身份模块操作日志发布器（基于 MassTransit Outbox）。
/// </summary>
public sealed class IdentityOperationLogPublisher(IPublishEndpoint publishEndpoint) : IIdentityOperationLogPublisher
{
    /// <inheritdoc />
    public Task PublishAsync(IdentityUserOperationLogMessage message, CancellationToken cancellationToken = default)
        => publishEndpoint.Publish(message, cancellationToken);
}
