feat(payment): implement coffee tip plans and update payment flow

This commit is contained in:
2026-07-14 11:48:46 +08:00
parent f9c15bd91f
commit 3a4f24cb06
30 changed files with 632 additions and 56 deletions
+2
View File
@@ -7,3 +7,5 @@ export * from "./create_payment_order_response";
export * from "./payment_order_status_response";
export * from "./payment_plan";
export * from "./payment_plans_response";
export * from "./tip_payment_plan";
export * from "./tip_payment_plans_response";
@@ -0,0 +1,11 @@
import { z } from "zod";
export const TipPaymentPlanSchema = z.object({
planId: z.string(),
planName: z.string(),
amountCents: z.number(),
currency: z.string(),
});
export type TipPaymentPlanInput = z.input<typeof TipPaymentPlanSchema>;
export type TipPaymentPlanData = z.output<typeof TipPaymentPlanSchema>;
@@ -0,0 +1,15 @@
import { z } from "zod";
import { arrayOrEmpty } from "../nullable-defaults";
import { TipPaymentPlanSchema } from "./tip_payment_plan";
export const TipPaymentPlansResponseSchema = z.object({
plans: arrayOrEmpty(TipPaymentPlanSchema),
});
export type TipPaymentPlansResponseInput = z.input<
typeof TipPaymentPlansResponseSchema
>;
export type TipPaymentPlansResponseData = z.output<
typeof TipPaymentPlansResponseSchema
>;