fix: booking confirmation validation

This commit is contained in:
Christel Westerberg
2024-11-01 10:24:56 +01:00
parent cdc5652347
commit 644ce369aa
5 changed files with 145 additions and 118 deletions

View File

@@ -45,8 +45,8 @@ export default async function BookingConfirmationPage({
}
)
const fromDate = dt(booking.temp.fromDate).locale(params.lang)
const toDate = dt(booking.temp.toDate).locale(params.lang)
const fromDate = dt(booking.checkInDate).locale(params.lang)
const toDate = dt(booking.checkOutDate).locale(params.lang)
const nights = intl.formatMessage(
{ id: "booking.nights" },
{
@@ -77,7 +77,7 @@ export default async function BookingConfirmationPage({
textTransform="regular"
type="h1"
>
{booking.hotel.name}
{booking.hotel?.data.attributes.name}
</Title>
</hgroup>
<Body className={styles.body} textAlign="center">
@@ -91,7 +91,7 @@ export default async function BookingConfirmationPage({
<Subtitle color="burgundy" type="two">
{intl.formatMessage(
{ id: "Reference #{bookingNr}" },
{ bookingNr: "A92320VV" }
{ bookingNr: booking.confirmationNumber }
)}
</Subtitle>
</header>
@@ -183,11 +183,13 @@ export default async function BookingConfirmationPage({
</Caption>
<div>
<Body color="burgundy" textTransform="bold">
{booking.hotel.name}
{booking.hotel?.data.attributes.name}
</Body>
<Body color="uiTextHighContrast">{booking.hotel.email}</Body>
<Body color="uiTextHighContrast">
{booking.hotel.phoneNumber}
{booking.hotel?.data.attributes.contactInformation.email}
</Body>
<Body color="uiTextHighContrast">
{booking.hotel?.data.attributes.contactInformation.phoneNumber}
</Body>
</div>
</div>
@@ -219,7 +221,16 @@ export default async function BookingConfirmationPage({
<Body color="burgundy" textTransform="bold">
{intl.formatMessage({ id: "Total cost" })}
</Body>
<Body color="uiTextHighContrast">{booking.temp.total}</Body>
<Body color="uiTextHighContrast">
{" "}
{intl.formatMessage(
{ id: "{amount} {currency}" },
{
amount: intl.formatNumber(booking.totalPrice),
currency: booking.currencyCode,
}
)}
</Body>
<Caption color="uiTextPlaceholder">
{`${intl.formatMessage({ id: "Approx." })} ${booking.temp.totalInEuro}`}
</Caption>