feat(SW-697): Update package structure on price from API
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
priceSchema,
|
||||
Product,
|
||||
productTypePriceSchema,
|
||||
RoomConfiguration,
|
||||
} from "@/server/routers/hotels/output"
|
||||
|
||||
import { RoomPackage } from "./roomFilter"
|
||||
import { Rate } from "./selectRate"
|
||||
|
||||
type ProductPrice = z.output<typeof productTypePriceSchema>
|
||||
export type RoomPriceSchema = z.output<typeof priceSchema>
|
||||
|
||||
export type FlexibilityOptionProps = {
|
||||
product: Product | undefined
|
||||
@@ -19,10 +22,12 @@ export type FlexibilityOptionProps = {
|
||||
roomType: RoomConfiguration["roomType"]
|
||||
roomTypeCode: RoomConfiguration["roomTypeCode"]
|
||||
features: RoomConfiguration["features"]
|
||||
petRoomPackage: RoomPackage | undefined
|
||||
handleSelectRate: (rate: Rate) => void
|
||||
}
|
||||
|
||||
export interface PriceListProps {
|
||||
publicPrice?: ProductPrice | Record<string, never>
|
||||
memberPrice?: ProductPrice | Record<string, never>
|
||||
petRoomPackage?: RoomPackage | undefined
|
||||
}
|
||||
|
||||
@@ -1,17 +1,34 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
RateDefinition,
|
||||
RoomConfiguration,
|
||||
} from "@/server/routers/hotels/output"
|
||||
import { packagePriceSchema } from "@/server/routers/hotels/schemas/packages"
|
||||
|
||||
import { RoomPriceSchema } from "./flexibilityOption"
|
||||
import { Rate } from "./selectRate"
|
||||
|
||||
import type { RoomData } from "@/types/hotel"
|
||||
import type { RoomPackageCodes } from "./roomFilter"
|
||||
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"
|
||||
|
||||
export type RoomCardProps = {
|
||||
roomConfiguration: RoomConfiguration
|
||||
rateDefinitions: RateDefinition[]
|
||||
roomCategories: RoomData[]
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
packages: RoomPackageData
|
||||
handleSelectRate: (rate: Rate) => void
|
||||
}
|
||||
|
||||
type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>
|
||||
|
||||
export type CalculatePricesPerNightProps = {
|
||||
publicLocalPrice: RoomPriceSchema
|
||||
memberLocalPrice: RoomPriceSchema
|
||||
publicRequestedPrice?: RoomPriceSchema
|
||||
memberRequestedPrice?: RoomPriceSchema
|
||||
petRoomLocalPrice?: RoomPackagePriceSchema
|
||||
petRoomRequestedPrice?: RoomPackagePriceSchema
|
||||
nights: number
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { getRoomPackagesSchema } from "@/server/routers/hotels/schemas/packages"
|
||||
import {
|
||||
getRoomPackagesSchema,
|
||||
packagesSchema,
|
||||
} from "@/server/routers/hotels/schemas/packages"
|
||||
|
||||
export enum RoomPackageCodeEnum {
|
||||
PET_ROOM = "PETR",
|
||||
@@ -17,3 +20,5 @@ export interface RoomPackageData
|
||||
extends z.output<typeof getRoomPackagesSchema> {}
|
||||
|
||||
export type RoomPackageCodes = RoomPackageData[number]["code"]
|
||||
|
||||
export type RoomPackage = z.output<typeof packagesSchema>
|
||||
|
||||
Reference in New Issue
Block a user