import type { CustomerMembershipCancellationResultKind, CustomerMembershipPaymentRefundFailedCode, CustomerMembershipPaymentRefundSkippedCode } from "./customerMembershipOutcomes";
import type { CustomerPassRefundFailedCode, CustomerPassRefundSkippedCode } from "./bookingRefundOutcomes";
/**
 * Booking Adjustment Contracts
 *
 * These types cover the operational write paths layered on top of booking records:
 * credit conversions, manual pass/membership assignment, and refund/adjustment flows.
 *
 * Note: Do NOT use these API types as validation schemas. They document the wire
 * request/response shapes; service-layer validation still belongs with the booking
 * workflow that owns each adjustment path.
 */
export type ConvertCreditRefundToCashRequest = {
    source: {
        kind: "pass_order_refund";
        refundId: string;
    } | {
        kind: "membership_order_refund";
        refundId: string;
    };
    amountCents?: number;
    reason?: string | null;
    idempotencyKey?: string;
};
export type ConvertCreditRefundToCashResponse = {
    conversion: {
        id: string;
        amountCents: number;
        currency: string;
        stripeRefundId: string;
        paymentLast4: string | null;
    };
};
export type AssignCustomerPassRequest = {
    customerId: string;
    passId: string;
    creditsTotal?: number;
};
export type AssignCustomerPassResponse = {
    customerPass: {
        id: string;
        customerId: string;
        passId: string;
        creditsRemaining: number;
        creditsTotal: number;
        status: string;
        purchasedAt: string;
        expiresAt: string | null;
    };
};
export type AdjustCustomerPassDetailsRequest = {
    creditsRemaining?: number;
    expiresAt?: string | null;
    confirmPastExpiry?: boolean;
};
export type AdjustCustomerPassDetailsResponse = {
    customerPass: {
        id: string;
        customerId: string;
        passId: string;
        creditsRemaining: number;
        creditsTotal: number;
        status: "active" | "exhausted" | "expired" | "refunded";
        purchasedAt: string;
        expiresAt: string | null;
    };
};
export type AssignCustomerMembershipRequest = {
    customerId: string;
    membershipId: string;
};
export type AssignCustomerMembershipResponse = {
    customerMembership: {
        id: string;
        customerId: string;
        membershipId: string;
        status: string;
        currentPeriodStart: string | null;
        currentPeriodEnd: string | null;
    };
};
type CustomerPassRefundBase = {
    refundRecordId: string;
    refundMethod: "cash" | "credit" | "mixed" | null;
    amountCents: number | null;
    currency: string | null;
    paymentLast4: string | null;
    stripeRefundId: string | null;
    passRevoked: boolean;
    totalRefundedCents?: number;
    remainingRefundableCents?: number | null;
};
export type CustomerPassRefundResult = (CustomerPassRefundBase & {
    status: "succeeded";
}) | (CustomerPassRefundBase & {
    status: "failed";
    errorCode: CustomerPassRefundFailedCode;
    errorMessage: string;
}) | (CustomerPassRefundBase & {
    status: "skipped";
    errorCode: CustomerPassRefundSkippedCode;
    errorMessage: string;
});
export type CustomerPassRefundRecord = {
    id: string;
    customerPassId: string;
    refundMethod: "cash" | "credit" | "mixed";
    amountCents: number;
    currency: string;
    status: "pending" | "succeeded" | "failed";
    failureCode: string | null;
    failureMessage: string | null;
    stripeRefundId: string | null;
    stripePaymentIntentId: string | null;
    paymentLast4: string | null;
    reason: string | null;
    passRevoked: boolean;
    createdAt: string;
};
export type RefundCustomerPassRequest = {
    amountCents?: number;
    refundMethod?: "cash" | "credit";
    reason?: string | null;
    revokePass?: boolean;
    idempotencyKey?: string;
};
export type RefundCustomerPassResponse = {
    result: CustomerPassRefundResult;
};
export type ListCustomerPassRefundsResponse = {
    refunds: CustomerPassRefundRecord[];
};
export type MembershipPaymentForRefund = {
    stripeInvoiceId: string;
    stripePaymentIntentId: string | null;
    status: string | null;
    amountPaidCents: number;
    amountRefundedCents: number;
    remainingRefundableCents: number;
    currency: string;
    createdAt: string;
    refundable: boolean;
    notRefundableReason?: string;
};
export type ListCustomerMembershipPaymentsResponse = {
    payments: MembershipPaymentForRefund[];
};
export type CancelCustomerMembershipAtPeriodEndRequest = Record<string, never>;
export type CancelCustomerMembershipAtPeriodEndResult = {
    kind: Extract<CustomerMembershipCancellationResultKind, "already_cancelled">;
    message: string;
} | {
    kind: Extract<CustomerMembershipCancellationResultKind, "not_stripe_managed">;
    message: string;
} | {
    kind: Extract<CustomerMembershipCancellationResultKind, "stripe_not_connected">;
    message: string;
} | {
    kind: Extract<CustomerMembershipCancellationResultKind, "cancellation_scheduled">;
    message: string;
};
export type CancelCustomerMembershipAtPeriodEndResponse = {
    result: CancelCustomerMembershipAtPeriodEndResult;
};
type CustomerMembershipPaymentRefundBase = {
    refundRecordId: string;
    refundMethod: "cash" | "credit" | "mixed" | null;
    amountCents: number | null;
    currency: string | null;
    paymentLast4: string | null;
    stripeRefundId: string | null;
    stripeInvoiceId: string;
    totalRefundedCents?: number;
    remainingRefundableCents?: number | null;
};
export type CustomerMembershipPaymentRefundResult = (CustomerMembershipPaymentRefundBase & {
    status: "succeeded";
}) | (CustomerMembershipPaymentRefundBase & {
    status: "failed";
    errorCode: CustomerMembershipPaymentRefundFailedCode;
    errorMessage: string;
}) | (CustomerMembershipPaymentRefundBase & {
    status: "skipped";
    errorCode: CustomerMembershipPaymentRefundSkippedCode;
    errorMessage: string;
});
export type CustomerMembershipPaymentRefundRecord = {
    id: string;
    customerMembershipId: string;
    stripeInvoiceId: string;
    stripePaymentIntentId: string | null;
    refundMethod: "cash" | "credit" | "mixed";
    amountCents: number;
    currency: string;
    status: "pending" | "succeeded" | "failed";
    failureCode: string | null;
    failureMessage: string | null;
    stripeRefundId: string | null;
    paymentLast4: string | null;
    reason: string | null;
    createdAt: string;
};
export type RefundCustomerMembershipPaymentRequest = {
    stripeInvoiceId: string;
    amountCents?: number;
    refundMethod?: "cash" | "credit";
    reason?: string | null;
    idempotencyKey?: string;
};
export type RefundCustomerMembershipPaymentResponse = {
    result: CustomerMembershipPaymentRefundResult;
};
export type ListCustomerMembershipPaymentRefundsResponse = {
    refunds: CustomerMembershipPaymentRefundRecord[];
};
export type OrderRefundLineRequest = {
    orderItemId: string;
    amountCents: number;
};
export type OrderRefundLineAllocation = {
    orderItemId: string;
    requestedCents: number;
    appliedCents: number;
};
export type OrderRefundRecord = {
    id: string;
    orderId: string;
    status: "pending" | "succeeded" | "failed" | "reconciliation_needed";
    refundMode: "refund_only" | "refund_and_revoke";
    entitlementActionStatus: "not_requested" | "pending" | "succeeded" | "reconciliation_needed";
    amountRequestedCents: number;
    amountRefundedCents: number;
    currency: string;
    failureCode: string | null;
    failureMessage: string | null;
    stripeRefundId: string | null;
    stripePaymentIntentId: string | null;
    paymentLast4: string | null;
    reason: string | null;
    initiatedBy: "admin" | "customer" | "system";
    initiatorCustomerId: string | null;
    initiatorUserId: string | null;
    refundRail: "cash" | "credit" | "mixed";
    lineAllocations: OrderRefundLineAllocation[];
    createdAt: string;
    updatedAt: string;
};
export {};
