feat(sw-697): Added default values

This commit is contained in:
Pontus Dreij
2024-11-04 16:36:24 +01:00
parent 6b5934e2d0
commit b4a015b47a
4 changed files with 19 additions and 9 deletions

View File

@@ -780,7 +780,11 @@ const breakfastPackagePriceSchema = z
price: z.string(),
totalPrice: z.string(),
})
.optional() // TODO: Remove optional when the API change has been deployed
.default({
currency: CurrencyEnum.SEK,
price: "0",
totalPrice: "0",
}) // TODO: Remove optional and default when the API change has been deployed
export const breakfastPackageSchema = z.object({
code: z.string(),

View File

@@ -1,6 +1,7 @@
import { z } from "zod"
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import { CurrencyEnum } from "@/types/enums/currency"
export const getRoomPackagesInputSchema = z.object({
hotelId: z.string(),
@@ -13,11 +14,16 @@ export const getRoomPackagesInputSchema = z.object({
export const packagePriceSchema = z
.object({
currency: z.string(),
currency: z.nativeEnum(CurrencyEnum),
price: z.string(),
totalPrice: z.string(),
})
.optional() // TODO: Remove optional when the API change has been deployed
.optional()
.default({
currency: CurrencyEnum.SEK,
price: "0",
totalPrice: "0",
}) // TODO: Remove optional and default when the API change has been deployed
export const packagesSchema = z.object({
code: z.nativeEnum(RoomPackageCodeEnum),