feat(SW-2007): Added metadata for hotel subpages
Approved-by: Fredrik Thorsson Approved-by: Matilda Landström
This commit is contained in:
@@ -8,6 +8,7 @@ import { env } from "@/env/server"
|
||||
|
||||
import { attributesSchema as hotelAttributesSchema } from "../../hotels/schemas/hotel"
|
||||
import { additionalDataAttributesSchema } from "../../hotels/schemas/hotel/include/additionalData"
|
||||
import { imageSchema } from "../../hotels/schemas/image"
|
||||
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
||||
import { systemSchema } from "../schemas/system"
|
||||
import { getDescription, getImage, getTitle } from "./utils"
|
||||
@@ -98,13 +99,44 @@ export const rawMetadataSchema = z.object({
|
||||
blocks: metaDataBlocksSchema,
|
||||
hotel_page_id: z.string().optional().nullable(),
|
||||
hotelData: hotelAttributesSchema
|
||||
.pick({ name: true, address: true, hotelContent: true })
|
||||
.pick({
|
||||
name: true,
|
||||
address: true,
|
||||
hotelContent: true,
|
||||
healthFacilities: true,
|
||||
})
|
||||
.optional()
|
||||
.nullable(),
|
||||
additionalHotelData: additionalDataAttributesSchema
|
||||
.pick({ gallery: true })
|
||||
.pick({
|
||||
gallery: true,
|
||||
hotelParking: true,
|
||||
healthAndFitness: true,
|
||||
hotelSpecialNeeds: true,
|
||||
meetingRooms: true,
|
||||
parkingImages: true,
|
||||
accessibility: true,
|
||||
conferencesAndMeetings: true,
|
||||
})
|
||||
.optional()
|
||||
.nullable(),
|
||||
hotelRestaurants: z
|
||||
.array(
|
||||
z.object({
|
||||
nameInUrl: z.string().optional().nullable(),
|
||||
elevatorPitch: z.string().optional().nullable(),
|
||||
name: z.string().optional().nullable(),
|
||||
content: z
|
||||
.object({
|
||||
images: z.array(imageSchema).optional().nullable(),
|
||||
})
|
||||
.optional()
|
||||
.nullable(),
|
||||
})
|
||||
)
|
||||
.optional()
|
||||
.nullable(),
|
||||
subpageUrl: z.string().optional().nullable(),
|
||||
location: z.string().optional().nullable(),
|
||||
filter: z.string().optional().nullable(),
|
||||
filterType: z.enum(["facility", "surroundings"]).optional().nullable(),
|
||||
|
||||
Reference in New Issue
Block a user