Merged in feat/SW-1169-map-bedtype-icons (pull request #1113)
Feat/SW-1169 map bedtype icons * feat(SW-1169): Added bed icons * fix(SW-1169): update fill rule property * fix(SW-1169): update clip rule prop * feat(SW-1169): Added way of rendering bed type icons with extra beds * feat(SW-1169): update room schema to map mainBed to enum * feat(SW-1169): update bedtype icon color * feat(SW-1169): transform unknown bed types to BedTypeEnum.Other * test: update mock data with new schema Approved-by: Christel Westerberg
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { BedTypeEnum, ExtraBedTypeEnum } from "@/constants/booking"
|
||||
|
||||
import { imageSchema } from "./image"
|
||||
|
||||
const roomContentSchema = z.object({
|
||||
@@ -17,22 +19,40 @@ const roomTypesSchema = z.object({
|
||||
description: z.string(),
|
||||
code: z.string(),
|
||||
roomCount: z.number(),
|
||||
mainBed: z.object({
|
||||
type: z.string(),
|
||||
description: z.string(),
|
||||
widthRange: z.object({
|
||||
min: z.number(),
|
||||
max: z.number(),
|
||||
mainBed: z
|
||||
.object({
|
||||
type: z.string(),
|
||||
description: z.string(),
|
||||
widthRange: z.object({
|
||||
min: z.number(),
|
||||
max: z.number(),
|
||||
}),
|
||||
})
|
||||
.transform((data) => ({
|
||||
type:
|
||||
data.type in BedTypeEnum
|
||||
? (data.type as BedTypeEnum)
|
||||
: BedTypeEnum.Other,
|
||||
description: data.description,
|
||||
widthRange: data.widthRange,
|
||||
})),
|
||||
fixedExtraBed: z
|
||||
.object({
|
||||
type: z.string(),
|
||||
description: z.string().optional(),
|
||||
widthRange: z.object({
|
||||
min: z.number(),
|
||||
max: z.number(),
|
||||
}),
|
||||
})
|
||||
.transform((data) => {
|
||||
return data.type in ExtraBedTypeEnum
|
||||
? {
|
||||
type: data.type as ExtraBedTypeEnum,
|
||||
description: data.description,
|
||||
}
|
||||
: undefined
|
||||
}),
|
||||
}),
|
||||
fixedExtraBed: z.object({
|
||||
type: z.string(),
|
||||
description: z.string().optional(),
|
||||
widthRange: z.object({
|
||||
min: z.number(),
|
||||
max: z.number(),
|
||||
}),
|
||||
}),
|
||||
roomSize: z.object({
|
||||
min: z.number(),
|
||||
max: z.number(),
|
||||
|
||||
Reference in New Issue
Block a user