feat: SW-1583 Implemented Reward nights on city search

This commit is contained in:
Hrishikesh Vaipurkar
2025-03-03 16:39:10 +01:00
parent 51b70f3032
commit 5058180c41
25 changed files with 176 additions and 12 deletions

View File

@@ -36,8 +36,9 @@ const hotelFacilitiesFilterNames = [
export async function fetchAvailableHotels(
input: AvailabilityInput
): Promise<NullableHotelData[]> {
const availableHotels =
await serverClient().hotel.availability.hotelsByCity(input)
const availableHotels = input.redemption
? await serverClient().hotel.availability.hotelsByCityWithRedemption(input)
: await serverClient().hotel.availability.hotelsByCity(input)
if (!availableHotels) return []

View File

@@ -28,6 +28,7 @@ interface HotelSearchDetails<T> {
childrenInRoomString?: string
childrenInRoom?: Child[]
bookingCode?: string
redemption?: boolean
}
export async function getHotelSearchDetails<
@@ -105,5 +106,6 @@ export async function getHotelSearchDetails<
childrenInRoomString,
childrenInRoom,
bookingCode: selectHotelParams.bookingCode ?? undefined,
redemption: selectHotelParams.searchType === "redemption",
}
}

View File

@@ -117,7 +117,7 @@ export async function GET(
/** Record<string, any> is next-auth typings */
const params: Record<string, any> = {
ui_locales: context.params.lang,
scope: ["openid", "profile", "booking", "profile_link"],
scope: ["openid", "profile", "booking", "profile_link", "availability"],
/**
* The `acr_values` param is used to make Curity display the proper login
* page for Scandic. Without the parameter Curity presents some choices

View File

@@ -65,7 +65,13 @@ export async function GET(
},
{
ui_locales: context.params.lang,
scope: ["openid", "profile"].join(" "),
scope: [
"openid",
"profile",
"booking",
"availability",
"profile_link",
].join(" "),
loginKey: loginKey,
for_origin: publicURL,
acr_values: "urn:com:scandichotels:scandic-email",