feat(payment): implement first recharge offer functionality and UI updates
This commit is contained in:
@@ -14,6 +14,9 @@ export const PaymentPlanSchema = z.object({
|
||||
originalAmountCents: z.number().nullable().default(null),
|
||||
dailyPriceCents: z.number().nullable().default(null),
|
||||
currency: z.string(),
|
||||
isFirstRechargeOffer: z.boolean().default(false),
|
||||
firstRechargeDiscountPercent: z.number().nullable().default(null),
|
||||
promotionType: z.string().nullable().default(null),
|
||||
});
|
||||
|
||||
export type PaymentPlanInput = z.input<typeof PaymentPlanSchema>;
|
||||
|
||||
@@ -5,7 +5,15 @@ import { z } from "zod";
|
||||
|
||||
import { PaymentPlanSchema } from "./payment_plan";
|
||||
|
||||
export const FirstRechargeOfferSchema = z.object({
|
||||
enabled: z.boolean(),
|
||||
type: z.string(),
|
||||
discountPercent: z.number(),
|
||||
});
|
||||
|
||||
export const PaymentPlansResponseSchema = z.object({
|
||||
isFirstRecharge: z.boolean().default(false),
|
||||
firstRechargeOffer: FirstRechargeOfferSchema.nullable().default(null),
|
||||
plans: z.array(PaymentPlanSchema),
|
||||
});
|
||||
|
||||
@@ -15,3 +23,4 @@ export type PaymentPlansResponseInput = z.input<
|
||||
export type PaymentPlansResponseData = z.output<
|
||||
typeof PaymentPlansResponseSchema
|
||||
>;
|
||||
export type FirstRechargeOfferData = z.output<typeof FirstRechargeOfferSchema>;
|
||||
|
||||
Reference in New Issue
Block a user