fix: clean up hotel and its typings
This commit is contained in:
13
server/routers/hotels/schemas/availability/occupancy.ts
Normal file
13
server/routers/hotels/schemas/availability/occupancy.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { ChildBedTypeEnum } from "@/constants/booking"
|
||||
|
||||
export const childrenSchema = z.object({
|
||||
age: z.number(),
|
||||
bedType: z.nativeEnum(ChildBedTypeEnum),
|
||||
})
|
||||
|
||||
export const occupancySchema = z.object({
|
||||
adults: z.number(),
|
||||
children: z.array(childrenSchema),
|
||||
})
|
||||
10
server/routers/hotels/schemas/availability/productType.ts
Normal file
10
server/routers/hotels/schemas/availability/productType.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { productTypePriceSchema } from "../productTypePrice"
|
||||
|
||||
export const productTypeSchema = z
|
||||
.object({
|
||||
public: productTypePriceSchema.optional(),
|
||||
member: productTypePriceSchema.optional(),
|
||||
})
|
||||
.optional()
|
||||
Reference in New Issue
Block a user