@duffel/components 2.7.20 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +67 -0
- package/.eslintrc.js +47 -0
- package/.github/renovate.json +16 -0
- package/.github/workflows/autoapprove.yml +18 -0
- package/.github/workflows/release.yml +89 -0
- package/.husky/post-commit +4 -0
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -0
- package/.prettierignore +2 -0
- package/.storybook/Storyshots.test.js +3 -0
- package/.storybook/__snapshots__/Storyshots.test.js.snap +48318 -0
- package/.storybook/main.ts +33 -0
- package/.storybook/preview.tsx +28 -0
- package/.tool-versions +1 -0
- package/CONTRIBUTING.md +83 -0
- package/README.md +53 -15
- package/__mocks__/styleMock.js +6 -0
- package/babel.config.js +20 -0
- package/commitlint.config.js +4 -0
- package/config/esbuild.base.config.js +18 -0
- package/config/esbuild.cdn.config.js +51 -0
- package/config/esbuild.dev.config.js +46 -0
- package/config/esbuild.react.config.js +42 -0
- package/jest.config.ts +14 -0
- package/package.json +135 -193
- package/react-dist/components/DuffelAncillaries/Card.d.ts +14 -0
- package/react-dist/components/DuffelAncillaries/Counter.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/DuffelAncillaries.d.ts +3 -0
- package/react-dist/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionController.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +14 -0
- package/react-dist/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +9 -0
- package/react-dist/components/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +4 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +11 -0
- package/react-dist/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/Amenity.d.ts +6 -0
- package/react-dist/components/DuffelAncillaries/seats/DeckSelect.d.ts +15 -0
- package/react-dist/components/DuffelAncillaries/seats/Element.d.ts +15 -0
- package/react-dist/components/DuffelAncillaries/seats/EmptyElement.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/ExitElement.d.ts +6 -0
- package/react-dist/components/DuffelAncillaries/seats/Legend.d.ts +12 -0
- package/react-dist/components/DuffelAncillaries/seats/Row.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/RowSection.d.ts +17 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatElement.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatInfo.d.ts +7 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatMap.d.ts +12 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +2 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionCard.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModal.d.ts +13 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +4 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +16 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +10 -0
- package/react-dist/components/DuffelAncillaries/seats/SeatUnavailable.d.ts +5 -0
- package/react-dist/components/DuffelPayments/DuffelPayments.d.ts +11 -0
- package/react-dist/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +14 -0
- package/react-dist/components/shared/AnimatedLoaderEllipsis.d.ts +2 -0
- package/react-dist/components/shared/Button.d.ts +23 -0
- package/react-dist/components/shared/ErrorBoundary.d.ts +13 -0
- package/react-dist/components/shared/FetchOfferErrorState.d.ts +5 -0
- package/react-dist/components/shared/Icon.d.ts +44 -0
- package/react-dist/components/shared/IconButton.d.ts +16 -0
- package/react-dist/components/shared/Modal.d.ts +11 -0
- package/react-dist/components/shared/NonIdealState.d.ts +4 -0
- package/react-dist/components/shared/Stamp.d.ts +7 -0
- package/react-dist/components/shared/Tabs.d.ts +16 -0
- package/react-dist/custom-elements.d.ts +6 -0
- package/react-dist/custom-elements.js +37 -0
- package/react-dist/custom-elements.js.map +7 -0
- package/react-dist/index.d.ts +7 -0
- package/react-dist/index.js +37 -0
- package/react-dist/index.js.map +7 -0
- package/react-dist/lib/captureErrorInSentry.d.ts +1 -0
- package/react-dist/lib/compileCreateOrderPayload.d.ts +14 -0
- package/react-dist/lib/createPriceFormatters.d.ts +12 -0
- package/react-dist/lib/fetchFromDuffelAPI.d.ts +8 -0
- package/react-dist/lib/fetchFromFixtures.d.ts +4 -0
- package/react-dist/lib/formatAvailableServices.d.ts +12 -0
- package/react-dist/lib/formatDate.d.ts +2 -0
- package/react-dist/lib/formatSeatMaps.d.ts +4 -0
- package/react-dist/lib/getBaggageServiceDescription.d.ts +2 -0
- package/react-dist/lib/getCabinsForSegmentAndDeck.d.ts +2 -0
- package/react-dist/lib/getCurrencyForSeatMaps.d.ts +10 -0
- package/react-dist/lib/getCurrencyForServices.d.ts +11 -0
- package/react-dist/lib/getFirstSeatElementMatchingCriteria.d.ts +3 -0
- package/react-dist/lib/getPassengerBySegmentList.d.ts +6 -0
- package/react-dist/lib/getPassengerInitials.d.ts +1 -0
- package/react-dist/lib/getPassengerMapById.d.ts +3 -0
- package/react-dist/lib/getPassengerName.d.ts +3 -0
- package/react-dist/lib/getRowNumber.d.ts +2 -0
- package/react-dist/lib/getSegmentList.d.ts +2 -0
- package/react-dist/lib/getServicePriceMapById.d.ts +3 -0
- package/react-dist/lib/getSymbols.d.ts +2 -0
- package/react-dist/lib/getTotalAmountForServices.d.ts +6 -0
- package/react-dist/lib/getTotalQuantity.d.ts +2 -0
- package/react-dist/lib/hasService.d.ts +2 -0
- package/react-dist/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +3 -0
- package/react-dist/lib/hasWings.d.ts +2 -0
- package/react-dist/lib/isBaggageService.d.ts +2 -0
- package/react-dist/lib/isCancelForAnyReasonService.d.ts +2 -0
- package/react-dist/lib/isFixtureOfferId.d.ts +2 -0
- package/react-dist/lib/isPayloadComplete.d.ts +2 -0
- package/react-dist/lib/isSeatElement.d.ts +2 -0
- package/react-dist/lib/logging.d.ts +46 -0
- package/react-dist/lib/moneyStringFormatter.d.ts +8 -0
- package/react-dist/lib/offerIsExpired.d.ts +2 -0
- package/react-dist/lib/retrieveOffer.d.ts +2 -0
- package/react-dist/lib/retrieveOfferFromDuffelAPI.d.ts +1 -0
- package/react-dist/lib/retrieveSeatMaps.d.ts +2 -0
- package/react-dist/lib/retrieveSeatMapsFromDuffelAPI.d.ts +1 -0
- package/react-dist/lib/setBodyScrollability.d.ts +1 -0
- package/react-dist/lib/validateProps.d.ts +7 -0
- package/react-dist/lib/withPlural.d.ts +1 -0
- package/react-dist/types/Aircraft.d.ts +14 -0
- package/react-dist/types/Airline.d.ts +14 -0
- package/react-dist/types/Airport.d.ts +44 -0
- package/react-dist/types/City.d.ts +18 -0
- package/react-dist/types/CreateOrderPayload.d.ts +72 -0
- package/react-dist/types/CurrencyConversion.d.ts +10 -0
- package/react-dist/types/DuffelAncillariesProps.d.ts +70 -0
- package/react-dist/types/Offer.d.ts +711 -0
- package/react-dist/types/Order.d.ts +8 -0
- package/react-dist/types/Place.d.ts +8 -0
- package/react-dist/types/SeatMap.d.ts +190 -0
- package/react-dist/types/index.d.ts +11 -0
- package/scripts/generate-fixture.ts +200 -0
- package/scripts/upload-to-cdn.sh +34 -0
- package/scripts.tsconfig.json +11 -0
- package/src/components/DuffelAncillaries/Card.tsx +126 -0
- package/src/components/DuffelAncillaries/Counter.tsx +40 -0
- package/src/components/DuffelAncillaries/DuffelAncillaries.tsx +344 -0
- package/src/components/DuffelAncillaries/DuffelAncillariesCustomElement.tsx +124 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionCard.tsx +96 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionController.tsx +88 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModal.tsx +81 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBody.tsx +60 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.tsx +122 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.tsx +81 -0
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.tsx +76 -0
- package/src/components/DuffelAncillaries/bags/IncludedBaggageBanner.tsx +51 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.tsx +90 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.tsx +63 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.tsx +56 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.tsx +11 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.tsx +74 -0
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.tsx +9 -0
- package/src/components/DuffelAncillaries/seats/Amenity.tsx +21 -0
- package/src/components/DuffelAncillaries/seats/DeckSelect.tsx +27 -0
- package/src/components/DuffelAncillaries/seats/Element.tsx +52 -0
- package/src/components/DuffelAncillaries/seats/EmptyElement.tsx +5 -0
- package/src/components/DuffelAncillaries/seats/ExitElement.tsx +17 -0
- package/src/components/DuffelAncillaries/seats/Legend.tsx +60 -0
- package/src/components/DuffelAncillaries/seats/Row.tsx +47 -0
- package/src/components/DuffelAncillaries/seats/RowSection.tsx +78 -0
- package/src/components/DuffelAncillaries/seats/SeatElement.tsx +120 -0
- package/src/components/DuffelAncillaries/seats/SeatInfo.tsx +32 -0
- package/src/components/DuffelAncillaries/seats/SeatMap.tsx +81 -0
- package/src/components/DuffelAncillaries/seats/SeatMapUnavailable.tsx +21 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionCard.tsx +103 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModal.tsx +142 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalBody.tsx +13 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalFooter.tsx +82 -0
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalHeader.tsx +87 -0
- package/src/components/DuffelAncillaries/seats/SeatUnavailable.tsx +14 -0
- package/src/components/DuffelPayments/DuffelPayments.tsx +218 -0
- package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +130 -0
- package/src/components/shared/AnimatedLoaderEllipsis.tsx +5 -0
- package/src/components/shared/Button.tsx +63 -0
- package/src/components/shared/ErrorBoundary.tsx +54 -0
- package/src/components/shared/FetchOfferErrorState.tsx +35 -0
- package/src/components/shared/Icon.tsx +152 -0
- package/src/components/shared/IconButton.tsx +42 -0
- package/src/components/shared/Modal.tsx +40 -0
- package/src/components/shared/NonIdealState.tsx +28 -0
- package/src/components/shared/Stamp.tsx +29 -0
- package/src/components/shared/Tabs.tsx +36 -0
- package/src/custom-elements.ts +13 -0
- package/src/examples/client-side/README.md +30 -0
- package/src/examples/client-side/index.html +57 -0
- package/src/examples/full-stack/README.md +34 -0
- package/src/examples/full-stack/index.html +48 -0
- package/src/examples/full-stack/server.mjs +158 -0
- package/src/examples/just-typescript/README.md +37 -0
- package/src/examples/just-typescript/package.json +16 -0
- package/src/examples/just-typescript/src/index.html +23 -0
- package/src/examples/just-typescript/src/index.ts +36 -0
- package/src/examples/just-typescript/yarn.lock +154 -0
- package/src/examples/payments-custom-element/README.md +17 -0
- package/src/examples/payments-custom-element/index.html +43 -0
- package/src/examples/payments-just-typescript/README.md +37 -0
- package/src/examples/payments-just-typescript/package.json +16 -0
- package/src/examples/payments-just-typescript/src/index.html +23 -0
- package/src/examples/payments-just-typescript/src/index.ts +18 -0
- package/src/examples/payments-just-typescript/yarn.lock +154 -0
- package/src/examples/react-app/README.md +37 -0
- package/src/examples/react-app/package.json +20 -0
- package/src/examples/react-app/src/index.html +19 -0
- package/src/examples/react-app/src/index.tsx +48 -0
- package/src/examples/react-app/yarn.lock +219 -0
- package/src/fixtures/offers/off_0000AUde3KwTztSRK1cznH.json +497 -0
- package/src/fixtures/offers/off_0000AVx4lUFFKW8PsPeQeQ.json +307 -0
- package/src/fixtures/offers/off_1.json +497 -0
- package/src/fixtures/passengers/mock_passengers.ts +26 -0
- package/src/fixtures/seat-maps/off_0000AUde3KwTztSRK1cznH.json +6852 -0
- package/src/fixtures/seat-maps/off_0000AVx4lUFFKW8PsPeQeQ.json +1 -0
- package/src/fixtures/seat-maps/off_1.json +6852 -0
- package/src/index.ts +7 -0
- package/src/lib/captureErrorInSentry.ts +42 -0
- package/src/lib/compileCreateOrderPayload.ts +63 -0
- package/src/lib/createPriceFormatters.ts +73 -0
- package/src/lib/fetchFromDuffelAPI.ts +54 -0
- package/src/lib/fetchFromFixtures.ts +18 -0
- package/src/lib/formatAvailableServices.ts +91 -0
- package/src/lib/formatDate.ts +20 -0
- package/src/lib/formatSeatMaps.ts +81 -0
- package/src/lib/getBaggageServiceDescription.ts +42 -0
- package/src/lib/getCabinsForSegmentAndDeck.ts +4 -0
- package/src/lib/getCurrencyForSeatMaps.ts +22 -0
- package/src/lib/getCurrencyForServices.ts +24 -0
- package/src/lib/getFirstSeatElementMatchingCriteria.ts +22 -0
- package/src/lib/getPassengerBySegmentList.ts +10 -0
- package/src/lib/getPassengerInitials.ts +6 -0
- package/src/lib/getPassengerMapById.ts +17 -0
- package/src/lib/getPassengerName.ts +37 -0
- package/src/lib/getRowNumber.ts +16 -0
- package/src/lib/getSegmentList.ts +7 -0
- package/src/lib/getServicePriceMapById.ts +20 -0
- package/src/lib/getSymbols.ts +22 -0
- package/src/lib/getTotalAmountForServices.ts +72 -0
- package/src/lib/getTotalQuantity.ts +5 -0
- package/src/lib/hasService.ts +24 -0
- package/src/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.ts +35 -0
- package/src/lib/hasWings.ts +8 -0
- package/src/lib/isBaggageService.ts +8 -0
- package/src/lib/isCancelForAnyReasonService.ts +9 -0
- package/src/lib/isFixtureOfferId.ts +4 -0
- package/src/lib/isPayloadComplete.ts +11 -0
- package/src/lib/isSeatElement.ts +10 -0
- package/src/lib/logging.ts +120 -0
- package/src/lib/moneyStringFormatter.ts +34 -0
- package/src/lib/offerIsExpired.ts +5 -0
- package/src/lib/retrieveOffer.ts +54 -0
- package/src/lib/retrieveOfferFromDuffelAPI.ts +13 -0
- package/src/lib/retrieveSeatMaps.ts +55 -0
- package/src/lib/retrieveSeatMapsFromDuffelAPI.ts +13 -0
- package/src/lib/setBodyScrollability.ts +7 -0
- package/src/lib/validateProps.ts +37 -0
- package/src/lib/withPlural.ts +8 -0
- package/src/stories/BaggageSelectionModalHeader.stories.tsx +21 -0
- package/src/stories/Button.stories.tsx +69 -0
- package/src/stories/DuffelAncillaries.stories.tsx +126 -0
- package/src/stories/DuffelPayments.stories.tsx +34 -0
- package/src/stories/Icon.stories.tsx +35 -0
- package/src/stories/IconButton.stories.tsx +25 -0
- package/src/styles/colors.css +22 -0
- package/src/styles/components/Amenity.css +23 -0
- package/src/styles/components/BaggageDisplay.css +25 -0
- package/src/styles/components/Button.css +161 -0
- package/src/styles/components/Card.css +52 -0
- package/src/styles/components/CfarSelectionModal.css +34 -0
- package/src/styles/components/Counter.css +18 -0
- package/src/styles/components/DuffelPayments.css +42 -0
- package/src/styles/components/IconButton.css +63 -0
- package/src/styles/components/Legend.css +58 -0
- package/src/styles/components/Loader.css +37 -0
- package/src/styles/components/LoadingState.css +81 -0
- package/src/styles/components/Modal.css +84 -0
- package/src/styles/components/PassengerSelect.css +93 -0
- package/src/styles/components/PassengersLayout.css +90 -0
- package/src/styles/components/Row.css +70 -0
- package/src/styles/components/Seat.css +57 -0
- package/src/styles/components/SeatInfo.css +61 -0
- package/src/styles/components/SeatMap.css +24 -0
- package/src/styles/components/SeatSelect.css +92 -0
- package/src/styles/components/Segment.css +17 -0
- package/src/styles/components/SelectionSegment.css +10 -0
- package/src/styles/components/Summary.css +70 -0
- package/src/styles/components/Tabs.css +49 -0
- package/src/styles/flex.css +5 -0
- package/src/styles/font-families.css +47 -0
- package/src/styles/global.css +51 -0
- package/src/styles/margin.css +3 -0
- package/src/styles/spacing.css +18 -0
- package/src/styles/transitions.css +3 -0
- package/src/styles/typography.css +13 -0
- package/src/tests/components/DuffelAncillaries.test.tsx +342 -0
- package/src/tests/lib/createPriceFormatters.test.tsx +152 -0
- package/src/tests/lib/formatAvailableServices.test.tsx +79 -0
- package/src/tests/lib/formatSeatMaps.test.tsx +49 -0
- package/src/tests/lib/getCurrencyForServices.test.tsx +44 -0
- package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +86 -0
- package/src/tests/lib/logging.test.tsx +32 -0
- package/src/tests/lib/moneyStringFormatter.test.tsx +12 -0
- package/src/tests/lib/validateProps.test.tsx +57 -0
- package/src/types/Aircraft.ts +16 -0
- package/src/types/Airline.ts +16 -0
- package/src/types/Airport.ts +54 -0
- package/src/types/City.ts +21 -0
- package/src/types/CreateOrderPayload.ts +99 -0
- package/src/types/CurrencyConversion.ts +10 -0
- package/src/types/DuffelAncillariesProps.ts +108 -0
- package/src/types/Offer.ts +851 -0
- package/src/types/Order.ts +6 -0
- package/src/types/Place.ts +6 -0
- package/src/types/SeatMap.ts +231 -0
- package/src/types/index.ts +11 -0
- package/tsconfig.json +52 -0
- package/LICENSE +0 -21
- package/dist/AdditionalBaggage.esm.js +0 -1
- package/dist/AdditionalBaggage.js +0 -1
- package/dist/AdditionalBaggage.min.css +0 -408
- package/dist/AdditionalBaggage.umd.min.js +0 -2
- package/dist/AdditionalBaggage.umd.min.js.LICENSE.txt +0 -60
- package/dist/AdditionalBaggageSelection.esm.js +0 -1
- package/dist/AdditionalBaggageSelection.js +0 -1
- package/dist/AdditionalBaggageSelection.min.css +0 -744
- package/dist/AdditionalBaggageSelection.umd.min.js +0 -2
- package/dist/AdditionalBaggageSelection.umd.min.js.LICENSE.txt +0 -93
- package/dist/CardPayment.esm.js +0 -2
- package/dist/CardPayment.esm.js.LICENSE.txt +0 -6
- package/dist/CardPayment.js +0 -2
- package/dist/CardPayment.js.LICENSE.txt +0 -6
- package/dist/CardPayment.min.css +0 -233
- package/dist/CardPayment.umd.min.js +0 -2
- package/dist/CardPayment.umd.min.js.LICENSE.txt +0 -61
- package/dist/SeatSelection.esm.js +0 -1
- package/dist/SeatSelection.js +0 -1
- package/dist/SeatSelection.min.css +0 -1127
- package/dist/SeatSelection.umd.min.js +0 -2
- package/dist/SeatSelection.umd.min.js.LICENSE.txt +0 -60
- package/dist/duffel-components.d.ts +0 -1614
- package/dist/duffel-components.esm.js +0 -2
- package/dist/duffel-components.esm.js.LICENSE.txt +0 -6
- package/dist/duffel-components.js +0 -2
- package/dist/duffel-components.js.LICENSE.txt +0 -6
- package/dist/duffel-components.min.css +0 -1280
- package/dist/duffel-components.umd.min.js +0 -2
- package/dist/duffel-components.umd.min.js.LICENSE.txt +0 -102
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { hasServiceOfSameMetadataTypeAlreadyBeenSelected } from "../../lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected";
|
|
2
|
+
import { CreateOrderPayloadService } from "../../types/CreateOrderPayload";
|
|
3
|
+
import { OfferAvailableBaggageService } from "../../types/Offer";
|
|
4
|
+
|
|
5
|
+
const availableService: OfferAvailableBaggageService = {
|
|
6
|
+
id: "available_service_id",
|
|
7
|
+
metadata: { type: "checked" },
|
|
8
|
+
// using as any because we don't need to test the whole type
|
|
9
|
+
} as any;
|
|
10
|
+
|
|
11
|
+
const selectedService: CreateOrderPayloadService = {
|
|
12
|
+
id: "selected_service_id",
|
|
13
|
+
serviceInformation: {
|
|
14
|
+
segmentId: "segment_id",
|
|
15
|
+
passengerId: "passenger_id",
|
|
16
|
+
type: "checked",
|
|
17
|
+
},
|
|
18
|
+
} as any;
|
|
19
|
+
|
|
20
|
+
describe("hasServiceOfSameMetadataTypeAlreadyBeenSelected", () => {
|
|
21
|
+
it("Should return false if no services selected", () => {
|
|
22
|
+
expect(
|
|
23
|
+
hasServiceOfSameMetadataTypeAlreadyBeenSelected(
|
|
24
|
+
[],
|
|
25
|
+
"segment_id",
|
|
26
|
+
"passenger_id",
|
|
27
|
+
availableService
|
|
28
|
+
)
|
|
29
|
+
).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("Should return false if service selected is the availableService we are checking", () => {
|
|
33
|
+
expect(
|
|
34
|
+
hasServiceOfSameMetadataTypeAlreadyBeenSelected(
|
|
35
|
+
[{ ...selectedService, id: availableService.id }],
|
|
36
|
+
"segment_id",
|
|
37
|
+
"passenger_id",
|
|
38
|
+
availableService
|
|
39
|
+
)
|
|
40
|
+
).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("Should return false if service selected are for different passenger", () => {
|
|
44
|
+
expect(
|
|
45
|
+
hasServiceOfSameMetadataTypeAlreadyBeenSelected(
|
|
46
|
+
[selectedService],
|
|
47
|
+
"segment_id",
|
|
48
|
+
"passenger_id_wont_match",
|
|
49
|
+
availableService
|
|
50
|
+
)
|
|
51
|
+
).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("Should return false if service selected are for different segment", () => {
|
|
55
|
+
expect(
|
|
56
|
+
hasServiceOfSameMetadataTypeAlreadyBeenSelected(
|
|
57
|
+
[selectedService],
|
|
58
|
+
"segment_id_wont_match",
|
|
59
|
+
"passenger_id",
|
|
60
|
+
availableService
|
|
61
|
+
)
|
|
62
|
+
).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("Should return false if service selected is of different type", () => {
|
|
66
|
+
expect(
|
|
67
|
+
hasServiceOfSameMetadataTypeAlreadyBeenSelected(
|
|
68
|
+
[selectedService],
|
|
69
|
+
"segment_id",
|
|
70
|
+
"passenger_id",
|
|
71
|
+
{ ...availableService, metadata: { type: "carry_on" } } as any
|
|
72
|
+
)
|
|
73
|
+
).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("Should return true if service selected is of same type for same passenger and segment", () => {
|
|
77
|
+
expect(
|
|
78
|
+
hasServiceOfSameMetadataTypeAlreadyBeenSelected(
|
|
79
|
+
[selectedService],
|
|
80
|
+
"segment_id",
|
|
81
|
+
"passenger_id",
|
|
82
|
+
availableService
|
|
83
|
+
)
|
|
84
|
+
).toBe(true);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { initializeLogger, log, logGroup } from "../../lib/logging";
|
|
2
|
+
|
|
3
|
+
const consoleSpies = {
|
|
4
|
+
log: jest.spyOn(console, "info"),
|
|
5
|
+
groupCollapsed: jest.spyOn(console, "groupCollapsed"),
|
|
6
|
+
groupEnd: jest.spyOn(console, "groupEnd"),
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
describe("logging", () => {
|
|
10
|
+
it("should return functions that do nothing when debugMode is false", () => {
|
|
11
|
+
initializeLogger(false);
|
|
12
|
+
log("This should not be logged");
|
|
13
|
+
expect(consoleSpies.log).not.toHaveBeenCalled();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("should return functions that log a message when debugMode is true", () => {
|
|
17
|
+
initializeLogger(true);
|
|
18
|
+
log("This should be logged");
|
|
19
|
+
|
|
20
|
+
// Once because initializeLogger was initialised on the test above
|
|
21
|
+
// And so, the initialisation message would not show up twice.
|
|
22
|
+
expect(consoleSpies.log).toHaveBeenCalledTimes(1);
|
|
23
|
+
|
|
24
|
+
logGroup("This should be logged", ["one", "two"]);
|
|
25
|
+
expect(consoleSpies.groupCollapsed).toHaveBeenCalledTimes(1);
|
|
26
|
+
expect(consoleSpies.groupEnd).toHaveBeenCalledTimes(1);
|
|
27
|
+
|
|
28
|
+
// once for the call to `log` above and then
|
|
29
|
+
// twice for the array passed to logGroup
|
|
30
|
+
expect(consoleSpies.log).toHaveBeenCalledTimes(3);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { moneyStringFormatter } from "../../lib/moneyStringFormatter";
|
|
2
|
+
|
|
3
|
+
describe("moneyStringFormatter", () => {
|
|
4
|
+
it("should format known currencies correctly", () => {
|
|
5
|
+
expect(moneyStringFormatter("GBP")(10.23)).toEqual("£10.23");
|
|
6
|
+
});
|
|
7
|
+
it("should fall back to value + currency for unknown currencies", () => {
|
|
8
|
+
expect(moneyStringFormatter("Duffel house points")(10.23)).toEqual(
|
|
9
|
+
"10.23 Duffel house points"
|
|
10
|
+
);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
/**
|
|
3
|
+
* In this file, we want to allow usage of @ts-ignore so
|
|
4
|
+
* that we can test functions with invalid props.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { hasCommonRequiredProps } from "../../lib/validateProps";
|
|
8
|
+
import { Ancillaries } from "../../types/DuffelAncillariesProps";
|
|
9
|
+
|
|
10
|
+
describe("hasCommonRequiredProps", () => {
|
|
11
|
+
it("should pass when all required props are provided", () => {
|
|
12
|
+
const props = {
|
|
13
|
+
onPayloadReady: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function
|
|
14
|
+
passengers: [],
|
|
15
|
+
services: ["bags"] as Ancillaries[],
|
|
16
|
+
offer_id: "offer_id",
|
|
17
|
+
client_key: "client_key",
|
|
18
|
+
};
|
|
19
|
+
expect(hasCommonRequiredProps(props)).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("should fail when services is missing", () => {
|
|
23
|
+
const props = {
|
|
24
|
+
onPayloadReady: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function
|
|
25
|
+
passengers: [],
|
|
26
|
+
offer_id: "offer_id",
|
|
27
|
+
client_key: "client_key",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
expect(hasCommonRequiredProps(props)).toBeFalsy();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("should fail when onPayloadReady is missing", () => {
|
|
35
|
+
const props = {
|
|
36
|
+
passengers: [],
|
|
37
|
+
services: ["bags"] as Ancillaries[],
|
|
38
|
+
offer_id: "offer_id",
|
|
39
|
+
client_key: "client_key",
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
expect(hasCommonRequiredProps(props)).toBeFalsy();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("should fail when passengers is missing", () => {
|
|
47
|
+
const props = {
|
|
48
|
+
onPayloadReady: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function
|
|
49
|
+
services: ["bags"] as Ancillaries[],
|
|
50
|
+
offer_id: "offer_id",
|
|
51
|
+
client_key: "client_key",
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
expect(hasCommonRequiredProps(props)).toBeFalsy();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Aircraft {
|
|
2
|
+
/**
|
|
3
|
+
* The three-character IATA code for the aircraft
|
|
4
|
+
*/
|
|
5
|
+
iata_code: string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Duffel's unique identifier for the aircraft
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The name of the aircraft
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Airline {
|
|
2
|
+
/**
|
|
3
|
+
* The two-character IATA code for the airline. This may be null for non-IATA carriers.
|
|
4
|
+
*/
|
|
5
|
+
iata_code: string | null;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Duffel's unique identifier for the airline
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The name of the airline
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { City } from "./City";
|
|
2
|
+
|
|
3
|
+
export interface Airport {
|
|
4
|
+
/**
|
|
5
|
+
* The three-character IATA code for the airport
|
|
6
|
+
*/
|
|
7
|
+
iata_code: string | null;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Duffel's unique identifier for the airport
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The name of the airport
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The ISO 3166-1 alpha-2 code for the country where the airport is located
|
|
21
|
+
*/
|
|
22
|
+
iata_country_code: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The latitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -90° and 90°
|
|
26
|
+
*/
|
|
27
|
+
latitude: number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The longitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -180° and 180°
|
|
31
|
+
*/
|
|
32
|
+
longitude: number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The four-character ICAO code for the airport
|
|
36
|
+
*/
|
|
37
|
+
icao_code: string | null;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The time zone of the airport, specified by name from the [tz database](https://en.wikipedia.org/wiki/Tz_database)
|
|
41
|
+
*/
|
|
42
|
+
time_zone: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The name of the city (or cities separated by a `/`) where the airport is located
|
|
46
|
+
*/
|
|
47
|
+
city_name: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The metropolitan area where the airport is located.
|
|
51
|
+
* Only present for airports which are registered with IATA as belonging to a metropolitan area.
|
|
52
|
+
*/
|
|
53
|
+
city: City;
|
|
54
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface City {
|
|
2
|
+
/**
|
|
3
|
+
* The three-character IATA code for the city
|
|
4
|
+
*/
|
|
5
|
+
iata_code: string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Duffel's unique identifier for the city
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The ISO 3166-1 alpha-2 code for the country where the city is located
|
|
14
|
+
*/
|
|
15
|
+
iata_country_code: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The name of the city
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Offer,
|
|
3
|
+
OfferAvailableCancelForAnyReasonServiceMetadata,
|
|
4
|
+
OfferAvailableServiceBaggageMetadata,
|
|
5
|
+
} from "./Offer";
|
|
6
|
+
|
|
7
|
+
export interface CreateOrderPayload {
|
|
8
|
+
selected_offers: Array<Offer["id"]>;
|
|
9
|
+
passengers: CreateOrderPayloadPassengers;
|
|
10
|
+
services: CreateOrderPayloadServices;
|
|
11
|
+
payments: Array<CreateOrderPayloadPayment>;
|
|
12
|
+
type: "instant";
|
|
13
|
+
metadata: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CreateOrderPayloadPassenger {
|
|
17
|
+
id: string;
|
|
18
|
+
given_name: string;
|
|
19
|
+
family_name: string;
|
|
20
|
+
gender: string;
|
|
21
|
+
title: string;
|
|
22
|
+
born_on: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
phone_number?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type CreateOrderPayloadPassengers = Array<CreateOrderPayloadPassenger>;
|
|
28
|
+
|
|
29
|
+
export type CreateOrderPayloadPaymentType = "balance";
|
|
30
|
+
|
|
31
|
+
export interface CreateOrderPayloadPayment {
|
|
32
|
+
type: CreateOrderPayloadPaymentType;
|
|
33
|
+
amount: string;
|
|
34
|
+
currency: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type CreateOrderPayloadServices = CreateOrderPayloadService[];
|
|
38
|
+
|
|
39
|
+
export interface CreateOrderPayloadService {
|
|
40
|
+
id: string;
|
|
41
|
+
quantity: number;
|
|
42
|
+
|
|
43
|
+
/** `serviceInformation` is meant for:
|
|
44
|
+
* 1. internal use within the Duffel Ancillaries component, so it is convenient to augument selected services with data about it.
|
|
45
|
+
* 2. When `onPayloadReady` is ready, we'll return selected bags and seat services along with the `serviceInformation` to allow consumer to enrich their price breakdown.
|
|
46
|
+
*
|
|
47
|
+
* Note: `serviceInformation` is not known by the Duffel API.
|
|
48
|
+
*/
|
|
49
|
+
serviceInformation?: CreateOrderPayloadServiceInformation;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CreateOrderPayloadSeatService {
|
|
53
|
+
id: string;
|
|
54
|
+
quantity: number;
|
|
55
|
+
|
|
56
|
+
/** `serviceInformation` is meant for:
|
|
57
|
+
* 1. internal use within the Duffel Ancillaries component, so it is convenient to augument selected services with data about it.
|
|
58
|
+
* 2. When `onPayloadReady` is ready, we'll return selected bags and seat services along with the `serviceInformation` to allow consumer to enrich their price breakdown.
|
|
59
|
+
*
|
|
60
|
+
* Note: `serviceInformation` is not known by the Duffel API.
|
|
61
|
+
*/
|
|
62
|
+
serviceInformation?: CreateOrderPayloadServiceInformationForSeats;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type CreateOrderPayloadServiceInformation =
|
|
66
|
+
| CreateOrderPayloadServiceInformationForSeats
|
|
67
|
+
| CreateOrderPayloadServiceInformationForBags
|
|
68
|
+
| CreateOrderPayloadServiceInformationForCancelForAnyReason;
|
|
69
|
+
|
|
70
|
+
interface CreateOrderPayloadCommonServiceInformation {
|
|
71
|
+
segmentId: string;
|
|
72
|
+
passengerId: string;
|
|
73
|
+
passengerName: string;
|
|
74
|
+
total_amount: string;
|
|
75
|
+
total_currency: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface CreateOrderPayloadServiceInformationForSeats
|
|
79
|
+
extends CreateOrderPayloadCommonServiceInformation {
|
|
80
|
+
type: "seat";
|
|
81
|
+
designator: string;
|
|
82
|
+
disclosures: string[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type CreateOrderPayloadServiceInformationForBags =
|
|
86
|
+
CreateOrderPayloadCommonServiceInformation &
|
|
87
|
+
OfferAvailableServiceBaggageMetadata;
|
|
88
|
+
|
|
89
|
+
export type CreateOrderPayloadServiceInformationForCancelForAnyReason = {
|
|
90
|
+
type: "cancel_for_any_reason";
|
|
91
|
+
} & Pick<
|
|
92
|
+
CreateOrderPayloadCommonServiceInformation,
|
|
93
|
+
/**
|
|
94
|
+
* only using `total_amount` and `total_currency` from `CreateOrderPayloadCommonServiceInformation`
|
|
95
|
+
* because the cancel for any reason service applies to the whole order, not a specific segment or passenger
|
|
96
|
+
*/
|
|
97
|
+
"total_amount" | "total_currency"
|
|
98
|
+
> &
|
|
99
|
+
OfferAvailableCancelForAnyReasonServiceMetadata;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateOrderPayload,
|
|
3
|
+
CreateOrderPayloadServices,
|
|
4
|
+
} from "./CreateOrderPayload";
|
|
5
|
+
import {
|
|
6
|
+
Offer,
|
|
7
|
+
OfferAvailableServiceBaggage,
|
|
8
|
+
OfferAvailableServiceCancelForAnyReason,
|
|
9
|
+
} from "./Offer";
|
|
10
|
+
import { SeatMap, SeatMapCabinRowSectionAvailableService } from "./SeatMap";
|
|
11
|
+
|
|
12
|
+
export type DuffelAncillariesProps =
|
|
13
|
+
| DuffelAncillariesPropsWithOfferIdForFixture
|
|
14
|
+
| DuffelAncillariesPropsWithClientKeyAndOfferId
|
|
15
|
+
| DuffelAncillariesPropWithOfferAndClientKey
|
|
16
|
+
| DuffelAncillariesPropsWithOffersAndSeatMaps;
|
|
17
|
+
|
|
18
|
+
export interface DuffelAncillariesCommonProps {
|
|
19
|
+
styles?: CustomStyles;
|
|
20
|
+
onPayloadReady: OnPayloadReady;
|
|
21
|
+
passengers: CreateOrderPayload["passengers"];
|
|
22
|
+
services: Ancillaries[];
|
|
23
|
+
markup?: DuffelAncillariesMarkup;
|
|
24
|
+
priceFormatters?: DuffelAncillariesPriceFormatters;
|
|
25
|
+
debug?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface DuffelAncillariesPropsWithOfferIdForFixture
|
|
29
|
+
extends DuffelAncillariesCommonProps {
|
|
30
|
+
offer_id: `fixture_${string}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface DuffelAncillariesPropsWithClientKeyAndOfferId
|
|
34
|
+
extends DuffelAncillariesCommonProps {
|
|
35
|
+
offer_id: string;
|
|
36
|
+
client_key: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DuffelAncillariesPropWithOfferAndClientKey
|
|
40
|
+
extends DuffelAncillariesCommonProps {
|
|
41
|
+
offer: Offer;
|
|
42
|
+
client_key: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface DuffelAncillariesPropsWithOffersAndSeatMaps
|
|
46
|
+
extends DuffelAncillariesCommonProps {
|
|
47
|
+
offer: Offer;
|
|
48
|
+
seat_maps: SeatMap[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type DuffelAncillariesMarkupDefinition = {
|
|
52
|
+
rate: number;
|
|
53
|
+
amount: number;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export interface DuffelAncillariesMarkup {
|
|
57
|
+
bags?: DuffelAncillariesMarkupDefinition;
|
|
58
|
+
seats?: DuffelAncillariesMarkupDefinition;
|
|
59
|
+
cancel_for_any_reason?: DuffelAncillariesMarkupDefinition;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type DuffelAncillariesPriceFormatterForBags = (
|
|
63
|
+
amount: number,
|
|
64
|
+
currency: string,
|
|
65
|
+
service: OfferAvailableServiceBaggage
|
|
66
|
+
) => { amount: number; currency?: string };
|
|
67
|
+
|
|
68
|
+
export type DuffelAncillariesPriceFormatterForSeats = (
|
|
69
|
+
amount: number,
|
|
70
|
+
currency: string,
|
|
71
|
+
service: SeatMapCabinRowSectionAvailableService
|
|
72
|
+
) => { amount: number; currency?: string };
|
|
73
|
+
|
|
74
|
+
export type DuffelAncillariesPriceFormatterForCancelForAnyReason = (
|
|
75
|
+
amount: number,
|
|
76
|
+
currency: string,
|
|
77
|
+
service: OfferAvailableServiceCancelForAnyReason
|
|
78
|
+
) => { amount: number; currency?: string };
|
|
79
|
+
|
|
80
|
+
export interface DuffelAncillariesPriceFormatters {
|
|
81
|
+
bags?: DuffelAncillariesPriceFormatterForBags;
|
|
82
|
+
seats?: DuffelAncillariesPriceFormatterForSeats;
|
|
83
|
+
cancel_for_any_reason?: DuffelAncillariesPriceFormatterForCancelForAnyReason;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface CustomStyles {
|
|
87
|
+
accentColor?: string;
|
|
88
|
+
buttonCornerRadius?: string;
|
|
89
|
+
fontFamily?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type OnPayloadReady = (
|
|
93
|
+
data: CreateOrderPayload,
|
|
94
|
+
metadata: OnPayloadReadyMetadata
|
|
95
|
+
) => void;
|
|
96
|
+
|
|
97
|
+
export interface OnPayloadReadyMetadata {
|
|
98
|
+
offer_total_amount: Offer["total_amount"];
|
|
99
|
+
offer_total_currency: Offer["total_currency"];
|
|
100
|
+
offer_tax_amount: Offer["tax_amount"];
|
|
101
|
+
offer_tax_currency: Offer["tax_currency"];
|
|
102
|
+
|
|
103
|
+
baggage_services: CreateOrderPayloadServices;
|
|
104
|
+
seat_services: CreateOrderPayloadServices;
|
|
105
|
+
cancel_for_any_reason_services: CreateOrderPayloadServices;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type Ancillaries = "bags" | "seats" | "cancel_for_any_reason";
|