import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes } from 'sequelize'; import type { LiteralUnion } from 'type-fest'; import { TenantModel } from '../tenant-model'; import type { GroupedBN, PaymentDetails, PaymentError } from './types'; export declare const nextRefundId: (size?: number) => string; export declare class Refund extends TenantModel, InferCreationAttributes> { id: CreationOptional; livemode: boolean; instance_did?: string; description: string; amount: string; payment_details?: PaymentDetails; currency_id: string; customer_id: string; payment_intent_id: string; payment_method_id: string; invoice_id?: string; subscription_id?: string; metadata?: Record; status: LiteralUnion<'pending' | 'requires_action' | 'processing' | 'failed' | 'canceled' | 'succeeded', string>; reason?: LiteralUnion<'duplicate' | 'requested_by_customer' | 'requested_by_admin' | 'fraudulent' | 'expired_uncaptured_charge', string>; failure_reason?: LiteralUnion<'lost_or_stolen_card' | 'expired_or_canceled_card' | 'charge_for_pending_refund_disputed' | 'insufficient_funds' | 'declined' | 'merchant_request' | 'unknown', string>; attempt_count: number; attempted: boolean; next_attempt?: number; last_attempt_error?: PaymentError | null; starting_balance: string; ending_balance: string; starting_token_balance?: Record; ending_token_balance?: Record; created_at: CreationOptional; updated_at: CreationOptional; type: LiteralUnion<'refund' | 'stake_return', string>; source?: LiteralUnion<'merchant_initiated' | 'platform_initiated', string>; static readonly GENESIS_ATTRIBUTES: { id: { type: DataTypes.StringDataType; primaryKey: boolean; allowNull: boolean; defaultValue: (size?: number) => string; }; description: { type: DataTypes.StringDataType; allowNull: boolean; }; livemode: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; amount: { type: DataTypes.StringDataType; allowNull: boolean; }; payment_details: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; currency_id: { type: DataTypes.StringDataType; allowNull: boolean; }; customer_id: { type: DataTypes.StringDataType; allowNull: boolean; }; payment_intent_id: { type: DataTypes.StringDataType; allowNull: boolean; }; invoice_id: { type: DataTypes.StringDataType; allowNull: boolean; }; subscription_id: { type: DataTypes.StringDataType; allowNull: boolean; }; metadata: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; status: { type: DataTypes.EnumDataType<"failed" | "pending" | "requires_action" | "canceled" | "succeeded">; allowNull: boolean; }; reason: { type: DataTypes.EnumDataType<"duplicate" | "fraudulent" | "requested_by_customer" | "requested_by_admin">; allowNull: boolean; }; failure_reason: { type: DataTypes.EnumDataType<"declined" | "insufficient_funds" | "lost_or_stolen_card" | "expired_or_canceled_card" | "charge_for_pending_refund_disputed" | "merchant_request" | "unknown">; allowNull: boolean; }; attempt_count: { type: DataTypes.IntegerDataTypeConstructor; defaultValue: number; }; attempted: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: boolean; }; next_attempt: { type: DataTypes.IntegerDataTypeConstructor; allowNull: boolean; }; last_attempt_error: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; starting_balance: { type: DataTypes.StringDataType; defaultValue: string; }; ending_balance: { type: DataTypes.StringDataType; defaultValue: string; }; starting_token_balance: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: {}; }; ending_token_balance: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: {}; }; created_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; updated_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; }; static initialize(sequelize: any): void; static associate(models: any): void; isImmutable(): boolean; static getRefundAmountByCustomer(customerId: string, status?: string): Promise; static getSummary(livemode?: boolean, field?: string): Promise; } export type TRefund = InferAttributes;