Files
cal.diy/packages/trpc/server/routers/viewer/organizations/create.schema.ts
T
2be9fc8bc0 fix: email-address with apostrophe not accepted (#15535)
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Omar López <[email protected]>
Co-authored-by: Amit Sharma <[email protected]>
2024-10-15 00:21:26 +00:00

23 lines
669 B
TypeScript

import { z } from "zod";
import { emailSchema } from "@calcom/lib/emailSchema";
import slugify from "@calcom/lib/slugify";
export enum BillingPeriod {
MONTHLY = "MONTHLY",
ANNUALLY = "ANNUALLY",
}
export const ZCreateInputSchema = z.object({
name: z.string(),
slug: z.string().transform((val) => slugify(val.trim())),
orgOwnerEmail: emailSchema,
language: z.string().optional(),
seats: z.number().optional(),
pricePerSeat: z.number().optional(),
isPlatform: z.boolean().default(false),
billingPeriod: z.nativeEnum(BillingPeriod).default(BillingPeriod.MONTHLY).optional(),
});
export type TCreateInputSchema = z.infer<typeof ZCreateInputSchema>;