Merged in feat/sw-1688-list-breakfast (pull request #1615)
Feat/sw-1688 list breakfast Approved-by: Pontus Dreij
This commit is contained in:
@@ -9,6 +9,7 @@ import { dt } from "@/lib/dt"
|
||||
import {
|
||||
getAncillaryPackages,
|
||||
getBookingConfirmation,
|
||||
getPackages,
|
||||
getProfileSafely,
|
||||
getSavedPaymentCardsSafely,
|
||||
} from "@/lib/trpc/memoizedRequests"
|
||||
@@ -33,6 +34,8 @@ import Rooms from "./Rooms"
|
||||
|
||||
import styles from "./myStay.module.css"
|
||||
|
||||
import { BreakfastPackageEnum } from "@/types/enums/breakfast"
|
||||
|
||||
export async function MyStay({ refId }: { refId: string }) {
|
||||
const value = decrypt(refId)
|
||||
if (!value) {
|
||||
@@ -58,6 +61,21 @@ export async function MyStay({ refId }: { refId: string }) {
|
||||
hotelId: hotel.operaId,
|
||||
toDate: dt(booking.checkOutDate).format("YYYY-MM-DD"),
|
||||
})
|
||||
|
||||
const packages = await getPackages({
|
||||
startDate: dt(booking.checkInDate).format("YYYY-MM-DD"),
|
||||
hotelId: hotel.operaId,
|
||||
endDate: dt(booking.checkOutDate).format("YYYY-MM-DD"),
|
||||
adults: booking.adults,
|
||||
children: booking.childrenAges.length,
|
||||
packageCodes: [
|
||||
BreakfastPackageEnum.ANCILLARY_REGULAR_BREAKFAST,
|
||||
BreakfastPackageEnum.ANCILLARY_CHILD_PAYING_BREAKFAST,
|
||||
BreakfastPackageEnum.FREE_CHILD_BREAKFAST,
|
||||
],
|
||||
lang,
|
||||
})
|
||||
|
||||
const supportedCards = hotel.merchantInformationData.cards
|
||||
const savedCreditCards = await getSavedPaymentCardsSafely({
|
||||
supportedCards,
|
||||
@@ -97,6 +115,7 @@ export async function MyStay({ refId }: { refId: string }) {
|
||||
<Ancillaries
|
||||
ancillaries={ancillaryPackages}
|
||||
booking={booking}
|
||||
packages={packages}
|
||||
user={user}
|
||||
savedCreditCards={savedCreditCards}
|
||||
refId={refId}
|
||||
|
||||
Reference in New Issue
Block a user