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

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

/// <summary>Admin create/update of a cancellation tier, keyed by unique <c>code</c>. Editing a policy never
/// mutates an already-snapshotted cancellation (past cancellations froze the code + percentage). The fee is
/// a flat IRR amount plus an optional fraction; a tier uses whichever is non-zero.</summary>
public record UpsertCancellationPolicyCommand(
    string Code,
    string AppliesTo,
    int? HoursBeforeStartMin,
    int? HoursBeforeStartMax,
    decimal RefundPercentage,
    long FeeAmountIrr,
    decimal? FeeRate,
    bool IsActive) : IRequest<OperationResult<CancellationPolicyDto>>;
