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:
Erik Tiekstra
2025-03-19 06:28:13 +00:00
parent 2fc33966ac
commit b2b197b1ef
15 changed files with 76 additions and 1701 deletions

View File

@@ -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)
}