initial commit
Build & Deployment / Build & Deploy (push) Failing after 5s

This commit is contained in:
Raul Lugo
2026-08-10 17:55:26 +02:00
parent 6429ed3fa3
commit 4ced446c9c
74 changed files with 9242 additions and 30 deletions
+55
View File
@@ -0,0 +1,55 @@
import { z } from "zod"
export const mealPreferenceSchema = z.enum([
"meat",
"fish",
"vegetarian",
"vegan",
"kids",
"other",
])
const optionalText = z.preprocess(
(value) => {
if (typeof value !== "string") return null
const trimmed = value.trim()
return trimmed.length > 0 ? trimmed : null
},
z.string().nullable(),
)
const optionalDate = z.preprocess(
(value) => {
if (typeof value !== "string") return null
const trimmed = value.trim()
return trimmed.length > 0 ? trimmed : null
},
z.iso.date().nullable(),
)
const memberResponseSchema = z
.object({
memberId: z.uuid(),
attending: z.boolean(),
mealPreference: mealPreferenceSchema.nullable(),
dietaryRestrictions: optionalText,
})
.refine((value) => !value.attending || value.mealPreference !== null, {
message: "Meal preference is required for attending guests",
path: ["mealPreference"],
})
export const submitInvitationResponseSchema = z.object({
token: z.string().min(1),
members: z.array(memberResponseSchema).min(1),
arrivalDate: optionalDate,
departureDate: optionalDate,
stayLocation: optionalText,
needsTransportHelp: z.boolean().nullable(),
messageToCouple: optionalText,
})
export type SubmitInvitationResponseInput = z.infer<typeof submitInvitationResponseSchema>
export type MealPreference = z.infer<typeof mealPreferenceSchema>