@lookiero/checkout 14.3.0 → 14.4.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.
Files changed (61) hide show
  1. package/dist/fake-dependencies/@lookiero/payments-front/index.js +1 -1
  2. package/dist/src/ExpoRoot.js +2 -2
  3. package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +3 -2
  4. package/dist/src/infrastructure/projection/pricing/pricing.mock.js +28 -1
  5. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +1 -1
  6. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +1 -1
  7. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +3 -4
  8. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +0 -3
  9. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +0 -3
  10. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -5
  11. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +1 -2
  12. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +2 -3
  13. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -3
  14. package/dist/src/projection/pricing/pricing.d.ts +25 -1
  15. package/dist/src/projection/pricing/pricing.js +12 -1
  16. package/dist/src/version.d.ts +2 -2
  17. package/dist/src/version.js +2 -2
  18. package/fake-dependencies/@lookiero/payments-front/index.tsx +1 -1
  19. package/package.json +6 -4
  20. package/src/ExpoRoot.tsx +2 -2
  21. package/src/domain/checkout/model/checkouts.ts +6 -4
  22. package/src/domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem.ts +1 -2
  23. package/src/domain/checkoutBooking/event/createToastNotificationWhenCheckoutBookingExpired.ts +1 -2
  24. package/src/domain/checkoutBooking/model/checkoutBookings.ts +6 -4
  25. package/src/domain/checkoutFeedback/model/checkoutFeedbacks.ts +6 -4
  26. package/src/domain/checkoutItem/event/createModalNotificationWhenCheckoutItemReplaced.ts +1 -2
  27. package/src/domain/checkoutItem/model/checkoutItems.ts +6 -4
  28. package/src/infrastructure/delivery/mock/dataSourceCheckoutBookings.ts +1 -2
  29. package/src/infrastructure/delivery/mock/dataSourceCheckoutFeedbacks.ts +1 -2
  30. package/src/infrastructure/delivery/mock/dataSourceCheckoutItems.ts +1 -2
  31. package/src/infrastructure/domain/checkout/react/useStartCheckout.test.ts +1 -5
  32. package/src/infrastructure/domain/checkout/react/useSubmitCheckout.test.ts +1 -5
  33. package/src/infrastructure/domain/checkoutFeedback/model/httpCheckoutFeedbacks.ts +1 -2
  34. package/src/infrastructure/domain/checkoutFeedback/react/useGiveCheckoutFeedback.test.ts +1 -5
  35. package/src/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.test.ts +1 -5
  36. package/src/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.test.ts +1 -5
  37. package/src/infrastructure/domain/checkoutItem/react/useResetCheckoutItem.test.ts +1 -5
  38. package/src/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.test.ts +1 -5
  39. package/src/infrastructure/projection/pricing/pricing.mock.ts +34 -2
  40. package/src/infrastructure/tracking/tracking.ts +4 -2
  41. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +1 -1
  42. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +1 -1
  43. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +0 -3
  44. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +3 -4
  45. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +102 -144
  46. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +8 -9
  47. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +102 -233
  48. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +1 -2
  49. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +30 -69
  50. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +2 -3
  51. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -3
  52. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +62 -144
  53. package/src/projection/bookedProductsVariants/viewBookedProductVariantsForCheckoutItem.ts +2 -1
  54. package/src/projection/checkout/viewFirstAvailableCheckoutByCustomerId.ts +1 -2
  55. package/src/projection/checkout/viewFiveItemsDiscountByCustomerId.ts +1 -2
  56. package/src/projection/checkout/viewIsCheckoutEnabledByCustomerId.ts +1 -2
  57. package/src/projection/checkout/viewIsSizeChangeEnabledByCheckoutId.ts +1 -2
  58. package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.ts +2 -1
  59. package/src/projection/payment/viewPaymentFlowPayloadByCheckoutId.ts +1 -2
  60. package/src/projection/pricing/pricing.ts +29 -1
  61. package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.ts +1 -2
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention */
2
2
  import React, { forwardRef, useImperativeHandle, } from "react";
3
- import { Button } from "@lookiero/aurora";
3
+ import { Button } from "@lookiero/sty-psp-ui";
4
4
  let startLegacyBoxCheckoutListener;
5
5
  const setPaymentsBridge = () => void 0;
6
6
  const PaymentsQueryProvider = ({ children }) => children;
@@ -20,7 +20,7 @@ const tradename = Tradename.LOOKIERO;
20
20
  const theme = themeByTradename({ tradename });
21
21
  const locale = Locale.es_ES;
