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

namespace Baya.Application.Features.Bookings.Commands.ConvertRequestToBooking;

/// <summary>
/// The conversion engine — <b>invoked by payment capture</b> (mocked via <c>IPaymentCaptureSimulator</c>
/// now, real card capture in b10). It loads an <c>accepted_awaiting_payment</c> booking request, verifies a
/// successful capture, then creates the 1:1 <c>bookings</c> row (<c>pending_payment → confirmed</c>), writes
/// the variant + encrypted address snapshots, computes the three amounts, generates ≥ 1 reconciling session,
/// and flips the request to <c>converted</c> — all in one unit of work. Idempotent: the unique
/// <c>booking_request_id</c> means a replay returns the existing booking rather than creating a second one.
/// </summary>
public record ConvertRequestToBookingCommand(long BookingRequestId) : IRequest<OperationResult<BookingDetailDto>>;
