update
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const enrollment = z.object({
|
||||
user: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
email: z.string(),
|
||||
cpf: z.string()
|
||||
})
|
||||
.required(),
|
||||
course: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
access_period: z.number(),
|
||||
unit_price: z.number()
|
||||
})
|
||||
.required(),
|
||||
deduplication_window: z
|
||||
.object({
|
||||
offset_days: z.number()
|
||||
})
|
||||
.optional(),
|
||||
scheduled_for: z.date().optional()
|
||||
})
|
||||
|
||||
export const formSchema = z.object({
|
||||
enrollments: z.array(enrollment).min(1).max(100)
|
||||
})
|
||||
|
||||
export type Schema = z.infer<typeof formSchema>
|
||||
|
||||
export const MAX_ITEMS = 100
|
||||
Reference in New Issue
Block a user