feat: get breakfast package from API

This commit is contained in:
Simon Emanuelsson
2024-10-28 10:12:03 +01:00
parent fc8844eb96
commit 62f549e85d
47 changed files with 718 additions and 210 deletions

View File

@@ -1,7 +1,15 @@
import { z } from "zod"
import { breakfastEnum } from "@/types/enums/breakfast"
import { breakfastPackageSchema } from "@/server/routers/hotels/output"
export const breakfastSchema = z.object({
breakfast: z.nativeEnum(breakfastEnum),
import { BreakfastPackageEnum } from "@/types/enums/breakfast"
export const breakfastStoreSchema = z.object({
breakfast: breakfastPackageSchema.or(
z.literal(BreakfastPackageEnum.NO_BREAKFAST)
),
})
export const breakfastFormSchema = z.object({
breakfast: z.string().or(z.literal(BreakfastPackageEnum.NO_BREAKFAST)),
})