fix(SW-1042): fix comment

This commit is contained in:
Bianca Widstam
2024-12-03 15:16:33 +01:00
parent 5dec45474d
commit a0c2d0bef7
5 changed files with 21 additions and 45 deletions

View File

@@ -14,7 +14,10 @@ import {
type RoomPackageCodes,
} from "@/types/components/hotelReservation/selectRate/roomFilter"
import type { SelectRateProps } from "@/types/components/hotelReservation/selectRate/roomSelection"
import type { Rate } from "@/types/components/hotelReservation/selectRate/selectRate"
import type {
Rate,
RateCode,
} from "@/types/components/hotelReservation/selectRate/selectRate"
import type { RoomConfiguration } from "@/server/routers/hotels/output"
export default function Rooms({
@@ -25,15 +28,9 @@ export default function Rooms({
}: SelectRateProps) {
const visibleRooms: RoomConfiguration[] =
filterDuplicateRoomTypesByLowestPrice(roomsAvailability.roomConfigurations)
const [selectedRate, setSelectedRate] = useState<
| {
publicRateCode: string
roomTypeCode: string
name: string
paymentTerm: string
}
| undefined
>(undefined)
const [selectedRate, setSelectedRate] = useState<RateCode | undefined>(
undefined
)
const [selectedPackages, setSelectedPackages] = useState<RoomPackageCodes[]>(
[]
)

View File

@@ -9,6 +9,8 @@ import {
import { RoomPackage } from "./roomFilter"
import type { RateCode } from "./selectRate"
type ProductPrice = z.output<typeof productTypePriceSchema>
export type RoomPriceSchema = z.output<typeof priceSchema>
@@ -20,17 +22,7 @@ export type FlexibilityOptionProps = {
priceInformation?: Array<string>
roomTypeCode: RoomConfiguration["roomTypeCode"]
petRoomPackage: RoomPackage | undefined
handleSelectRate: React.Dispatch<
React.SetStateAction<
| {
publicRateCode: string
roomTypeCode: string
name: string
paymentTerm: string
}
| undefined
>
>
handleSelectRate: React.Dispatch<React.SetStateAction<RateCode | undefined>>
}
export interface PriceListProps {

View File

@@ -7,10 +7,10 @@ import {
} from "@/server/routers/hotels/output"
import { RoomPriceSchema } from "./flexibilityOption"
import { Rate } from "./selectRate"
import type { RoomData } from "@/types/hotel"
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"
import type { RateCode } from "./selectRate"
export type RoomCardProps = {
hotelId: string
@@ -19,17 +19,7 @@ export type RoomCardProps = {
roomCategories: RoomData[]
selectedPackages: RoomPackageCodes[]
packages: RoomPackageData | undefined
handleSelectRate: React.Dispatch<
React.SetStateAction<
| {
publicRateCode: string
roomTypeCode: string
name: string
paymentTerm: string
}
| undefined
>
>
handleSelectRate: React.Dispatch<React.SetStateAction<RateCode | undefined>>
}
type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>

View File

@@ -2,7 +2,7 @@ import type { RoomData } from "@/types/hotel"
import type { SafeUser } from "@/types/user"
import type { RoomsAvailability } from "@/server/routers/hotels/output"
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"
import type { Rate } from "./selectRate"
import type { Rate, RateCode } from "./selectRate"
export interface RoomSelectionProps {
roomsAvailability: RoomsAvailability
@@ -10,17 +10,7 @@ export interface RoomSelectionProps {
user: SafeUser
availablePackages: RoomPackageData | undefined
selectedPackages: RoomPackageCodes[]
setRateCode: React.Dispatch<
React.SetStateAction<
| {
publicRateCode: string
roomTypeCode: string
name: string
paymentTerm: string
}
| undefined
>
>
setRateCode: React.Dispatch<React.SetStateAction<RateCode | undefined>>
rateSummary: Rate | null
}

View File

@@ -33,3 +33,10 @@ export interface Rate {
member?: Product["productType"]["member"]
features: RoomConfiguration["features"]
}
export type RateCode = {
publicRateCode: string
roomTypeCode: string
name: string
paymentTerm: string
}