@lookiero/checkout 8.14.0-beta.102 → 8.14.0-beta.2
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/dist/pact.config.d.ts +4 -12
- package/dist/pact.config.js +4 -11
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -1
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +24 -24
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +33 -40
- package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +6 -6
- package/dist/src/infrastructure/projection/checkout/checkout.mock.js +12 -15
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +82 -89
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +33 -40
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +31 -38
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +31 -38
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +31 -38
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +3 -3
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +33 -40
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +6 -10
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +38 -39
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +33 -40
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +96 -97
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +33 -40
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +83 -94
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +1 -7
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +173 -178
- package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +33 -40
- package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +2 -3
- package/dist/src/infrastructure/projection/pricing/pricing.mock.js +34 -35
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +33 -40
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -1
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +377 -378
- package/dist/src/infrastructure/ui/Root.d.ts +2 -0
- package/dist/src/infrastructure/ui/Root.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +5 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +5 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +5 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +3 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -4
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +7 -0
- package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
- package/dist/src/infrastructure/ui/views/App.d.ts +8 -0
- package/dist/src/infrastructure/ui/views/App.js +4 -4
- package/dist/src/infrastructure/ui/views/App.style.d.ts +3 -3
- package/dist/src/infrastructure/ui/views/App.style.js +3 -4
- package/dist/src/infrastructure/ui/views/item/Item.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +2 -0
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +5 -1
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -3
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +2 -0
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/return/Return.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +12 -14
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +2 -6
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -6
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/jest.setup.js +20 -0
- package/package.json +5 -4
- package/pact.config.ts +31 -0
- package/pact.publish.js +32 -0
- package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +62 -0
- package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +128 -0
- package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +63 -0
- package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +57 -0
- package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +57 -0
- package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +57 -0
- package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +63 -0
- package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +64 -0
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +62 -0
- package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +136 -0
- package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
- package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +62 -0
- package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +62 -0
- package/src/infrastructure/ui/Root.tsx +4 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +14 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +8 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +6 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +2 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +5 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +3 -2
- package/src/infrastructure/ui/routing/Routing.tsx +13 -5
- package/{dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js → src/infrastructure/ui/views/App.style.ts} +2 -7
- package/src/infrastructure/ui/views/App.tsx +14 -7
- package/src/infrastructure/ui/views/item/Item.tsx +8 -2
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +9 -3
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +8 -1
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +12 -3
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -6
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -3
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +12 -2
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +14 -4
- package/src/infrastructure/ui/views/return/Return.tsx +8 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +2 -6
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +33 -38
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
- package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
- package/dist/src/projection/shared/country.d.ts +0 -14
- package/dist/src/projection/shared/country.js +0 -15
- package/dist/src/projection/shared/customer.d.ts +0 -9
- package/dist/src/projection/shared/customer.js +0 -1
- package/dist/src/projection/shared/locale.d.ts +0 -12
- package/dist/src/projection/shared/locale.js +0 -13
- package/dist/src/projection/shared/order.d.ts +0 -6
- package/dist/src/projection/shared/order.js +0 -1
- package/dist/src/projection/shared/price.d.ts +0 -11
- package/dist/src/projection/shared/price.js +0 -1
- package/dist/src/projection/shared/size.d.ts +0 -21
- package/dist/src/projection/shared/size.js +0 -4
- package/dist/src/projection/shared/subscription.d.ts +0 -2
- package/dist/src/projection/shared/subscription.js +0 -1
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
- package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
|
@@ -1,188 +1,183 @@
|
|
|
1
1
|
const paymentFlowPayloadForKeptItems = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
bookingId: "",
|
|
3
|
+
orderId: "3062898",
|
|
4
|
+
comment: "",
|
|
5
|
+
items: [
|
|
6
|
+
{ reference: "9P1435C9L" },
|
|
7
|
+
{ reference: "9C2017C22M" },
|
|
8
|
+
{ reference: "9J1800C22M" },
|
|
9
|
+
{ reference: "9M608C15L" },
|
|
10
|
+
{ reference: "10S769C48S" },
|
|
11
|
+
],
|
|
12
12
|
};
|
|
13
13
|
const paymentFlowPayloadForReturnedItems = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
14
|
+
bookingId: "",
|
|
15
|
+
orderId: "3071170",
|
|
16
|
+
comment: "",
|
|
17
|
+
items: [
|
|
18
|
+
{
|
|
19
|
+
reference: "9J1800C22M",
|
|
20
|
+
feedback: {
|
|
21
|
+
size: { name: "La talla es...", value: "3" },
|
|
22
|
+
price: { name: "El precio es...", value: "8" },
|
|
23
|
+
quality: { name: "La calidad es...", value: "15" },
|
|
24
|
+
style: { name: "El estilo es...", value: "5" },
|
|
25
|
+
shape: { name: "La forma es...", value: "12" },
|
|
26
|
+
comment: { name: "¿Algo más sobre esta prenda?", value: "Me queda pequeño" },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
reference: "10S769C48S",
|
|
31
|
+
feedback: {
|
|
32
|
+
size: { name: "La talla es...", value: "1" },
|
|
33
|
+
price: { name: "El precio es...", value: "10" },
|
|
34
|
+
quality: { name: "La calidad es...", value: "15" },
|
|
35
|
+
style: { name: "El estilo es...", value: "5" },
|
|
36
|
+
shape: { name: "La forma es...", value: "14" },
|
|
37
|
+
comment: { name: "¿Algo más sobre esta prenda?", value: "Me queda grande y no me gusta demasiado" },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
reference: "9C2017C22M",
|
|
42
|
+
feedback: {
|
|
43
|
+
size: { name: "La talla es...", value: "2" },
|
|
44
|
+
price: { name: "El precio es...", value: "10" },
|
|
45
|
+
quality: { name: "La calidad es...", value: "15" },
|
|
46
|
+
style: { name: "El estilo es...", value: "5" },
|
|
47
|
+
shape: { name: "La forma es...", value: "12" },
|
|
48
|
+
comment: { name: "¿Algo más sobre esta prenda?", value: "Demasiado caro para mi presupuesto" },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
reference: "9M608C15L",
|
|
53
|
+
feedback: {
|
|
54
|
+
style: { name: "El estilo es...", value: "7" },
|
|
55
|
+
shape: { name: "La forma es...", value: "14" },
|
|
56
|
+
quality: { name: "La calidad es...", value: "15" },
|
|
57
|
+
price: { name: "El precio es...", value: "9" },
|
|
58
|
+
size: { name: "La talla es...", value: "2" },
|
|
59
|
+
comment: { name: "¿Algo más sobre esta prenda?", value: "No me gusta nada" },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
reference: "9P1435C9L",
|
|
64
|
+
feedback: {
|
|
65
|
+
quality: { name: "La calidad es...", value: "17" },
|
|
66
|
+
size: { name: "La talla es...", value: "2" },
|
|
67
|
+
price: { name: "El precio es...", value: "10" },
|
|
68
|
+
style: { name: "El estilo es...", value: "5" },
|
|
69
|
+
shape: { name: "La forma es...", value: "12" },
|
|
70
|
+
comment: { name: "¿Algo más sobre esta prenda?", value: "Demasiado caro para la calidad que ofrece" },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
74
|
};
|
|
75
75
|
const paymentFlowPayloadForReplacedItems = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
76
|
+
bookingId: "ca2e03e6-1644-4406-a379-0e5c3c321f32",
|
|
77
|
+
orderId: "3071171",
|
|
78
|
+
comment: "",
|
|
79
|
+
items: [
|
|
80
|
+
{
|
|
81
|
+
reference: "9J1800C22M",
|
|
82
|
+
sizeChange: {
|
|
83
|
+
brand: "ONLY",
|
|
84
|
+
color: "blue_dark",
|
|
85
|
+
description: "Onlglamour Sweater knit T. XS C. blue_dark",
|
|
86
|
+
id: "5a95dffc-5031-4c2a-b8bc-f100c4710336",
|
|
87
|
+
reference: "9J1800C22XS",
|
|
88
|
+
size: "XS",
|
|
89
|
+
title: "Onlglamour Sweater knit ",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
reference: "10S769C48S",
|
|
94
|
+
sizeChange: {
|
|
95
|
+
brand: "FRANSA",
|
|
96
|
+
color: "brick",
|
|
97
|
+
description: "Zawov Shirt fransa T. XS C. brick",
|
|
98
|
+
id: "b74df550-a4ab-4fb0-9a34-5767c700dcd0",
|
|
99
|
+
reference: "10S769C48XS",
|
|
100
|
+
size: "XS",
|
|
101
|
+
title: "Zawov Shirt fransa ",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
reference: "9C2017C22M",
|
|
106
|
+
sizeChange: {
|
|
107
|
+
brand: "VERO MODA",
|
|
108
|
+
color: "blue_dark",
|
|
109
|
+
description: "Vmlina Tshirt vback T. XS C. blue_dark",
|
|
110
|
+
id: "349a4aeb-d8ca-4f3d-9efb-5b333da22290",
|
|
111
|
+
reference: "9C2017C22XS",
|
|
112
|
+
size: "XS",
|
|
113
|
+
title: "Vmlina Tshirt vback ",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
reference: "9M608C15L",
|
|
118
|
+
sizeChange: {
|
|
119
|
+
brand: "ESPRIT CASUAL",
|
|
120
|
+
color: "beige",
|
|
121
|
+
description: "Hope Jeans skinny T. S C. beige",
|
|
122
|
+
id: "86aed12f-81e1-4a09-9c68-15dce7a844b7",
|
|
123
|
+
reference: "9M608C15S",
|
|
124
|
+
size: "S",
|
|
125
|
+
title: "Hope Jeans skinny ",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
reference: "9P1435C9L",
|
|
130
|
+
sizeChange: {
|
|
131
|
+
brand: "ICHI",
|
|
132
|
+
color: "orange",
|
|
133
|
+
description: "Kate Pant mazarine T. S C. orange",
|
|
134
|
+
id: "34f311e2-ba8e-4261-bf70-6f25fc0e9ed9",
|
|
135
|
+
reference: "9P1435C9S",
|
|
136
|
+
size: "S",
|
|
137
|
+
title: "Kate Pant mazarine ",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
141
|
};
|
|
142
142
|
const paymentFlowPayload = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
bookingId: "7a3c298a-a3ee-45ac-a452-e276c1c98069",
|
|
144
|
+
orderId: "3062898",
|
|
145
|
+
comment: "",
|
|
146
|
+
items: [
|
|
147
|
+
{
|
|
148
|
+
reference: "9P1435C9L",
|
|
149
|
+
feedback: {
|
|
150
|
+
size: {
|
|
151
|
+
name: "La talla es...",
|
|
152
|
+
value: "1",
|
|
153
|
+
},
|
|
154
|
+
price: {
|
|
155
|
+
name: "El precio es...",
|
|
156
|
+
value: "10",
|
|
157
|
+
},
|
|
158
|
+
},
|
|
153
159
|
},
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
value: "10",
|
|
160
|
+
{
|
|
161
|
+
reference: "9C2017C22M",
|
|
157
162
|
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
size: "M",
|
|
178
|
-
title: "Zawov Shirt fransa ",
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
};
|
|
183
|
-
export {
|
|
184
|
-
paymentFlowPayload,
|
|
185
|
-
paymentFlowPayloadForKeptItems,
|
|
186
|
-
paymentFlowPayloadForReturnedItems,
|
|
187
|
-
paymentFlowPayloadForReplacedItems,
|
|
163
|
+
{
|
|
164
|
+
reference: "9J1800C22M",
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
reference: "9M608C15L",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
reference: "10S769C48S",
|
|
171
|
+
sizeChange: {
|
|
172
|
+
brand: "FRANSA",
|
|
173
|
+
color: "brick",
|
|
174
|
+
description: "Zawov Shirt fransa T. M C. brick",
|
|
175
|
+
id: "dbabf321-2ca8-4ac0-a727-05e39779e3b3",
|
|
176
|
+
reference: "10S769C48M",
|
|
177
|
+
size: "M",
|
|
178
|
+
title: "Zawov Shirt fransa ",
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
],
|
|
188
182
|
};
|
|
183
|
+
export { paymentFlowPayload, paymentFlowPayloadForKeptItems, paymentFlowPayloadForReturnedItems, paymentFlowPayloadForReplacedItems, };
|
package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js
CHANGED
|
@@ -13,6 +13,6 @@ const useViewPaymentFlowPayloadByCheckoutId = ({ checkoutId }) => useQuery({
|
|
|
13
13
|
query: viewPaymentFlowPayloadByCheckoutId({ checkoutId: checkoutId }),
|
|
14
14
|
contextId: MESSAGING_CONTEXT_ID,
|
|
15
15
|
invalidation: shouldInvalidate,
|
|
16
|
-
options: { refetchOnMount: "always", enabled: Boolean(checkoutId), cacheTime: 0
|
|
16
|
+
options: { refetchOnMount: "always", enabled: Boolean(checkoutId), cacheTime: 0 },
|
|
17
17
|
});
|
|
18
18
|
export { useViewPaymentFlowPayloadByCheckoutId };
|
|
@@ -1,55 +1,48 @@
|
|
|
1
1
|
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
2
|
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import {
|
|
4
|
-
AUTH_TOKEN,
|
|
5
|
-
DEFAULT_PACT_OPTIONS,
|
|
6
|
-
DEFAULT_REQUEST_HEADERS,
|
|
7
|
-
DEFAULT_RESPONSE_HEADERS,
|
|
8
|
-
fromMockServerUrlToApiUrl,
|
|
9
|
-
} from "../../../../pact.config";
|
|
3
|
+
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
10
4
|
import { httpPricingByCheckoutIdView } from "./httpPricingByCheckoutIdView";
|
|
11
5
|
import { pricing } from "./pricing.mock";
|
|
12
|
-
|
|
13
6
|
const provider = new PactV3({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
...DEFAULT_PACT_OPTIONS,
|
|
8
|
+
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
9
|
+
provider: "STY-BOX_CHECKOUT-BACK_ViewPricingByCheckoutId",
|
|
17
10
|
});
|
|
18
11
|
const checkoutId = "6f720954-8039-4bed-9596-34fc5a02131b";
|
|
19
12
|
const pricingResponse = {
|
|
20
|
-
|
|
13
|
+
result: pricing(),
|
|
21
14
|
};
|
|
22
15
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
16
|
// @ts-ignore
|
|
24
17
|
const EXPECTED_BODY = MatchersV3.like(pricingResponse);
|
|
25
18
|
describe("STY-BOX_CHECKOUT-BACK_ViewPricingByCheckoutId API", () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
19
|
+
it("returns a valid pricing for the given checkout", () => {
|
|
20
|
+
provider
|
|
21
|
+
.given("a valid pricing for the given checkout")
|
|
22
|
+
.uponReceiving("pricing projection")
|
|
23
|
+
.withRequest({
|
|
24
|
+
method: "POST",
|
|
25
|
+
path: "/api/view-pricing-by-checkout-id",
|
|
26
|
+
headers: DEFAULT_REQUEST_HEADERS,
|
|
27
|
+
body: { checkoutId },
|
|
28
|
+
})
|
|
29
|
+
.willRespondWith({
|
|
30
|
+
status: 200,
|
|
31
|
+
headers: DEFAULT_RESPONSE_HEADERS,
|
|
32
|
+
body: EXPECTED_BODY,
|
|
33
|
+
});
|
|
34
|
+
return provider.executeTest(async (mockserver) => {
|
|
35
|
+
const httpPost = fetchHttpPost({
|
|
36
|
+
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
37
|
+
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
38
|
+
device: "web",
|
|
39
|
+
version: "1.0.0",
|
|
40
|
+
});
|
|
41
|
+
const response = await httpPricingByCheckoutIdView({ httpPost })({
|
|
42
|
+
checkoutId,
|
|
43
|
+
signal: undefined,
|
|
44
|
+
});
|
|
45
|
+
expect(response).toStrictEqual(pricingResponse.result);
|
|
46
|
+
});
|
|
53
47
|
});
|
|
54
|
-
});
|
|
55
48
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { PricingProjection } from "../../../projection/pricing/pricing";
|
|
2
|
-
|
|
3
2
|
interface PricingFunctionArgs {
|
|
4
|
-
|
|
3
|
+
readonly paidWithPromocode: boolean;
|
|
5
4
|
}
|
|
6
5
|
interface PricingFunction {
|
|
7
|
-
|
|
6
|
+
(args?: PricingFunctionArgs): PricingProjection;
|
|
8
7
|
}
|
|
9
8
|
declare const pricing: PricingFunction;
|
|
10
9
|
export { pricing };
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
import { Currency } from "../../../domain/checkoutItem/model/currency";
|
|
2
|
-
|
|
3
2
|
const pricing = ({ paidWithPromocode } = { paidWithPromocode: false }) => ({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
discount: {
|
|
17
|
-
amount: -2500,
|
|
18
|
-
currency: Currency.EUR,
|
|
19
|
-
},
|
|
20
|
-
discountPercentage: 25,
|
|
21
|
-
balanceDiscount: {
|
|
22
|
-
amount: -2000,
|
|
23
|
-
currency: Currency.EUR,
|
|
24
|
-
},
|
|
25
|
-
service: {
|
|
26
|
-
reference: "LK-service",
|
|
27
|
-
originalPrice: {
|
|
28
|
-
amount: 10.0,
|
|
29
|
-
currency: Currency.EUR,
|
|
3
|
+
orderTotal: {
|
|
4
|
+
amount: 18301,
|
|
5
|
+
currency: Currency.EUR,
|
|
6
|
+
},
|
|
7
|
+
pendingToPay: {
|
|
8
|
+
amount: 16301,
|
|
9
|
+
currency: Currency.EUR,
|
|
10
|
+
},
|
|
11
|
+
subtotal: {
|
|
12
|
+
amount: 21801,
|
|
13
|
+
currency: Currency.EUR,
|
|
30
14
|
},
|
|
31
15
|
discount: {
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
amount: -2500,
|
|
17
|
+
currency: Currency.EUR,
|
|
18
|
+
},
|
|
19
|
+
discountPercentage: 25,
|
|
20
|
+
balanceDiscount: {
|
|
21
|
+
amount: -2000,
|
|
22
|
+
currency: Currency.EUR,
|
|
34
23
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
service: {
|
|
25
|
+
reference: "LK-service",
|
|
26
|
+
originalPrice: {
|
|
27
|
+
amount: 10.0,
|
|
28
|
+
currency: Currency.EUR,
|
|
29
|
+
},
|
|
30
|
+
discount: {
|
|
31
|
+
amount: 0,
|
|
32
|
+
currency: Currency.EUR,
|
|
33
|
+
},
|
|
34
|
+
finalPrice: {
|
|
35
|
+
amount: -1000,
|
|
36
|
+
currency: Currency.EUR,
|
|
37
|
+
},
|
|
38
|
+
prepaid: true,
|
|
39
|
+
paidWithPromocode,
|
|
38
40
|
},
|
|
39
|
-
prepaid: true,
|
|
40
|
-
paidWithPromocode,
|
|
41
|
-
},
|
|
42
41
|
});
|
|
43
42
|
export { pricing };
|
|
@@ -1,55 +1,48 @@
|
|
|
1
1
|
import { MatchersV3, PactV3 } from "@pact-foundation/pact";
|
|
2
2
|
import { fetchHttpPost } from "@lookiero/sty-psp-http";
|
|
3
|
-
import {
|
|
4
|
-
AUTH_TOKEN,
|
|
5
|
-
DEFAULT_PACT_OPTIONS,
|
|
6
|
-
DEFAULT_REQUEST_HEADERS,
|
|
7
|
-
DEFAULT_RESPONSE_HEADERS,
|
|
8
|
-
fromMockServerUrlToApiUrl,
|
|
9
|
-
} from "../../../../pact.config";
|
|
3
|
+
import { AUTH_TOKEN, DEFAULT_PACT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_RESPONSE_HEADERS, fromMockServerUrlToApiUrl, } from "../../../../pact.config";
|
|
10
4
|
import { httpReturnQuestionsByCheckoutItemIdView } from "./httpReturnQuestionsByCheckoutItemIdView";
|
|
11
5
|
import { returnQuestions } from "./returnQuestions.mock";
|
|
12
|
-
|
|
13
6
|
const provider = new PactV3({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
...DEFAULT_PACT_OPTIONS,
|
|
8
|
+
consumer: "STY-BOX_CHECKOUT-FRONT",
|
|
9
|
+
provider: "STY-BOX_CHECKOUT-BACK_ListReturnQuestionsByCheckoutItemId",
|
|
17
10
|
});
|
|
18
11
|
const checkoutItemId = "52440ae5-7a4c-498b-8b35-08ecfde15776";
|
|
19
12
|
const returnQuestionsResponse = {
|
|
20
|
-
|
|
13
|
+
result: returnQuestions,
|
|
21
14
|
};
|
|
22
15
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
16
|
// @ts-ignore
|
|
24
17
|
const EXPECTED_BODY = MatchersV3.like(returnQuestionsResponse);
|
|
25
18
|
describe("STY-BOX_CHECKOUT-BACK_ListReturnQuestionsByCheckoutItemId API", () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
19
|
+
it("returns a valid return questions for the given checkout item id", () => {
|
|
20
|
+
provider
|
|
21
|
+
.given("a valid return questions for the given checkout item id")
|
|
22
|
+
.uponReceiving("return questions projection")
|
|
23
|
+
.withRequest({
|
|
24
|
+
method: "POST",
|
|
25
|
+
path: "/api/list-return-questions-by-checkout-item-id",
|
|
26
|
+
headers: DEFAULT_REQUEST_HEADERS,
|
|
27
|
+
body: { checkoutItemId },
|
|
28
|
+
})
|
|
29
|
+
.willRespondWith({
|
|
30
|
+
status: 200,
|
|
31
|
+
headers: DEFAULT_RESPONSE_HEADERS,
|
|
32
|
+
body: EXPECTED_BODY,
|
|
33
|
+
});
|
|
34
|
+
return provider.executeTest(async (mockserver) => {
|
|
35
|
+
const httpPost = fetchHttpPost({
|
|
36
|
+
apiUrl: () => fromMockServerUrlToApiUrl(mockserver),
|
|
37
|
+
getAuthToken: () => Promise.resolve(AUTH_TOKEN),
|
|
38
|
+
device: "web",
|
|
39
|
+
version: "1.0.0",
|
|
40
|
+
});
|
|
41
|
+
const response = await httpReturnQuestionsByCheckoutItemIdView({ httpPost })({
|
|
42
|
+
checkoutItemId,
|
|
43
|
+
signal: undefined,
|
|
44
|
+
});
|
|
45
|
+
expect(response).toStrictEqual(returnQuestionsResponse.result);
|
|
46
|
+
});
|
|
53
47
|
});
|
|
54
|
-
});
|
|
55
48
|
});
|