22
22
  const customer = {
23
- customerId: "5bf90313-d56e-4a55-b422-16084a4466de",
23
+ customerId: "ec091fb1-04f3-46da-8262-aab5c88e0b3a",
24
24
  country: Country.ES,
25
25
  segment: Segment.WOMEN,
26
26
  email: "email@example.com",
@@ -41,7 +41,7 @@ const apiUrl = Platform.OS !== "web"
41
41
  ? "/local-to-dev"
42
42
  : "http://localhost:3004/local-to-dev"
43
43
  : "/checkout/api";
44
- const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIyMDgzMTMsImV4cCI6MTc3MDQ1NzEzMCwiZGlzcGxheU5hbWUiOiJtYWlsLmRlditCRlUtLTIwMzc0MjExMTYiLCJjb3VudHJ5X2NvZGUiOiJOTCIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0xMC0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiIwMDA0YTA0OS1mZWY2LTRiYWMtYTQ1ZC1iM2E5MDRiNGVlNGIiLCJ0cmFkZW5hbWUiOiJMT09LSUVSTyIsImlhdCI6MTc2Nzc3ODczMH0.5x6bj95AAh2c4zoQaR5AMrTO6xAkW73KHyYbFKnYzD8";
44
+ const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEzNzIyNDE2LCJleHAiOjE3NzE4NzQ4OTgsImRpc3BsYXlOYW1lIjoibWFpbC5kZXYrdGRwLjUzYWI2MmI5LTQwYTYtNDkwOC1iMGM0LWM3ZDRiNDZhODU2N0Bsb29raWVyby5jb20iLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwidHJhZGVuYW1lIjoiTE9PS0lFUk8iLCJ1dWlkIjoiZWMwOTFmYjEtMDRmMy00NmRhLTgyNjItYWFiNWM4OGUwYjNhIiwiaWF0IjoxNzcxODQ2MDk4fQ.UKFl9pA4d1t9uR2iGVMc6XuwPbfUI_XWEbovie-Z_RI";
45
45
  const getAuthToken = () => Promise.resolve(authToken);
46
46
  const useRedirect = () => ({
47
47
  returnUrl: "https://web2.dev.aws.lookiero.es/user/",
@@ -1,4 +1,4 @@
1
- import { PricingProjection } from "../../../projection/pricing/pricing";
1
+ import { CheckoutPricingProjection, PricingProjection } from "../../../projection/pricing/pricing";
2
2
  interface PricingFunctionArgs {
3
3
  readonly paidWithPromocode: boolean;
4
4
  }
@@ -6,4 +6,5 @@ interface PricingFunction {
6
6
  (args?: PricingFunctionArgs): PricingProjection;
7
7
  }
8
8
  declare const pricing: PricingFunction;
9
- export { pricing };
9
+ declare const mockCheckoutPricingProjection: CheckoutPricingProjection;
10
+ export { pricing, mockCheckoutPricingProjection };
@@ -1,4 +1,5 @@
1
1
  import { Currency } from "@lookiero/sty-psp-locale";
2
+ import { CheckoutPrincingContext, CheckoutPrincingType, } from "../../../projection/pricing/pricing";
2
3
  const pricing = ({ paidWithPromocode } = { paidWithPromocode: false }) => ({
3
4
  orderTotal: {
4
5
  amount: 18301,
@@ -39,4 +40,30 @@ const pricing = ({ paidWithPromocode } = { paidWithPromocode: false }) => ({
39
40
  paidWithPromocode,
40
41
  },
41
42
  });
42
- export { pricing };
43
+ const mockCheckoutPricingProjection = {
44
+ currency: Currency.EUR,
45
+ final: 12127,
46
+ original: 21195,
47
+ modifiers: [
48
+ {
49
+ amount: 7068,
50
+ percentage: 35,
51
+ type: CheckoutPrincingType.DISCOUNT,
52
+ context: CheckoutPrincingContext.PROMOCODE,
53
+ translationKey: "summary.discount",
54
+ },
55
+ {
56
+ amount: 1000,
57
+ type: CheckoutPrincingType.DISCOUNT,
58
+ context: CheckoutPrincingContext.BALANCE,
59
+ translationKey: "summary.credit",
60
+ },
61
+ {
62
+ amount: 1000,
63
+ type: CheckoutPrincingType.DISCOUNT,
64
+ context: CheckoutPrincingContext.PS_FEE,
65
+ translationKey: "summary.fee",
66
+ },
67
+ ],
68
+ };
69
+ export { pricing, mockCheckoutPricingProjection };
@@ -74,7 +74,7 @@ const useCheckoutFlow = ({ checkout: checkoutProjection, getAuthToken, onSuccess
74
74
  const onPaymentError = useCallback((payload) => {
75
75
  setStartLegacyBoxCheckoutStatus("error");
76
76
  createNotification({
77
- bodyI18nKey: payload.metadata?.toaster?.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
77
+ bodyI18nKey: payload.metadata?.translation || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
78
78
  level: NotificationLevel.ERROR,
79
79
  });
80
80
  }, [createNotification]);
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useMemo } from "react";
2
2
  import { View } from "react-native";
3
- import { Button } from "@lookiero/aurora";
4
3
  import { useI18nMessage } from "@lookiero/i18n-react";
4
+ import { Button } from "@lookiero/sty-psp-ui";
5
5
  import { CheckoutFeedbackQuestionType } from "../../../../../../projection/checkoutFeedback/checkoutFeedback.constants";
6
6
  import { CheckoutQuestions } from "../../../../components/organisms/checkoutQuestions/CheckoutQuestions";
7
7
  import { useCheckoutQuestionFeedback } from "../../../../components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionFeedback";
@@ -1,8 +1,7 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { View } from "react-native";
3
- import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
4
3
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { Modal, Text } from "@lookiero/sty-psp-ui";
4
+ import { Button, Modal, Text } from "@lookiero/sty-psp-ui";
6
5
  import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
7
6
  import { style as getOutOfCheckoutModalStyle } from "./GetOutOfCheckoutModal.style";
8
7
  const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
@@ -21,9 +20,9 @@ const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
21
20
  React.createElement(View, { style: style.modalContent },
22
21
  React.createElement(Text, { level: 1, style: style.title }, titleText),
23
22
  React.createElement(Text, { level: 3, style: style.description }, descriptionText),
24
- React.createElement(Button, { style: style.button, onPress: onDismiss },
23
+ React.createElement(Button, { onPress: onDismiss },
25
24
  React.createElement(Text, { level: 3, selectable: false, style: [style.buttonText, { textTransform: "uppercase" }], variant: "action" }, dismissButtonText)),
26
- React.createElement(Button, { style: [style.button, style.confirmButton], variant: BUTTON_VARIANT.SECONDARY, onPress: onConfirm },
25
+ React.createElement(Button, { style: { button: style.confirmButton }, variant: "secondary", onPress: onConfirm },
27
26
  React.createElement(Text, { level: 3, selectable: false, style: [style.buttonText, { textTransform: "uppercase" }], variant: "action" }, confirmButtonText)))));
28
27
  };
29
28
  export { GetOutOfCheckoutModal };
@@ -1,7 +1,4 @@
1
1
  declare const style: () => {
2
- button: {
3
- flex: number;
4
- };
5
2
  buttonText: {
6
3
  textAlign: "center";
7
4
  width: "100%";
@@ -3,9 +3,6 @@ import { theme } from "@lookiero/sty-psp-ui";
3
3
  const style = () => {
4
4
  const { space6, space8 } = theme();
5
5
  return StyleSheet.create({
6
- button: {
7
- flex: 0,
8
- },
9
6
  buttonText: {
10
7
  textAlign: "center",
11
8
  width: "100%",
@@ -1,8 +1,7 @@
1
1
  import React, { useCallback, useMemo, useState } from "react";
2
2
  import { View } from "react-native";
3
- import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
4
3
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { Sticky } from "@lookiero/sty-psp-ui";
4
+ import { Button, Sticky } from "@lookiero/sty-psp-ui";
6
5
  import { size } from "../../../../../../projection/size/size";
7
6
  import { Body } from "../../../../components/layouts/body/Body";
8
7
  import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
@@ -32,9 +31,9 @@ const ItemActions = ({ productVariants, currentProductVariant, country, onShowSi
32
31
  return (React.createElement(Sticky, { style: style.sticky, onLayout: onLayout },
33
32
  React.createElement(Body, { style: { row: style.row } },
34
33
  React.createElement(View, { style: style.actionsRow },
35
- !currentProductVariant.size.unique && productVariants ? (React.createElement(Button, { style: style.sizeSelector, testID: "size-selector", variant: BUTTON_VARIANT.SECONDARY, small: true, onPress: handleOnPressSelectField }, changeSizeButtonText)) : null,
36
- React.createElement(Button, { style: style.returnButton, testID: "return-button", variant: BUTTON_VARIANT.SECONDARY, small: true, onPress: onReturn }, returnButtonText)),
37
- React.createElement(Button, { testID: "keep-button", small: true, onPress: onKeep }, keepButtonText)),
34
+ !currentProductVariant.size.unique && productVariants ? (React.createElement(Button, { size: "small", style: { button: style.sizeSelector }, testID: "size-selector", variant: "secondary", onPress: handleOnPressSelectField }, changeSizeButtonText)) : null,
35
+ React.createElement(Button, { size: "small", style: { button: style.returnButton }, testID: "return-button", variant: "secondary", onPress: onReturn }, returnButtonText)),
36
+ React.createElement(Button, { size: "small", testID: "keep-button", onPress: onKeep }, keepButtonText)),
38
37
  React.createElement(SelectModal, { modalVisible: modalVisible, options: sizeSelectorOptions, portalHostName: "Checkout", testID: "select-field-modal", title: changeSizeButtonText, value: currentProductVariant.id, onChange: onReplace, onClose: handleOnModalClose })));
39
38
  };
40
39
  export { ItemActions };
@@ -1,8 +1,7 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { View } from "react-native";
3
- import { Button } from "@lookiero/aurora";
4
3
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { Modal, Text } from "@lookiero/sty-psp-ui";
4
+ import { Button, Modal, Text } from "@lookiero/sty-psp-ui";
6
5
  import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
7
6
  import { style as sizeWithoutStockModalStyle } from "./SizeWithoutStockModal.style";
8
7
  const SizeWithoutStockModal = ({ visible, onDismiss }) => {
@@ -3,12 +3,11 @@ import React, { useCallback, useMemo } from "react";
3
3
  import { Platform, View } from "react-native";
4
4
  import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
5
5
  import { generatePath, useNavigate } from "react-router-native";
6
- import { Box, Button, Layout as AuroraLayout, Spinner } from "@lookiero/aurora";
6
+ import { Box, Layout as AuroraLayout, Spinner } from "@lookiero/aurora";
7
7
  import { useI18nMessage } from "@lookiero/i18n-react";
8
8
  import { CommandStatus } from "@lookiero/messaging-react";
9
9
  import { useLogger } from "@lookiero/sty-psp-logging";
10
- import { Text } from "@lookiero/sty-psp-ui";
11
- import { useScreenSize } from "@lookiero/sty-psp-ui";
10
+ import { Button, Text, useScreenSize } from "@lookiero/sty-psp-ui";
12
11
  import { Tradename } from "@lookiero/sty-sp-tradename";
13
12
  import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
14
13
  import { useReturnCheckoutItem } from "../../../../../domain/checkoutItem/react/useReturnCheckoutItem";
@@ -1,9 +1,8 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { Pressable, View } from "react-native";
3
3
  import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
4
- import { Button } from "@lookiero/aurora";
5
4
  import { useI18nMessage } from "@lookiero/i18n-react";
6
- import { Icon, Text } from "@lookiero/sty-psp-ui";
5
+ import { Button, Icon, Text } from "@lookiero/sty-psp-ui";
7
6
  import { Price } from "../../../../components/atoms/price/Price";
8
7
  import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
9
8
  import { Pricing } from "../pricing/Pricing";
@@ -33,7 +32,7 @@ const CollapsiblePricing = ({ migrated, tradename, pricing, totalCheckoutItemsKe
33
32
  totalCheckoutItemsKeptText),
34
33
  React.createElement(Price, { price: pendingToPay, variant: "detail" })),
35
34
  React.createElement(View, { style: style.collapsedContent },
36
- React.createElement(Button, { testID: "submit-checkout-collpased-button", small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(Animated.View, { key: "not-collapsed", style: notCollapsedAnimatedStyle },
35
+ React.createElement(Button, { size: "small", testID: "submit-checkout-collpased-button", onPress: onSubmit }, submitButtonText)))) : (React.createElement(Animated.View, { key: "not-collapsed", style: notCollapsedAnimatedStyle },
37
36
  React.createElement(Pricing, { migrated: migrated, pricing: pricing, totalCheckoutItemsKept: totalCheckoutItemsKept, tradename: tradename }),
38
37
  React.createElement(Button, { testID: "submit-checkout-button", onPress: onSubmit }, submitButtonText)))));
39
38
  };
@@ -1,3 +1,4 @@
1
+ import { Currency } from "@lookiero/sty-psp-locale";
1
2
  import { PriceProjection } from "../price/price";
2
3
  interface ServiceProjection {
3
4
  readonly discount: PriceProjection;
@@ -16,4 +17,27 @@ interface PricingProjection {
16
17
  readonly service: ServiceProjection;
17
18
  readonly subtotal: PriceProjection;
18
19
  }
19
- export type { PricingProjection, ServiceProjection };
20
+ declare enum Type {
21
+ DISCOUNT = "DISCOUNT",
22
+ CHARGE = "CHARGE"
23
+ }
24
+ declare enum Context {
25
+ PS_FEE = "PS_FEE",
26
+ PROMOCODE = "PROMOCODE",
27
+ BALANCE = "BALANCE"
28
+ }
29
+ interface Modify {
30
+ readonly amount: number;
31
+ readonly percentage?: number;
32
+ readonly type: Type;
33
+ readonly context: Context;
34
+ readonly translationKey: string;
35
+ }
36
+ interface CheckoutPricingProjection {
37
+ readonly currency: Currency;
38
+ readonly final: number;
39
+ readonly original: number;
40
+ readonly modifiers: Modify[];
41
+ }
42
+ export type { PricingProjection, ServiceProjection, CheckoutPricingProjection };
43
+ export { Type as CheckoutPrincingType, Context as CheckoutPrincingContext };
@@ -1 +1,12 @@
1
- export {};
1
+ var Type;
2
+ (function (Type) {
3
+ Type["DISCOUNT"] = "DISCOUNT";
4
+ Type["CHARGE"] = "CHARGE";
5
+ })(Type || (Type = {}));
6
+ var Context;
7
+ (function (Context) {
8
+ Context["PS_FEE"] = "PS_FEE";
9
+ Context["PROMOCODE"] = "PROMOCODE";
10
+ Context["BALANCE"] = "BALANCE";
11
+ })(Context || (Context = {}));
12
+ export { Type as CheckoutPrincingType, Context as CheckoutPrincingContext };
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "14.3.0";
2
- export declare const RELEASE = "checkout@14.3.0";
1
+ export declare const VERSION = "14.4.0";
2
+ export declare const RELEASE = "checkout@14.4.0";
@@ -1,2 +1,2 @@
1
- export const VERSION = "14.3.0";
2
- export const RELEASE = "checkout@14.3.0";
1
+ export const VERSION = "14.4.0";
2
+ export const RELEASE = "checkout@14.4.0";
@@ -7,8 +7,8 @@ import React, {
7
7
  RefAttributes,
8
8
  useImperativeHandle,
9
9
  } from "react";
10
- import { Button } from "@lookiero/aurora";
11
10
  import { PaymentPayload } from "@lookiero/payments-front";
11
+ import { Button } from "@lookiero/sty-psp-ui";
12
12
 
13
13
  let startLegacyBoxCheckoutListener: ({ success }: { success: boolean }) => void;
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "14.3.0",
3
+ "version": "14.4.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -28,12 +28,12 @@
28
28
  "@lookiero/sty-psp-i18n": "^2.0",
29
29
  "@lookiero/sty-psp-locale": "^2.1",
30
30
  "@lookiero/sty-psp-logging": "^2.2",
31
- "@lookiero/sty-psp-notifications": "^2.17",
31
+ "@lookiero/sty-psp-notifications": "^2.18",
32
32
  "@lookiero/sty-psp-react-native": "^2.0",
33
33
  "@lookiero/sty-psp-segment": "^0.1",
34
34
  "@lookiero/sty-psp-storage": "^1.1",
35
35
  "@lookiero/sty-psp-tracking": "^2.4",
36
- "@lookiero/sty-psp-ui": "^3.6",
36
+ "@lookiero/sty-psp-ui": "^3.7",
37
37
  "@lookiero/sty-psp-ui-settings": "^1.6",
38
38
  "@lookiero/sty-psp-units": "^0.1",
39
39
  "@lookiero/sty-psp-uuid": "^0.2",
@@ -69,7 +69,9 @@
69
69
  "react-native-gesture-handler": "~2.24.0",
70
70
  "react-native-get-random-values": "~1.11.0",
71
71
  "react-native-reanimated": "~3.17.4",
72
- "react-native-safe-area-context": "5.4.0"
72
+ "react-native-safe-area-context": "5.4.0",
73
+ "react-router-dom": "6.30.3",
74
+ "react-router-native": "6.30.3"
73
75
  },
74
76
  "peerDependencies": {
75
77
  "@gorhom/portal": ">=1.0",
package/src/ExpoRoot.tsx CHANGED
@@ -25,7 +25,7 @@ const theme = themeByTradename({ tradename });
25
25
  const locale: Locale = Locale.es_ES;
26
26
 
27
27
  const customer: Customer = {
28
- customerId: "5bf90313-d56e-4a55-b422-16084a4466de",
28
+ customerId: "ec091fb1-04f3-46da-8262-aab5c88e0b3a",
29
29
  country: Country.ES,
30
30
  segment: Segment.WOMEN,
31
31
  email: "email@example.com",
@@ -50,7 +50,7 @@ const apiUrl =
50
50
  : "http://localhost:3004/local-to-dev"
51
51
  : "/checkout/api";
52
52
  const authToken =
53
- "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIyMDgzMTMsImV4cCI6MTc3MDQ1NzEzMCwiZGlzcGxheU5hbWUiOiJtYWlsLmRlditCRlUtLTIwMzc0MjExMTYiLCJjb3VudHJ5X2NvZGUiOiJOTCIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0xMC0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiIwMDA0YTA0OS1mZWY2LTRiYWMtYTQ1ZC1iM2E5MDRiNGVlNGIiLCJ0cmFkZW5hbWUiOiJMT09LSUVSTyIsImlhdCI6MTc2Nzc3ODczMH0.5x6bj95AAh2c4zoQaR5AMrTO6xAkW73KHyYbFKnYzD8";
53
+ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEzNzIyNDE2LCJleHAiOjE3NzE4NzQ4OTgsImRpc3BsYXlOYW1lIjoibWFpbC5kZXYrdGRwLjUzYWI2MmI5LTQwYTYtNDkwOC1iMGM0LWM3ZDRiNDZhODU2N0Bsb29raWVyby5jb20iLCJjb3VudHJ5X2NvZGUiOiJFUyIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwidHJhZGVuYW1lIjoiTE9PS0lFUk8iLCJ1dWlkIjoiZWMwOTFmYjEtMDRmMy00NmRhLTgyNjItYWFiNWM4OGUwYjNhIiwiaWF0IjoxNzcxODQ2MDk4fQ.UKFl9pA4d1t9uR2iGVMc6XuwPbfUI_XWEbovie-Z_RI";
54
54
  const getAuthToken = () => Promise.resolve(authToken);
55
55
 
56
56
  const useRedirect: () => Record<string, string> = () => ({
@@ -6,10 +6,12 @@ import {
6
6
  } from "@lookiero/messaging";
7
7
  import { Checkout } from "./checkout";
8
8
 
9
- interface CheckoutsGetFunction<CheckoutsGetFunctionArgs extends RepositoryGetFunctionArgs>
10
- extends RepositoryGetFunction<Checkout, CheckoutsGetFunctionArgs> {}
9
+ interface CheckoutsGetFunction<
10
+ CheckoutsGetFunctionArgs extends RepositoryGetFunctionArgs,
11
+ > extends RepositoryGetFunction<Checkout, CheckoutsGetFunctionArgs> {}
11
12
 
12
- interface CheckoutsSaveFunction<CheckoutsSaveFunctionArgs extends RepositorySaveFunctionArgs>
13
- extends RepositorySaveFunction<Checkout, CheckoutsSaveFunctionArgs> {}
13
+ interface CheckoutsSaveFunction<
14
+ CheckoutsSaveFunctionArgs extends RepositorySaveFunctionArgs,
15
+ > extends RepositorySaveFunction<Checkout, CheckoutsSaveFunctionArgs> {}
14
16
 
15
17
  export type { CheckoutsGetFunction, CheckoutsSaveFunction };
@@ -8,8 +8,7 @@ interface BookCheckoutBookingForCheckoutItemPayload {
8
8
  }
9
9
 
10
10
  interface BookCheckoutBookingForCheckoutItem
11
- extends Command<typeof BOOK_CHECKOUT_BOOKING_FOR_CHECKOUT_ITEM>,
12
- BookCheckoutBookingForCheckoutItemPayload {}
11
+ extends Command<typeof BOOK_CHECKOUT_BOOKING_FOR_CHECKOUT_ITEM>, BookCheckoutBookingForCheckoutItemPayload {}
13
12
 
14
13
  interface BookCheckoutBookingForCheckoutItemFunction {
15
14
  (payload: BookCheckoutBookingForCheckoutItemPayload): BookCheckoutBookingForCheckoutItem;
@@ -5,8 +5,7 @@ import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
5
5
 
6
6
  const CHECKOUT_BOOKING_EXPIRED_NOTIFICATION_ID = "d423934e-2499-46ab-8cfb-39e1e398237e";
7
7
 
8
- interface CreateToastNotificationWhenCheckoutBookingExpiredFunction
9
- extends ProcessManagerFunction<CheckoutBookingExpired> {}
8
+ interface CreateToastNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {}
10
9
 
11
10
  const createToastNotificationWhenCheckoutBookingExpired: CreateToastNotificationWhenCheckoutBookingExpiredFunction =
12
11
  ({ commandBus }) =>
@@ -6,10 +6,12 @@ import {
6
6
  } from "@lookiero/messaging";
7
7
  import { CheckoutBooking } from "./checkoutBooking";
8
8
 
9
- interface CheckoutBookingsGetFunction<CheckoutBookingsGetFunctionArgs extends RepositoryGetFunctionArgs>
10
- extends RepositoryGetFunction<CheckoutBooking, CheckoutBookingsGetFunctionArgs> {}
9
+ interface CheckoutBookingsGetFunction<
10
+ CheckoutBookingsGetFunctionArgs extends RepositoryGetFunctionArgs,
11
+ > extends RepositoryGetFunction<CheckoutBooking, CheckoutBookingsGetFunctionArgs> {}
11
12
 
12
- interface CheckoutBookingsSaveFunction<CheckoutBookingsSaveFunctionArgs extends RepositorySaveFunctionArgs>
13
- extends RepositorySaveFunction<CheckoutBooking, CheckoutBookingsSaveFunctionArgs> {}
13
+ interface CheckoutBookingsSaveFunction<
14
+ CheckoutBookingsSaveFunctionArgs extends RepositorySaveFunctionArgs,
15
+ > extends RepositorySaveFunction<CheckoutBooking, CheckoutBookingsSaveFunctionArgs> {}
14
16
 
15
17
  export type { CheckoutBookingsGetFunction, CheckoutBookingsSaveFunction };
@@ -6,10 +6,12 @@ import {
6
6
  } from "@lookiero/messaging";
7
7
  import { CheckoutFeedback } from "./checkoutFeedback";
8
8
 
9
- interface CheckoutFeedbacksGetFunction<CheckoutFeedbacksGetFunctionArgs extends RepositoryGetFunctionArgs>
10
- extends RepositoryGetFunction<CheckoutFeedback, CheckoutFeedbacksGetFunctionArgs> {}
9
+ interface CheckoutFeedbacksGetFunction<
10
+ CheckoutFeedbacksGetFunctionArgs extends RepositoryGetFunctionArgs,
11
+ > extends RepositoryGetFunction<CheckoutFeedback, CheckoutFeedbacksGetFunctionArgs> {}
11
12
 
12
- interface CheckoutFeedbacksSaveFunction<CheckoutFeedbacksSaveFunctionArgs extends RepositorySaveFunctionArgs>
13
- extends RepositorySaveFunction<CheckoutFeedback, CheckoutFeedbacksSaveFunctionArgs> {}
13
+ interface CheckoutFeedbacksSaveFunction<
14
+ CheckoutFeedbacksSaveFunctionArgs extends RepositorySaveFunctionArgs,
15
+ > extends RepositorySaveFunction<CheckoutFeedback, CheckoutFeedbacksSaveFunctionArgs> {}
14
16
 
15
17
  export type { CheckoutFeedbacksGetFunction, CheckoutFeedbacksSaveFunction };
@@ -5,8 +5,7 @@ import { CheckoutItemReplaced } from "../model/checkoutItemReplaced";
5
5
 
6
6
  const SIZE_CHANGE_NOTIFICATION_ID = "ce89b8b2-e025-4b54-8cdc-52520dc3dd23";
7
7
 
8
- interface CreateModalNotificationWhenCheckoutItemReplacedFunction
9
- extends ProcessManagerFunction<CheckoutItemReplaced> {}
8
+ interface CreateModalNotificationWhenCheckoutItemReplacedFunction extends ProcessManagerFunction<CheckoutItemReplaced> {}
10
9
 
11
10
  const createModalNotificationWhenCheckoutItemReplaced: CreateModalNotificationWhenCheckoutItemReplacedFunction =
12
11
  ({ commandBus }) =>
@@ -6,10 +6,12 @@ import {
6
6
  } from "@lookiero/messaging";
7
7
  import { CheckoutItem } from "./checkoutItem";
8
8
 
9
- interface CheckoutItemsGetFunction<CheckoutItemsGetFunctionArgs extends RepositoryGetFunctionArgs>
10
- extends RepositoryGetFunction<CheckoutItem, CheckoutItemsGetFunctionArgs> {}
9
+ interface CheckoutItemsGetFunction<
10
+ CheckoutItemsGetFunctionArgs extends RepositoryGetFunctionArgs,
11
+ > extends RepositoryGetFunction<CheckoutItem, CheckoutItemsGetFunctionArgs> {}
11
12
 
12
- interface CheckoutItemsSaveFunction<CheckoutItemsSaveFunctionArgs extends RepositorySaveFunctionArgs>
13
- extends RepositorySaveFunction<CheckoutItem, CheckoutItemsSaveFunctionArgs> {}
13
+ interface CheckoutItemsSaveFunction<
14
+ CheckoutItemsSaveFunctionArgs extends RepositorySaveFunctionArgs,
15
+ > extends RepositorySaveFunction<CheckoutItem, CheckoutItemsSaveFunctionArgs> {}
14
16
 
15
17
  export type { CheckoutItemsGetFunction, CheckoutItemsSaveFunction };
@@ -48,8 +48,7 @@ interface DataSourceCheckoutItemsSaveFunctionArgs extends RepositorySaveFunction
48
48
  readonly dataSource: CheckoutBookingDataSource;
49
49
  }
50
50
 
51
- interface DataSourceCheckoutItemsSaveFunction
52
- extends CheckoutBookingsSaveFunction<DataSourceCheckoutItemsSaveFunctionArgs> {}
51
+ interface DataSourceCheckoutItemsSaveFunction extends CheckoutBookingsSaveFunction<DataSourceCheckoutItemsSaveFunctionArgs> {}
53
52
 
54
53
  const saveCheckoutBooking: DataSourceCheckoutItemsSaveFunction =
55
54
  ({ dataSource }) =>
@@ -19,8 +19,7 @@ interface DataSourceCheckoutItemsSaveFunctionArgs extends RepositorySaveFunction
19
19
  readonly dataSource: CheckoutFeedbackDataSource;
20
20
  }
21
21
 
22
- interface DataSourceCheckoutItemsSaveFunction
23
- extends CheckoutFeedbacksSaveFunction<DataSourceCheckoutItemsSaveFunctionArgs> {}
22
+ interface DataSourceCheckoutItemsSaveFunction extends CheckoutFeedbacksSaveFunction<DataSourceCheckoutItemsSaveFunctionArgs> {}
24
23
 
25
24
  const saveCheckoutFeedback: DataSourceCheckoutItemsSaveFunction =
26
25
  ({ dataSource }) =>
@@ -49,8 +49,7 @@ interface DataSourceCheckoutItemsSaveFunctionArgs extends RepositorySaveFunction
49
49
  readonly dataSource: CheckoutDataSource;
50
50
  }
51
51
 
52
- interface DataSourceCheckoutItemsSaveFunction
53
- extends CheckoutItemsSaveFunction<DataSourceCheckoutItemsSaveFunctionArgs> {}
52
+ interface DataSourceCheckoutItemsSaveFunction extends CheckoutItemsSaveFunction<DataSourceCheckoutItemsSaveFunctionArgs> {}
54
53
 
55
54
  const saveCheckoutItem: DataSourceCheckoutItemsSaveFunction =
56
55
  ({ dataSource }) =>
@@ -24,11 +24,7 @@ const saveMock = jest.fn();
24
24
  const save = jest.fn(() => saveMock);
25
25
  const mockStartCheckoutHandler = jest.fn();
26
26
  const { Component: Messaging } = bootstrap({ id: MESSAGING_CONTEXT_ID })
27
- .command(
28
- START_CHECKOUT,
29
- mockStartCheckoutHandler,
30
- {},
31
- )(get, save)
27
+ .command(START_CHECKOUT, mockStartCheckoutHandler, {})(get, save)
32
28
  .build();
33
29
 
34
30
  const logger = mock<Logger>();
@@ -32,11 +32,7 @@ const saveMock = jest.fn();
32
32
  const save = jest.fn(() => saveMock);
33
33
  const mockSubmitCheckoutHandler = jest.fn();
34
34
  const { Component: Messaging } = bootstrap({ id: MESSAGING_CONTEXT_ID })
35
- .command(
36
- SUBMIT_CHECKOUT,
37
- mockSubmitCheckoutHandler,
38
- {},
39
- )(get, save)
35
+ .command(SUBMIT_CHECKOUT, mockSubmitCheckoutHandler, {})(get, save)
40
36
  .build();
41
37
 
42
38
  beforeEach(() => {
@@ -18,8 +18,7 @@ interface HttpCheckoutFeedbacksSaveFunctionArgs extends RepositorySaveFunctionAr
18
18
  readonly httpPost: HttpPostFunction;
19
19
  }
20
20
 
21
- interface HttpCheckoutFeedbacksSaveFunction
22
- extends CheckoutFeedbacksSaveFunction<HttpCheckoutFeedbacksSaveFunctionArgs> {}
21
+ interface HttpCheckoutFeedbacksSaveFunction extends CheckoutFeedbacksSaveFunction<HttpCheckoutFeedbacksSaveFunctionArgs> {}
23
22
 
24
23
  const saveCheckoutFeedback: HttpCheckoutFeedbacksSaveFunction =
25
24
  ({ httpPost }) =>
@@ -33,11 +33,7 @@ const saveMock = jest.fn();
33
33
  const save = jest.fn(() => saveMock);
34
34
  const mockFiveCheckoutFeedbackHandler = jest.fn();
35
35
  const { Component: Messaging } = bootstrap({ id: MESSAGING_CONTEXT_ID })
36
- .command(
37
- GIVE_CHECKOUT_FEEDBACK,
38
- mockFiveCheckoutFeedbackHandler,
39
- {},
40
- )(get, save)
36
+ .command(GIVE_CHECKOUT_FEEDBACK, mockFiveCheckoutFeedbackHandler, {})(get, save)
41
37
  .build();
42
38
 
43
39
  describe("useGiveCheckoutFeedback integration hook", () => {
@@ -35,11 +35,7 @@ const saveMock = jest.fn();
35
35
  const save = jest.fn(() => saveMock);
36
36
  const mockKeepCheckoutItemHandler = jest.fn();
37
37
  const { Component: Messaging } = bootstrap({ id: MESSAGING_CONTEXT_ID })
38
- .command(
39
- KEEP_CHECKOUT_ITEM,
40
- mockKeepCheckoutItemHandler,
41
- {},
42
- )(get, save)
38
+ .command(KEEP_CHECKOUT_ITEM, mockKeepCheckoutItemHandler, {})(get, save)
43
39
  .build();
44
40
 
45
41
  describe("useKeepCheckoutItem integration hook", () => {
@@ -35,11 +35,7 @@ const saveMock = jest.fn();
35
35
  const save = jest.fn(() => saveMock);
36
36
  const mockReplaceCheckoutItemHandler = jest.fn();
37
37
  const { Component: Messaging } = bootstrap({ id: MESSAGING_CONTEXT_ID })
38
- .command(
39
- REPLACE_CHECKOUT_ITEM,
40
- mockReplaceCheckoutItemHandler,
41
- {},
42
- )(get, save)
38
+ .command(REPLACE_CHECKOUT_ITEM, mockReplaceCheckoutItemHandler, {})(get, save)
43
39
  .build();
44
40
 
45
41
  describe("useReplaceCheckoutItem integration hook", () => {
@@ -35,11 +35,7 @@ const saveMock = jest.fn();
35
35
  const save = jest.fn(() => saveMock);
36
36
  const mockResetCheckoutItemHandler = jest.fn();
37
37
  const { Component: Messaging } = bootstrap({ id: MESSAGING_CONTEXT_ID })
38
- .command(
39
- RESET_CHECKOUT_ITEM,
40
- mockResetCheckoutItemHandler,
41
- {},
42
- )(get, save)
38
+ .command(RESET_CHECKOUT_ITEM, mockResetCheckoutItemHandler, {})(get, save)
43
39
  .build();
44
40
 
45
41
  describe("useResetCheckoutItem integration hook", () => {
@@ -35,11 +35,7 @@ const saveMock = jest.fn();
35
35
  const save = jest.fn(() => saveMock);
36
36
  const mockReturnCheckoutItemHandler = jest.fn();
37
37
  const { Component: Messaging } = bootstrap({ id: MESSAGING_CONTEXT_ID })
38
- .command(
39
- RETURN_CHECKOUT_ITEM,
40
- mockReturnCheckoutItemHandler,
41
- {},
42
- )(get, save)
38
+ .command(RETURN_CHECKOUT_ITEM, mockReturnCheckoutItemHandler, {})(get, save)
43
39
  .build();
44
40
 
45
41
  describe("useReturnCheckoutItem integration hook", () => {