Files
Raul Lugo 4ced446c9c
Build & Deployment / Build & Deploy (push) Failing after 5s
initial commit
2026-08-10 17:55:26 +02:00

28 lines
815 B
TypeScript

import { z } from "zod"
const optionalPositiveInteger = z.preprocess(
(value) => {
if (typeof value !== "string") return null
const trimmed = value.trim()
return trimmed.length > 0 ? trimmed : null
},
z.coerce.number().int().positive().nullable(),
)
export const toastRequestSchema = z.object({
memberId: z.uuid().nullable(),
speakerName: z.string().trim().min(1).max(160),
estimatedMinutes: optionalPositiveInteger,
})
export const interactionSubmissionSchema = z.object({
invitationId: z.uuid(),
toastRequest: toastRequestSchema.nullable(),
})
export const toastStatusSchema = z.enum(["pending", "accepted", "declined", "scheduled"])
export type InteractionSubmissionInput = z.infer<typeof interactionSubmissionSchema>
export type ToastStatus = z.infer<typeof toastStatusSchema>