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
+48
View File
@@ -0,0 +1,48 @@
import { z } from "zod"
import { supportedLanguageCodes } from "@/lib/i18n/config"
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 optionalEmail = z.preprocess(
(value) => {
if (typeof value !== "string") return null
const trimmed = value.trim()
return trimmed.length > 0 ? trimmed : null
},
z.email().nullable(),
)
export const createInvitationSchema = z
.object({
displayName: z.string().trim().min(1, "Display name is required"),
language: z.enum(supportedLanguageCodes, {
error: "Select a supported language",
}),
contactEmail: optionalEmail.optional().default(null),
contactPhone: optionalText.optional().default(null),
maxPartySize: z.coerce
.number()
.int("Party size must be a whole number")
.min(1, "Party size must be at least 1"),
allowMemberEdits: z.coerce.boolean().default(false),
notes: optionalText.optional().default(null),
members: z
.array(z.string().trim().min(1))
.min(1, "Add at least one invitation member"),
})
.refine((value) => value.members.length <= value.maxPartySize, {
message: "Members cannot exceed max party size",
path: ["members"],
})
export type CreateInvitationInput = z.infer<typeof createInvitationSchema>