#nullable enable
using Baya.Application.Models.Common;
using Mediator;

namespace Baya.Application.Features.Payouts.Commands.ReconcilePayoutBatch;

/// <summary>
/// The async PAYA/SATNA <b>reconciliation callback</b> (refinement-phase-8, 6.3). A real payout rail accepts a
/// transfer as <c>submitted</c> (a track id, but the money hasn't confirmed) and later calls back with the settled
/// outcome; this command flips each <c>submitted</c> payout <c>paid</c>/<c>failed</c>, posting the payout ledger +
/// netting clawbacks on a paid one (the same settlement the batch execute would have done had the mock rail
/// collapsed the step). Authenticated by <b>signature</b> (not a user session) and idempotent — a replayed callback
/// re-driving an already-<c>paid</c>/<c>failed</c> payout is a no-op.
/// </summary>
/// <param name="Provider">The rail's <c>provider_code</c> (e.g. <c>jibit</c>) — selects the signing secret.</param>
/// <param name="Headers">The raw callback headers (carry the signature).</param>
/// <param name="RawBody">The verbatim callback body (HMAC-verified, then parsed for the per-transfer outcomes).</param>
public sealed record ReconcilePayoutBatchCommand(
    string Provider,
    IReadOnlyDictionary<string, string> Headers,
    string RawBody) : IRequest<OperationResult<bool>>;
