#nullable enable
namespace Baya.Application.Contracts.Common;

/// <summary>
/// Temporary seam standing in for b10's real card capture, so <c>ConvertRequestToBookingCommand</c> is
/// testable now. <see cref="ConfirmCaptureAsync"/> returns a deterministic <i>succeeded</i> capture (a fake
/// gateway reference + optional PSP fee); a config switch can force a <i>failed</i> capture so the
/// "capture failed → no booking" path is testable. <b>This is the temporary conversion trigger, not a
/// parallel money path:</b> in b10 the real capture calls <c>ConvertRequestToBooking</c> directly after a
/// real <c>payment_transactions.succeeded</c> and this seam is removed.
/// </summary>
public interface IPaymentCaptureSimulator
{
    ValueTask<PaymentCaptureResult> ConfirmCaptureAsync(long bookingRequestId, CancellationToken cancellationToken = default);
}

/// <summary>The outcome of a (mock) payment capture. On failure, <see cref="GatewayReference"/> is empty.</summary>
/// <param name="Succeeded">Whether the capture succeeded — conversion runs only when true.</param>
/// <param name="GatewayReference">The gateway's capture reference (fake in the mock).</param>
/// <param name="PspFeeAmount">The gateway cost on this payment (IRR), for true margin. Null when unknown.</param>
public sealed record PaymentCaptureResult(bool Succeeded, string GatewayReference, long? PspFeeAmount);
