feat: make sure correct data is sent to tracking
This commit is contained in:
committed by
Simon.Emanuelsson
parent
1a28bcdc4c
commit
e082bf2e50
@@ -15,6 +15,7 @@ import {
|
||||
type TrackingSDKPaymentInfo,
|
||||
} from "@/types/components/tracking"
|
||||
import { BreakfastPackageEnum } from "@/types/enums/breakfast"
|
||||
import { CurrencyEnum } from "@/types/enums/currency"
|
||||
import { RateEnum } from "@/types/enums/rate"
|
||||
import type { Room } from "@/types/stores/booking-confirmation"
|
||||
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
|
||||
@@ -38,13 +39,14 @@ function mapAncillaryPackage(
|
||||
ancillaryPackage: BookingConfirmation["booking"]["packages"][number],
|
||||
operaId: string
|
||||
) {
|
||||
const isPoints = ancillaryPackage.currency === CurrencyEnum.POINTS
|
||||
return {
|
||||
hotelid: operaId,
|
||||
productCategory: "", // TODO: Add category
|
||||
productId: ancillaryPackage.code,
|
||||
productName: ancillaryPackage.description,
|
||||
productPoints: ancillaryPackage.points,
|
||||
productPrice: ancillaryPackage.totalPrice,
|
||||
productPoints: isPoints ? ancillaryPackage.totalPrice : 0,
|
||||
productPrice: isPoints ? 0 : ancillaryPackage.totalPrice,
|
||||
productType:
|
||||
ancillaryPackage.code === BreakfastPackageEnum.REGULAR_BREAKFAST
|
||||
? "food"
|
||||
|
||||
Reference in New Issue
Block a user