using Web.Api.Common;
using MediatR;

namespace Web.Api.Endpoints.Donation;

/// <summary>리모콘 — 무시</summary>
internal sealed class RemoteIgnore : IEndpoint
{
    public void MapEndpoint(IEndpointRouteBuilder app)
    {
        /// 미재생 알림을 Ignored로 변경 (재생 중인 알림은 사용 불가)
        app.MapPost("api/donation/remote/ignore/{alertID}", async (
            int alertID,
            ISender sender,
            CancellationToken ct
        ) => {
            await sender.Send(new Application.Features.Api.DonationRemote.IgnoreAlert.Command(alertID), ct);

            return ApiResponse.Ok();
        })
        .WithTags("DonationRemote")
        .RequireAuthorization();
    }
}