/**
 * IPaymentRepository 接口
 */
import type {
  CreatePaymentOrderResponse,
  GiftProductsResponse,
  PayChannel,
  PaymentOrderStatusResponse,
  PaymentPlansResponse,
  TipMessageResponse,
} from "@/data/schemas/payment";
import type { Result } from "@/utils/result";

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

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

  /** 获取当前角色的完整礼物目录。 */
  getGiftProducts(characterId: string): Promise<Result<GiftProductsResponse>>;

  /** 清除本地缓存套餐列表。 */
  clearCachedPlans(): Promise<Result<void>>;

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

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

  /** 获取已支付礼物订单的角色感谢文案。 */
  getTipMessage(orderId: string): Promise<Result<TipMessageResponse>>;
}
