Merged in feat/sw-2863-move-contentstack-router-to-trpc-package (pull request #2389)

feat(SW-2863): Move contentstack router to trpc package

* Add exports to packages and lint rule to prevent relative imports

* Add env to trpc package

* Add eslint to trpc package

* Apply lint rules

* Use direct imports from trpc package

* Add lint-staged config to trpc

* Move lang enum to common

* Restructure trpc package folder structure

* WIP first step

* update internal imports in trpc

* Fix most errors in scandic-web

Just 100 left...

* Move Props type out of trpc

* Fix CategorizedFilters types

* Move more schemas in hotel router

* Fix deps

* fix getNonContentstackUrls

* Fix import error

* Fix entry error handling

* Fix generateMetadata metrics

* Fix alertType enum

* Fix duplicated types

* lint:fix

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package

* Fix broken imports

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-06-26 07:53:01 +00:00
parent 0263ab8c87
commit 002d093af4
921 changed files with 3112 additions and 3008 deletions

View File

@@ -0,0 +1,9 @@
export enum BreakfastPackageEnum {
FREE_MEMBER_BREAKFAST = "BRF0",
FREE_CHILD_BREAKFAST = "BRFINF",
REGULAR_BREAKFAST = "BRF1",
CHILD_PAYING_BREAKFAST = "BRF1C",
SPECIAL_PACKAGE_BREAKFAST = "F01S",
ANCILLARY_REGULAR_BREAKFAST = "BRF2",
ANCILLARY_CHILD_PAYING_BREAKFAST = "BRF2C",
}

View File

@@ -0,0 +1,6 @@
export enum ChildBedMapEnum {
IN_ADULTS_BED = 0,
IN_CRIB = 1,
IN_EXTRA_BED = 2,
UNKNOWN = 3,
}

View File

@@ -0,0 +1,6 @@
export enum ChildBedTypeEnum {
Crib = "Crib",
ExtraBed = "ExtraBed",
ParentsBed = "ParentsBed",
Unknown = "Unknown",
}

View File

@@ -0,0 +1,14 @@
export enum PageContentTypeEnum {
accountPage = "account_page",
campaignOverviewPage = "campaign_overview_page",
campaignPage = "campaign_page",
collectionPage = "collection_page",
contentPage = "content_page",
currentBlocksPage = "current_blocks_page",
destinationCityPage = "destination_city_page",
destinationCountryPage = "destination_country_page",
destinationOverviewPage = "destination_overview_page",
hotelPage = "hotel_page",
loyaltyPage = "loyalty_page",
startPage = "start_page",
}

View File

@@ -0,0 +1,6 @@
export enum SortOption {
Recommended = "recommended",
Distance = "distance",
Name = "name",
TripAdvisorRating = "tripadvisor",
}

View File

@@ -0,0 +1,266 @@
export enum FacilityEnum {
AccessibleBathingControls = 2065,
AccessibleBathtubs = 2062,
AccessibleElevators = 2067,
AccessibleLightSwitch = 2066,
AccessibleRoomsAtHotel1 = 2659,
AccessibleRoomsAtHotel2 = 3010,
AccessibleToilets = 2068,
AccessibleWashBasins = 2063,
AdaptedRoomDoors = 2080,
AdjoiningConventionCentre = 1560,
AirConAirCooling = 2660,
AirConditioningInRoom = 5763,
AirportMaxDistance8Km = 1856,
AlarmsContinuouslyMonitored = 1876,
AlarmsHaveStrobeLightsForDeafHardHearingInAllGuestRooms = 1877,
AlarmsHaveStrobeLightsForDeafHardHearingInAllHallways = 1878,
AlarmsHaveStrobeLightsForDeafHardHearingInAllPublicAreas = 1879,
AllAudibleSmokeAlarmsHardwired = 1884,
AllExteriorDoorsRequireKeyAccessAtNightOrAutomaticallyLock = 2004,
AllGuestRoomDoorsHaveViewports = 2006,
AllGuestRoomDoorsSelfClosing = 2007,
AllParkingAreasPatrolled = 1933,
AllParkingAreasWellLit = 2013,
AllStairsWellsVentilated = 2053,
ArmchairBed = 104126,
AudibleAlarms = 1880,
AudibleSmokeAlarmsInAllHalls = 1881,
AudibleSmokeAlarmsInAllPublicAreas = 1882,
AudibleSmokeAlarmsInAllRooms = 1883,
AudioVisualEquipmentAvailable = 961,
AutolinkFireDepartment = 1886,
AutomatedExternalDefibrillatorOnSiteAED = 1917,
AutomaticFireDoors = 1887,
AutoRecallElevators = 1885,
BalconiesAccessibleToAdjoiningRooms = 1962,
Ballroom = 1609,
Banquet = 1557,
Bar = 1014,
BasicMedicalEquipmentOnSite = 1920,
BathroomsAdaptedForDisabledGuests = 2064,
Beach = 1827,
Beach0To1Km = 1019,
BeautySalon = 1015,
BedroomsWithWheelchairAccess = 2081,
BikesForLoan = 5550,
Bowling = 185105,
BrailleLargePrintHotelLiterature = 2069,
BrailleLargePrintMenus = 2070,
Breakfast = 5807,
Business1 = 1385,
Business2 = 83715,
BusinessCentre = 962,
Cafe = 1381,
CashFree8pmTill6am = 327877,
CashFreeHotel = 345180,
ChildrenWelcome = 1828,
City = 1857,
CoffeeInReceptionAtCharge = 332224,
CoffeeShop = 956,
CoffeeTeaFacilities = 5776,
ColourTVInRoomsAllScandicHotels = 5773,
ComplimentaryColdRefreshments = 157965,
CongressHall = 1558,
ConventionCentre = 963,
Couples = 2663,
DeadboltsOnConnectingDoors = 1990,
DeadboltsSecondaryLocksOnAllGuestRoomDoors = 1985,
Defibrillator = 99872,
Desk = 5777,
DirectDialPhoneInRoomsAllScandic = 5772,
DisabledEmergencyPlan1 = 1888,
DisabledEmergencyPlan2 = 2074,
DisabledParking = 2072,
DiscoNightClub = 958,
DJLiveMusic = 162587,
DO_NOT_USE_Restaurant = 1377,
Downtown = 969,
DrinkableTapWater = 5553,
DVDPlayer = 5778,
EBikesChargingStation = 265711,
ElectronicKeyCards = 1994,
Elevator = 959,
EmergencyBackUpGenerators = 1889,
EmergencyCallButtonOnPhone = 1998,
EmergencyCodesOrButtonsInRooms = 2075,
EmergencyEvacuationPlan1 = 1890,
EmergencyEvacuationPlan2 = 1895,
EmergencyEvaluationDrillFrequency = 1896,
EmergencyInfoInAllRooms = 1897,
EmergencyLightingAllScandic = 952,
EmergencyLightningInAllPublicAreas = 1898,
EmergencyServiceResponseTimeInMinutes = 1899,
Entertainment = 970,
EventVenue = 1559,
ExchangeFacility = 1605,
ExitMapsInRooms = 1900,
ExitSignsLit = 1901,
ExtraFamilyFriendly = 242920,
Families = 2664,
FaxFacilityInRoom = 5764,
Financial = 1409,
FireDetectorsAllScandic = 1869,
FireDetectorsInAllHalls = 1903,
FireDetectorsInAllPublicAreas = 1905,
FireDetectorsInAllRooms = 1906,
FireExtinguishersInAllPublicAreas = 1907,
FireExtinguishersInPublicAreasAllScandic = 1870,
FireSafetyAllScandic = 1871,
FirstAidAvailable = 1915,
FoodDrinks247 = 324100,
FreeWiFi = 1833,
GiftShop = 1376,
Golf = 1016,
GolfCourse0To30Km = 1607,
GuestRoomDoorsHaveASecondLock = 2005,
Gym = 1829,
GymTrainingFacilities = 2669,
Hairdresser = 348860,
HairdryerInRoomAllScandic = 5765,
HandicapFacilities = 2076,
HandrailsInBathrooms = 2078,
HearingInductionLoops = 2077,
Highway1 = 1858,
Highway2 = 1864,
Hiking0To3Km = 239346,
HotelCompliesWithAAASecurityStandards = 2011,
HotelIsFollowingScandicsSafetySecurityPolicy = 5559,
HotelWorksAccordingToScandicsAccessibilityConcepts = 5560,
IceMachine = 1405,
IceMachineReception = 332194,
IDRequiredToReplaceAGuestRoomKey = 2024,
IfNoWhatAreTheHoursUse24ClockEx0000To0600 = 1912,
InCountry = 1867,
IndustrialPark = 1859,
InternetHighSpeedInternetConnectionAllScandic = 5804,
InternetHotSpotsAllScandic = 1832,
IroningRoom = 238849,
IronIroningBoardAllScandic = 5780,
Jacuzzi = 162573,
JacuzziInRoom = 5766,
KayaksForLoan = 162585,
KeyAccessOnlySecuredFloorsAvailable = 2050,
KeyAccessOnlyToHealthClubGym = 2061,
KidsPlayRoom = 239349,
KidsUpToAndIncluding12YearsStayForFree = 5561,
KitchenInRoom = 5767,
Lake0To1Km = 1865,
LakeOrSea0To1Km = 245437,
LaptopSafe = 5283,
LateCheckOutUntil1400Guaranteed = 324101,
LaundryRoom = 326031,
LaundryService = 1834,
LaundryServiceExpress = 162583,
Leisure = 83716,
LifestyleConcierge = 162584,
LuggageLockers = 324098,
LuggageStorageAdditionalCost = 375884,
LuggageStorageNoCost = 375885,
Massage = 348859,
MeetingArea = 1692,
MeetingConferenceFacilities = 5806,
MeetingRooms = 1017,
MinibarInRoom = 5768,
MobileLift = 113185,
Mountains0To1Km = 1866,
MovieChannelsInRoomAllScandic = 5770,
MultipleExitsOnEachFloor = 2012,
NonSmokingRoomsAllScandic = 5771,
OnSiteTrainingFacilities = 3014,
OtherExplainInBriefDescription = 1608,
OutdoorTerrace = 1382,
OvernightSecurity = 1913,
ParkingAdditionalCost = 1406,
ParkingAttendant = 1914,
ParkingElectricCharging = 5554,
ParkingFreeParking = 5562,
ParkingGarage = 2665,
ParkingOutdoor = 162574,
PCHookUpInRoom = 5769,
PetFriendlyRooms = 1835,
PillowAlarmsAvailable = 2079,
PlayStationInPlayArea = 175449,
Pool = 1831,
PoolSwimmingPoolJacuzziAtHotel = 2667,
PrintingService = 1380,
PropertyMeetsRequirementsFireSafety = 1875,
PublicAddressSystem = 2014,
RelaxationSuite = 5564,
Restaurant = 1383,
RestrictedRoomAccessAllScandic = 1872,
RooftopBar = 239348,
RoomsAccessibleFromTheInterior = 950,
RoomService = 1378,
RoomWindowsOpen = 2016,
RoomWindowsThatOpenHaveLockingDevice = 2020,
Rural1 = 1861,
Rural2 = 1868,
SafeDepositBoxInRoomsAllScandic = 5775,
SafeDepositBoxInRoomsCanHoldA17InchLaptop = 200124,
SafeDepositBoxInRoomsCannotHoldALaptop = 200123,
SafetyChainsOnGuestRoomDoor = 2047,
Sauna = 1379,
ScandicShop24Hrs = 1408,
SecondaryLocksOnSlidingGlassDoors = 2048,
SecondaryLocksOnWindows = 2049,
Security24Hours = 1911,
SecurityEscortsAvailableOnRequest = 1936,
SecurityPersonnelOnSite = 1934,
SeparateFloorsForWomen = 2051,
ServesBreakfastAlwaysIncluded = 1407,
ServesBreakfastNotAlwaysIncluded = 5556,
ServesOrganicBreakfastAlwaysIncluded = 5557,
ServesOrganicBreakfastNotAlwaysIncluded = 5558,
ServiceGuideDogsAllowed = 2071,
ServiceSecurity24Hrs = 326033,
Shopping = 971,
SkateboardsForLoan = 162586,
Skiing0To1Km = 245031,
Skybar = 1606,
SmokeDetectorsAllScandic = 1873,
Solarium = 1830,
SpecialNeedsMenus = 2082,
Sports = 83717,
SprinklersAllScandic = 1874,
SprinklersInAllHalls = 1908,
SprinklersInAllPublicAreas = 1909,
SprinklersInAllRooms = 1910,
StaffInDuplicateKeys = 1942,
StaffRedCrossCertifiedInCPR = 1941,
StaffTrainedForDisabledGuests = 1928,
StaffTrainedInAutomatedExternalDefibrillatorUsageAED = 1940,
StaffTrainedInCPR = 1923,
StaffTrainedInFirstAid = 1939,
StaffTrainedInFirstAidTechniques = 951,
StaffTrainedToCaterForDisabledGuestsAllScandic = 2073,
Suburbs = 1860,
SwingboltLock = 2052,
TeleConferencingFacilitiesAvailable = 1018,
TelevisionsWithSubtitlesOrClosedCaptions = 2083,
Tennis1 = 1836,
Tennis2 = 1838,
TennisPadel = 239350,
Theatre = 1862,
TrouserPress = 5779,
TVWithChromecast1 = 229127,
TVWithChromecast2 = 229144,
UniformSecurityOnPremises = 1935,
UtilityRoomForIroning = 324097,
VendingMachineWithNecessities = 324099,
VideoSurveillanceInHallways = 2056,
VideoSurveillanceInPublicAreas = 1386,
VideoSurveillanceMonitored24HrsADay = 2058,
VideoSurveillanceOfAllParkingAreas = 2055,
VideoSurveillanceOfExteriorFrontEntrance = 2054,
VideoSurveillanceRecorded24HrsADayParkingArea = 2059,
WallMountedCycleRack = 199642,
WellLitWalkways = 2060,
WellnessAndSaunaEntranceFeeAdmission16PlusYears = 267806,
WellnessPoolSaunaEntranceFeeAdmission16PlusYears = 307754,
WheelchairAccess = 2084,
WideCorridors = 2086,
WideEntrance = 2085,
WideRestaurantEntrance = 2087,
WiFiWirelessInternetAccessAllScandic = 5774,
}

View File

@@ -0,0 +1,5 @@
export enum HotelTypeEnum {
Signature = "signature",
ScandicGo = "scandicgo",
Regular = "regular",
}

View File

@@ -0,0 +1,16 @@
export namespace LoyaltyPageEnum {
export namespace ContentStack {
export const enum blocks {
CardsGrid = "LoyaltyPageBlocksCardsGrid",
Content = "LoyaltyPageBlocksContent",
DynamicContent = "LoyaltyPageBlocksDynamicContent",
Shortcuts = "LoyaltyPageBlocksShortcuts",
}
export const enum sidebar {
Content = "LoyaltyPageSidebarContent",
DynamicContent = "LoyaltyPageSidebarDynamicContent",
JoinLoyaltyContact = "LoyaltyPageSidebarJoinLoyaltyContact",
}
}
}

View File

@@ -0,0 +1,7 @@
export enum PackageTypeEnum {
AccessibleFriendlyRoom = "AccessibleFriendlyRoom",
AllergyRoom = "AllergyRoom",
BreakfastAdult = "BreakfastAdult",
BreakfastChildren = "BreakfastChildren",
PetRoom = "PetRoom",
}

View File

@@ -0,0 +1,8 @@
export enum PointOfInterestGroupEnum {
PUBLIC_TRANSPORT = "Public transport",
ATTRACTIONS = "Attractions",
BUSINESS = "Business",
LOCATION = "Location",
PARKING = "Parking",
SHOPPING_DINING = "Shopping & Dining",
}

View File

@@ -0,0 +1,5 @@
export enum RateEnum {
change = "change",
flex = "flex",
save = "save",
}

View File

@@ -0,0 +1,13 @@
// API keeps calling CorporateCheque BonusCheque
// (will be handled in transform later)
export enum RateTypeEnum {
Arb = "Arb",
Company = "Company",
CorporateCheque = "BonusCheque",
Promotion = "Promotion",
PublicPromotion = "PublicPromotion",
Redemption = "Redemption",
Regular = "Regular",
TravelAgent = "TravelAgent",
Voucher = "Voucher",
}

View File

@@ -0,0 +1,5 @@
export enum RoomPackageCodeEnum {
PET_ROOM = "PETR",
ALLERGY_ROOM = "ALLG",
ACCESSIBILITY_ROOM = "ACCE",
}

View File

@@ -0,0 +1,9 @@
export enum scriptedCardThemeEnum {
one = "one",
two = "two",
three = "three",
primaryDim = "primaryDim",
primaryDark = "primaryDark",
primaryInverted = "primaryInverted",
primaryStrong = "primaryStrong",
}

View File

@@ -0,0 +1,4 @@
export enum AvailabilityEnum {
Available = "Available",
NotAvailable = "NotAvailable",
}