fix: cache hotel response
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
import { passwordValidators } from "@/utils/passwordValidator"
|
||||
import type { passwordValidators } from "@/utils/zod/passwordValidator"
|
||||
|
||||
export type PasswordValidatorKey = keyof typeof passwordValidators
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import type {
|
||||
Hotel,
|
||||
Restaurant,
|
||||
RestaurantOpeningHours,
|
||||
} from "@/types/hotel"
|
||||
import type { ParkingAmenityProps } from "./parking"
|
||||
import type { Hotel, Restaurant, RestaurantOpeningHours } from "@/types/hotel"
|
||||
|
||||
export type AmenitiesSidePeekProps = {
|
||||
amenitiesList: Hotel["detailedFacilities"]
|
||||
|
||||
@@ -8,7 +8,6 @@ import type {
|
||||
import type { packagePriceSchema } from "@/server/routers/hotels/schemas/packages"
|
||||
import type { RoomPriceSchema } from "./flexibilityOption"
|
||||
import type { RoomPackageCodes, RoomPackages } from "./roomFilter"
|
||||
import type { RateCode } from "./selectRate"
|
||||
|
||||
export type RoomCardProps = {
|
||||
hotelId: string
|
||||
@@ -19,7 +18,6 @@ export type RoomCardProps = {
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
roomListIndex: number
|
||||
packages: RoomPackages | undefined
|
||||
handleSelectRate: React.Dispatch<React.SetStateAction<RateCode | undefined>>
|
||||
}
|
||||
|
||||
type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type { RoomsAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type {
|
||||
DefaultFilterOptions,
|
||||
RoomPackage,
|
||||
RoomPackageCodes,
|
||||
RoomPackages,
|
||||
} from "./roomFilter"
|
||||
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type { RoomsAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
|
||||
export interface RoomTypeListProps {
|
||||
roomsAvailability: RoomsAvailability
|
||||
roomCategories: Room[]
|
||||
availablePackages: RoomPackage | undefined
|
||||
availablePackages: RoomPackages | undefined
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
hotelType: string | undefined
|
||||
roomListIndex: number
|
||||
@@ -27,7 +25,7 @@ export interface SelectRateProps {
|
||||
|
||||
export interface RoomSelectionPanelProps {
|
||||
roomCategories: Room[]
|
||||
availablePackages: RoomPackage[]
|
||||
availablePackages: RoomPackages
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
hotelType: string | undefined
|
||||
defaultPackages: DefaultFilterOptions[]
|
||||
|
||||
8
types/enums/currency.ts
Normal file
8
types/enums/currency.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export enum CurrencyEnum {
|
||||
DKK = "DKK",
|
||||
EUR = "EUR",
|
||||
NOK = "NOK",
|
||||
PLN = "PLN",
|
||||
SEK = "SEK",
|
||||
Unknown = "Unknown",
|
||||
}
|
||||
@@ -7,18 +7,20 @@ import type { addressSchema } from "@/server/routers/hotels/schemas/hotel/addres
|
||||
import type { hotelContentSchema } from "@/server/routers/hotels/schemas/hotel/content"
|
||||
import type { detailedFacilitiesSchema } from "@/server/routers/hotels/schemas/hotel/detailedFacility"
|
||||
import type { checkinSchema } from "@/server/routers/hotels/schemas/hotel/facts"
|
||||
import type { healthFacilitySchema } from "@/server/routers/hotels/schemas/hotel/healthFacilities"
|
||||
import type { nearbyHotelsSchema } from "@/server/routers/hotels/schemas/hotel/include/nearbyHotels"
|
||||
import type { restaurantsSchema } from "@/server/routers/hotels/schemas/hotel/include/restaurants"
|
||||
import type {
|
||||
openingHoursDetailsSchema,
|
||||
openingHoursSchema,
|
||||
restaurantsSchema,
|
||||
} from "@/server/routers/hotels/schemas/hotel/include/restaurants"
|
||||
import type { transformRoomCategories } from "@/server/routers/hotels/schemas/hotel/include/roomCategories"
|
||||
import type { locationSchema } from "@/server/routers/hotels/schemas/hotel/location"
|
||||
import type { parkingSchema } from "@/server/routers/hotels/schemas/hotel/parking"
|
||||
import type { pointOfInterestSchema } from "@/server/routers/hotels/schemas/hotel/poi"
|
||||
import type { ratingsSchema } from "@/server/routers/hotels/schemas/hotel/rating"
|
||||
import type { imageSchema } from "@/server/routers/hotels/schemas/image"
|
||||
import { restaurantOpeningHoursSchema } from "@/server/routers/hotels/schemas/restaurants"
|
||||
import { healthFacilitySchema } from "@/server/routers/hotels/schemas/hotel/healthFacilities"
|
||||
import type {
|
||||
additionalDataSchema,
|
||||
extraPageSchema,
|
||||
facilitySchema,
|
||||
transformAdditionalData,
|
||||
@@ -45,9 +47,12 @@ export type NearbyHotel = Pick<NearbyHotelsSchema, "id" | "type"> &
|
||||
export type Parking = z.output<typeof parkingSchema>
|
||||
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
|
||||
type RestaurantSchema = z.output<typeof restaurantsSchema>
|
||||
export type RestaurantOpeningHours = z.output<typeof restaurantOpeningHoursSchema>
|
||||
export type Restaurant = Pick<RestaurantSchema, "id" | "type"> &
|
||||
RestaurantSchema["attributes"]
|
||||
export type RestaurantOpeningHours = z.output<typeof openingHoursSchema>
|
||||
export type RestaurantOpeningHoursDay = z.output<
|
||||
typeof openingHoursDetailsSchema
|
||||
>
|
||||
export type Room = ReturnType<typeof transformRoomCategories>
|
||||
|
||||
export type HotelMapContentProps = {
|
||||
|
||||
@@ -7,3 +7,6 @@ import type { productTypePriceSchema } from "@/server/routers/hotels/schemas/pro
|
||||
export type HotelsAvailability = z.output<typeof hotelsAvailabilitySchema>
|
||||
export type ProductType = z.output<typeof productTypeSchema>
|
||||
export type ProductTypePrices = z.output<typeof productTypePriceSchema>
|
||||
|
||||
export type HotelsAvailabilityItem =
|
||||
HotelsAvailability["data"][number]["attributes"]
|
||||
|
||||
Reference in New Issue
Block a user