Merged in fix/SW-2438-change-to-breakfast-buffet-remove-dash (pull request #1918)
fix(SW-2438): change to breakfast buffet always and replace dash with empty string * fix(SW-2438): change to breakfast buffet always and replace dash with empty string * fix(SW-2438): remove none from ageOfChildren Approved-by: Tobias Johansson Approved-by: Matilda Landström
This commit is contained in:
@@ -46,9 +46,9 @@ export function getTracking(
|
||||
? undefined
|
||||
: storedRooms
|
||||
.map((r) => {
|
||||
if (r.room.breakfast === undefined) return "-"
|
||||
if (r.room.breakfast === undefined) return ""
|
||||
if (!r.room.breakfast) return "no breakfast"
|
||||
return r.room.breakfast.description
|
||||
return "breakfast buffet"
|
||||
})
|
||||
.join("|")
|
||||
|
||||
@@ -63,14 +63,12 @@ export function getTracking(
|
||||
}
|
||||
const hotelsTrackingData: TrackingSDKHotelInfo = {
|
||||
ageOfChildren: booking.rooms
|
||||
.map(
|
||||
(room) => room.childrenInRoom?.map((kid) => kid.age).join(",") ?? "-"
|
||||
)
|
||||
.map((room) => room.childrenInRoom?.map((kid) => kid.age).join(",") ?? "")
|
||||
.join("|"),
|
||||
analyticsRateCode: rooms.map((room) => room.rate).join("|"),
|
||||
arrivalDate: format(arrivalDate, "yyyy-MM-dd"),
|
||||
bedType: storedRooms
|
||||
.map((r) => (r.room.bedType ? r.room.bedType.description : "-"))
|
||||
.map((r) => (r.room.bedType ? r.room.bedType.description : ""))
|
||||
.join("|"),
|
||||
// Comma separated booking code values in "code,code,n/a" format for multiroom and "code" or "n/a" for singleroom
|
||||
// n/a is used whenever code is Not applicable as defined by Tracking team
|
||||
@@ -90,7 +88,7 @@ export function getTracking(
|
||||
(room) =>
|
||||
room.childrenInRoom
|
||||
?.map((kid) => ChildBedMapEnum[kid.bed])
|
||||
.join(",") ?? "-"
|
||||
.join(",") ?? ""
|
||||
)
|
||||
.join("|"),
|
||||
country: hotel?.address.country,
|
||||
@@ -149,7 +147,7 @@ export function getTracking(
|
||||
} else if ("voucher" in room.roomRate) {
|
||||
return room.roomRate.voucher.rateCode
|
||||
}
|
||||
return "-"
|
||||
return ""
|
||||
})
|
||||
.join("|"),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user