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

@@ -7,7 +7,7 @@ import type {
WithContext,
} from "schema-dts"
import type { Hotel } from "@/types/hotel"
import type { HotelData } from "@/types/hotel"
import type { Breadcrumbs } from "@/types/trpc/routers/contentstack/breadcrumbs"
export function generateBreadcrumbsSchema(breadcrumbs: Breadcrumbs) {
@@ -32,10 +32,13 @@ export function generateBreadcrumbsSchema(breadcrumbs: Breadcrumbs) {
}
}
export function generateHotelSchema(hotel: Hotel) {
export function generateHotelSchema(hotelData: HotelData) {
const { hotel, additionalData } = hotelData
const ratings = hotel.ratings?.tripAdvisor
const checkinData = hotel.hotelFacts.checkin
const image = hotel.gallery?.heroImages[0] || hotel.gallery?.smallerImages[0]
const image =
additionalData.gallery?.heroImages[0] ||
additionalData.gallery?.smallerImages[0]
const facilities = hotel.detailedFacilities
const jsonLd: WithContext<HotelSchema> = {
"@context": "https://schema.org",