20 lines
575 B
TypeScript
20 lines
575 B
TypeScript
import {
|
|
FreeTrialDuration,
|
|
type PlanTiming,
|
|
type ProductItem,
|
|
} from "@autumn/shared";
|
|
import { z } from "zod/v4";
|
|
|
|
export const AttachFormSchema = z.object({
|
|
productId: z.string(),
|
|
prepaidOptions: z.record(z.string(), z.number().nonnegative()),
|
|
items: z.custom<ProductItem[]>().nullable(),
|
|
version: z.number().positive().optional(),
|
|
trialLength: z.number().positive().nullable(),
|
|
trialDuration: z.enum(FreeTrialDuration),
|
|
trialEnabled: z.boolean(),
|
|
planSchedule: z.custom<PlanTiming>().nullable(),
|
|
});
|
|
|
|
export type AttachForm = z.infer<typeof AttachFormSchema>;
|