Feat/SW-1519 remove deprecated hotel data from schema
* feat(SW-1519): Removed displayWebpage from hotel schema * feat(SW-1519): Removed gallery from hotel schema * feat(SW-1519): Removed conferencesAndMeetings from hotel schema * feat(SW-1519): Removed healthAndWellness from hotel schema * feat(SW-1519): Removed restaurantImages from hotel schema * feat(SW-1519): Removed restaurantsOverviewPage from hotel schema Approved-by: Fredrik Thorsson Approved-by: Matilda Landström
This commit is contained in:
@@ -73,7 +73,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const jsonSchema = generateHotelSchema(hotelData.hotel)
|
||||
const jsonSchema = generateHotelSchema(hotelData)
|
||||
const { faq, content, tabValues } = hotelPageData
|
||||
const {
|
||||
name,
|
||||
|
||||
@@ -75,7 +75,7 @@ export function getSubpageData(
|
||||
: null,
|
||||
}
|
||||
case additionalData.meetingRooms.nameInUrl:
|
||||
const meetingImage = hotel.conferencesAndMeetings?.heroImages[0]
|
||||
const meetingImage = additionalData.conferencesAndMeetings?.heroImages[0]
|
||||
return {
|
||||
elevatorPitch: hotel.hotelContent.texts.meetingDescription?.medium,
|
||||
mainBody: additionalData.meetingRooms.mainBody,
|
||||
|
||||
@@ -9,7 +9,7 @@ export function getHotelPins(
|
||||
return []
|
||||
}
|
||||
|
||||
return hotels.map(({ availability, hotel }) => {
|
||||
return hotels.map(({ availability, hotel, additionalData }) => {
|
||||
const productType = availability.productType
|
||||
return {
|
||||
coordinates: {
|
||||
@@ -19,7 +19,8 @@ export function getHotelPins(
|
||||
name: hotel.name,
|
||||
publicPrice: productType?.public?.localPrice.pricePerNight ?? null,
|
||||
memberPrice: productType?.member?.localPrice.pricePerNight ?? null,
|
||||
redemptionPrice: productType?.redemption?.localPrice.pointsPerNight ?? null,
|
||||
redemptionPrice:
|
||||
productType?.redemption?.localPrice.pointsPerNight ?? null,
|
||||
rateType:
|
||||
productType?.public?.rateType ?? productType?.member?.rateType ?? null,
|
||||
currency:
|
||||
@@ -27,7 +28,10 @@ export function getHotelPins(
|
||||
productType?.member?.localPrice.currency ||
|
||||
currencyValue ||
|
||||
"N/A",
|
||||
images: [hotel.hotelContent.images, ...(hotel.gallery?.heroImages ?? [])],
|
||||
images: [
|
||||
hotel.hotelContent.images,
|
||||
...(additionalData.gallery?.heroImages ?? []),
|
||||
],
|
||||
amenities: hotel.detailedFacilities
|
||||
.map((facility) => ({
|
||||
...facility,
|
||||
|
||||
@@ -46,7 +46,7 @@ export async function MyStay({ refId }: { refId: string }) {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const { booking, hotel, room } = bookingConfirmation
|
||||
const { booking, hotel, additionalData, room } = bookingConfirmation
|
||||
const user = await getProfileSafely()
|
||||
const bv = cookies().get("bv")?.value
|
||||
const intl = await getIntl()
|
||||
@@ -78,7 +78,7 @@ export async function MyStay({ refId }: { refId: string }) {
|
||||
<Image
|
||||
className={styles.image}
|
||||
src={
|
||||
hotel.gallery?.heroImages[0]?.imageSizes.large ??
|
||||
additionalData.gallery?.heroImages[0]?.imageSizes.large ??
|
||||
hotel.galleryImages[0]?.imageSizes.large ??
|
||||
""
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
import type { CategorizedFilters } from "@/types/components/hotelReservation/selectHotel/hotelFilters"
|
||||
import { AvailabilityEnum } from "@/types/components/hotelReservation/selectHotel/selectHotel"
|
||||
import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams"
|
||||
import type { DetailedFacility, Hotel } from "@/types/hotel"
|
||||
import type { AdditionalData, DetailedFacility, Hotel } from "@/types/hotel"
|
||||
import type { HotelsAvailabilityItem } from "@/types/trpc/routers/hotel/availability"
|
||||
import type {
|
||||
HotelLocation,
|
||||
@@ -26,6 +26,7 @@ interface AvailabilityResponse {
|
||||
export interface HotelResponse {
|
||||
availability: HotelsAvailabilityItem
|
||||
hotel: Hotel
|
||||
additionalData: AdditionalData
|
||||
}
|
||||
|
||||
type Result = AvailabilityResponse | null
|
||||
@@ -48,6 +49,7 @@ async function enhanceHotels(hotels: HotelsAvailabilityItem[]) {
|
||||
return {
|
||||
availability,
|
||||
hotel: hotelData.hotel,
|
||||
additionalData: hotelData.additionalData,
|
||||
}
|
||||
})
|
||||
)
|
||||
@@ -121,12 +123,12 @@ function sortAndFilterHotelsByAvailability(
|
||||
(hotel.productType?.public &&
|
||||
currentAddedHotel?.productType?.public &&
|
||||
hotel.productType.public.localPrice.pricePerNight <
|
||||
currentAddedHotel.productType.public.localPrice
|
||||
.pricePerNight) ||
|
||||
currentAddedHotel.productType.public.localPrice
|
||||
.pricePerNight) ||
|
||||
(hotel.productType?.member &&
|
||||
currentAddedHotel?.productType?.member &&
|
||||
hotel.productType.member.localPrice.pricePerNight <
|
||||
currentAddedHotel.productType.member.localPrice.pricePerNight)
|
||||
currentAddedHotel.productType.member.localPrice.pricePerNight)
|
||||
) {
|
||||
availableHotels.set(hotel.hotelId, hotel)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user