"use client";

/**
 * IPaymentRepository 接口
 */
import type {
  CreatePaymentOrderResponse,
  PayChannel,
  PaymentOrderStatusResponse,
  PaymentPlan,
  PaymentPlansResponse,
  PaymentVipStatusResponse,
} from "@/data/dto/payment";
import type { Result } from "@/utils/result";

export interface IPaymentRepository {
  /** 获取套餐列表。 */
  getPlans(): Promise<Result<PaymentPlansResponse>>;

  /** 获取本地缓存套餐列表。 */
  getCachedPlans(): Promise<Result<PaymentPlansResponse | null>>;

  /** 获取会员套餐列表。 */
  getVipPlans(): Promise<Result<PaymentPlan[]>>;

  /** 获取积分套餐列表。 */
  getCreditPlans(): Promise<Result<PaymentPlan[]>>;

  /** 创建支付订单。 */
  createOrder(
    planId: string,
    payChannel: PayChannel,
    autoRenew: boolean,
  ): Promise<Result<CreatePaymentOrderResponse>>;

  /** 查询支付订单状态。 */
  getOrderStatus(orderId: string): Promise<Result<PaymentOrderStatusResponse>>;

  /** 查询当前用户 VIP 状态。 */
  getVipStatus(): Promise<Result<PaymentVipStatusResponse>>;
}
