namespace Baya.Domain.Entities.Bnpl;

/// <summary>
/// The closed <c>bnpl_transactions.status</c> code set — the <b>forward-only</b> state machine that is the
/// idempotency spine of the BNPL money path. A replayed <c>settle</c>/<c>revert</c> that would re-drive a
/// completed transition is an idempotent no-op (the handler treats an already-in-target state as done); the
/// allowed edges live in <see cref="BnplTransitions"/>. Persisted as these stable snake_case codes.
/// </summary>
public static class BnplStatus
{
    /// <summary>Eligibility checked and approved — the row exists, no token yet.</summary>
    public const string Eligible = "eligible";

    /// <summary>A provider payment token was issued; the customer is redirected to complete the order.</summary>
    public const string TokenIssued = "token_issued";

    /// <summary>The provider confirmed the order (amount + reference re-checked server-side).</summary>
    public const string Verified = "verified";

    /// <summary>The provider settled the full order net-of-commission; the net-of-fee ledger group is posted.</summary>
    public const string Settled = "settled";

    /// <summary>The order was reversed back through the provider (a <c>bnpl_revert</c> refund).</summary>
    public const string Reverted = "reverted";

    /// <summary>The order was cancelled before settle. Terminal.</summary>
    public const string Cancelled = "cancelled";

    /// <summary>The provider refused (eligibility/token/verify/settle). Terminal.</summary>
    public const string Failed = "failed";
}
