42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { z } from "zod"
|
|
|
|
import { attributesSchema } from "@/server/routers/hotels/schemas/hotel"
|
|
|
|
export const nearbyHotelsSchema = z.object({
|
|
attributes: z.lazy(() =>
|
|
z
|
|
.object({
|
|
displayWebPage: z
|
|
.object({
|
|
healthGym: z.boolean().default(false),
|
|
meetingRoom: z.boolean().default(false),
|
|
parking: z.boolean().default(false),
|
|
specialNeeds: z.boolean().default(false),
|
|
})
|
|
.default({
|
|
healthGym: false,
|
|
meetingRoom: false,
|
|
parking: false,
|
|
specialNeeds: false,
|
|
}),
|
|
})
|
|
.merge(
|
|
attributesSchema.pick({
|
|
address: true,
|
|
cityId: true,
|
|
cityName: true,
|
|
detailedFacilities: true,
|
|
hotelContent: true,
|
|
isActive: true,
|
|
isPublished: true,
|
|
location: true,
|
|
name: true,
|
|
operaId: true,
|
|
ratings: true,
|
|
})
|
|
)
|
|
),
|
|
id: z.string(),
|
|
type: z.literal("hotels"),
|
|
})
|