34 lines
865 B
JavaScript
34 lines
865 B
JavaScript
|
|
import { z } from "zod";
|
||
|
|
const create_plan = z.object({
|
||
|
|
planName: z.string("Enter the plan name..."),
|
||
|
|
price: z.number("Enter the plan price..."),
|
||
|
|
planType: z.enum(["FREE", "STANDARD", "PRO"]),
|
||
|
|
planDesc: z.string("Enter the plan description..."),
|
||
|
|
planFeatures: z.union([
|
||
|
|
z.string(),
|
||
|
|
z.number(),
|
||
|
|
z.boolean(),
|
||
|
|
z.null(),
|
||
|
|
z.array(z.any()),
|
||
|
|
z.record(z.string(), z.any())
|
||
|
|
])
|
||
|
|
});
|
||
|
|
const update_plan = z.object({
|
||
|
|
planName: z.string(),
|
||
|
|
price: z.number(),
|
||
|
|
planType: z.enum(["FREE", "STANDARD", "PRO"]),
|
||
|
|
planDesc: z.string().optional(),
|
||
|
|
planFeatures: z.union([
|
||
|
|
z.string(),
|
||
|
|
z.number(),
|
||
|
|
z.boolean(),
|
||
|
|
z.null(),
|
||
|
|
z.array(z.any()),
|
||
|
|
z.record(z.string(), z.any())
|
||
|
|
])
|
||
|
|
});
|
||
|
|
export const plan_validations = {
|
||
|
|
create_plan,
|
||
|
|
update_plan,
|
||
|
|
};
|