From 102381fdeb8482de75c14ccef1b539503d423cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Tue, 18 Feb 2025 09:36:27 +0000 Subject: [PATCH] Merged in fix/facilities-zod-validation (pull request #1365) Fix: Facilities zod validation * fix: zod validation Approved-by: Pontus Dreij Approved-by: Erik Tiekstra Approved-by: Fredrik Thorsson --- components/ContentType/HotelPage/data.ts | 2 ++ server/routers/hotels/schemas/hotel/detailedFacility.ts | 4 +--- server/routers/hotels/schemas/hotel/merchantInformation.ts | 2 +- types/enums/facilities.ts | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/ContentType/HotelPage/data.ts b/components/ContentType/HotelPage/data.ts index 3d7faad2f..e58c73ab5 100644 --- a/components/ContentType/HotelPage/data.ts +++ b/components/ContentType/HotelPage/data.ts @@ -203,6 +203,8 @@ const facilityToIconMap: Record = { [FacilityEnum.LaptopSafe]: IconName.StarFilled, [FacilityEnum.Leisure]: IconName.StarFilled, [FacilityEnum.LuggageLockers]: IconName.StarFilled, + [FacilityEnum.LuggageStorageAdditionalCost]: IconName.StarFilled, + [FacilityEnum.LuggageStorageNoCost]: IconName.StarFilled, [FacilityEnum.Massage]: IconName.StarFilled, [FacilityEnum.MinibarInRoom]: IconName.StarFilled, [FacilityEnum.MobileLift]: IconName.StarFilled, diff --git a/server/routers/hotels/schemas/hotel/detailedFacility.ts b/server/routers/hotels/schemas/hotel/detailedFacility.ts index e30353df5..64e0dbad0 100644 --- a/server/routers/hotels/schemas/hotel/detailedFacility.ts +++ b/server/routers/hotels/schemas/hotel/detailedFacility.ts @@ -1,11 +1,9 @@ import { z } from "zod" -import { FacilityEnum } from "@/types/enums/facilities" - const detailedFacilitySchema = z.object({ filter: z.string().optional(), icon: z.string().optional(), - id: z.nativeEnum(FacilityEnum), + id: z.number(), name: z.string(), public: z.boolean(), sortOrder: z.number(), diff --git a/server/routers/hotels/schemas/hotel/merchantInformation.ts b/server/routers/hotels/schemas/hotel/merchantInformation.ts index cf0daeb01..85130ccb9 100644 --- a/server/routers/hotels/schemas/hotel/merchantInformation.ts +++ b/server/routers/hotels/schemas/hotel/merchantInformation.ts @@ -17,5 +17,5 @@ export const merchantInformationSchema = z.object({ .map(([key]) => key) .filter((key): key is PaymentMethodEnum => !!key) }), - webMerchantId: z.string(), + webMerchantId: z.string().optional(), }) diff --git a/types/enums/facilities.ts b/types/enums/facilities.ts index 2e9d0ae4d..4ac23647d 100644 --- a/types/enums/facilities.ts +++ b/types/enums/facilities.ts @@ -155,6 +155,8 @@ export enum FacilityEnum { Leisure = 83716, LifestyleConcierge = 162584, LuggageLockers = 324098, + LuggageStorageAdditionalCost = 375884, + LuggageStorageNoCost = 375885, Massage = 348859, MeetingArea = 1692, MeetingConferenceFacilities = 5806,