fix: avoid localizing currencies and default missing value to N/A

This commit is contained in:
Christel Westerberg
2025-01-07 15:48:44 +01:00
parent 5018cba623
commit a3331850a2
12 changed files with 22 additions and 68 deletions

View File

@@ -1,7 +1,6 @@
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(),
@@ -14,13 +13,13 @@ export const getRoomPackagesInputSchema = z.object({
export const packagePriceSchema = z
.object({
currency: z.nativeEnum(CurrencyEnum),
currency: z.string().default("N/A"),
price: z.string(),
totalPrice: z.string(),
})
.optional()
.default({
currency: CurrencyEnum.SEK,
currency: "N/A",
price: "0",
totalPrice: "0",
}) // TODO: Remove optional and default when the API change has been deployed