#nullable enable
using System.Collections.Generic;
using Baya.Application.Models.Bnpl;
using Baya.Application.Models.Common;
using Mediator;

namespace Baya.Application.Features.Bnpl.Commands.HandleBnplCallback;

/// <summary>
/// The inbound BNPL provider-callback entry point. Authenticated by <b>signature</b> (not a session);
/// at-least-once tolerant and deduplicated on <c>(provider_code, external_event_id)</c> in
/// <c>payment_webhook_events</c> before any money moves, then dispatched to verify/settle/revert by event type —
/// all gated by the BNPL status state machine so a re-delivered callback never double-settles or double-posts.
/// </summary>
public record HandleBnplCallbackCommand(string Provider, IReadOnlyDictionary<string, string>? Headers, string? RawBody)
    : IRequest<OperationResult<BnplCallbackResult>>;
