using Baya.Application.Models.Common;
using Mediator;

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

/// <summary>
/// Confirms a <c>token_issued</c> BNPL order with the provider and re-checks the amount + reference server-side
/// (<b>never trust the callback alone</b>), then transitions <c>token_issued → verified</c>. Driven by the
/// provider callback and by the admin verify endpoint. Idempotent via the status state guard — an already
/// verified/settled order is a no-op success.
/// </summary>
public record VerifyBnplOrderCommand(long BnplTransactionId, string? CallbackPayloadJson = null)
    : IRequest<OperationResult<bool>>;
