/**
 * 支付套餐列表响应
 */
import { z } from "zod";

import {
  arrayOrEmpty,
  booleanOrFalse,
  numberOrZero,
  schemaOrNull,
  stringOrEmpty,
} from "../../nullable-defaults";
import { PaymentPlanSchema } from "../payment_plan";

export const FirstRechargeOfferSchema = z.object({
  enabled: booleanOrFalse,
  type: stringOrEmpty,
  discountPercent: numberOrZero,
});

export const PaymentPlansResponseSchema = z.object({
  isFirstRecharge: booleanOrFalse,
  firstRechargeOffer: schemaOrNull(FirstRechargeOfferSchema),
  plans: arrayOrEmpty(PaymentPlanSchema),
});

export type PaymentPlansResponseInput = z.input<
  typeof PaymentPlansResponseSchema
>;
export type PaymentPlansResponseData = z.output<
  typeof PaymentPlansResponseSchema
>;
export type FirstRechargeOfferData = z.output<typeof FirstRechargeOfferSchema>;
