fix: clean up hotel and its typings
This commit is contained in:
31
server/routers/hotels/schemas/hotel/rating.ts
Normal file
31
server/routers/hotels/schemas/hotel/rating.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { z } from "zod"
|
||||
|
||||
const awardSchema = z.object({
|
||||
displayName: z.string(),
|
||||
images: z.object({
|
||||
large: z.string(),
|
||||
medium: z.string(),
|
||||
small: z.string(),
|
||||
}),
|
||||
})
|
||||
|
||||
const reviewsSchema = z
|
||||
.object({
|
||||
widgetHtmlTagId: z.string(),
|
||||
widgetScriptEmbedUrlIframe: z.string(),
|
||||
widgetScriptEmbedUrlJavaScript: z.string(),
|
||||
})
|
||||
.optional()
|
||||
|
||||
export const ratingsSchema = z
|
||||
.object({
|
||||
tripAdvisor: z.object({
|
||||
awards: z.array(awardSchema),
|
||||
numberOfReviews: z.number(),
|
||||
rating: z.number(),
|
||||
ratingImageUrl: z.string(),
|
||||
reviews: reviewsSchema,
|
||||
webUrl: z.string(),
|
||||
}),
|
||||
})
|
||||
.optional()
|
||||
Reference in New Issue
Block a user