Merged in fix/STAY-135 (pull request #3368)

Fix/STAY-135 & STAY-127

* fix: make quantity and delivery separate steps in mobile

* fix: update design for delivery step in ancillary flow

* fix: add error state for missing time

* fix: only allow points or cash payment for ancillaries

* fix: break out stepper to design system

* fix: update design of select quantity step in add ancillaries flow

* fix: add error states for quantity

* fix: handle insufficient points case

* fix: update stepper to include optional disabledMessage tooltip

* fix: handle validations

* fix: change name to camel case


Approved-by: Bianca Widstam
Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
Christel Westerberg
2025-12-18 13:31:43 +00:00
parent 2c8b920dd8
commit 6b08d5a113
54 changed files with 1498 additions and 872 deletions

View File

@@ -1,10 +1,14 @@
import { logger } from "@scandic-hotels/common/logger"
import {
type AncillaryFormData,
PaymentChoiceEnum,
} from "@/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/schema"
import type {
Ancillary,
SelectedAncillary,
} from "@/types/components/myPages/myStay/ancillaries"
import type { AncillaryFormData } from "@/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/schema"
import type { BreakfastData } from "@/stores/my-stay/add-ancillary-flow"
export const generateDeliveryOptions = () => {
@@ -22,18 +26,21 @@ export function buildAncillaryPackages(
) {
const packages = []
if (ancillary?.id && data.quantityWithCard) {
if (ancillary?.id && data.paymentChoice === PaymentChoiceEnum.Card) {
packages.push({
code: ancillary.id,
quantity: data.quantityWithCard,
quantity: data.quantity,
comment: data.optionalText || undefined,
})
}
if (ancillary?.loyaltyCode && data.quantityWithPoints) {
if (
ancillary?.loyaltyCode &&
data.paymentChoice === PaymentChoiceEnum.Points
) {
packages.push({
code: ancillary.loyaltyCode,
quantity: data.quantityWithPoints,
quantity: data.quantity,
comment: data.optionalText || undefined,
})
}