@lookiero/checkout 12.2.0 → 12.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.
- package/cypress/integration/checkout.spec.ts +14 -9
- package/cypress/support/interceptViewCheckoutFeedbackDefinitionByCheckoutId.ts +6 -0
- package/dist/src/ExpoRoot.js +2 -2
- package/dist/src/domain/checkoutItem/model/price.d.ts +1 -1
- package/dist/src/infrastructure/delivery/baseBootstrap.d.ts +2 -2
- package/dist/src/infrastructure/delivery/baseBootstrap.js +4 -4
- package/dist/src/infrastructure/delivery/bootstrap.js +2 -2
- package/dist/src/infrastructure/delivery/bootstrap.mock.js +3 -3
- package/dist/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.d.ts +3 -0
- package/dist/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.js +107 -0
- package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.d.ts +12 -0
- package/dist/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.js +10 -0
- package/dist/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.d.ts +10 -0
- package/dist/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.js +9 -0
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +1 -1
- package/dist/src/infrastructure/projection/pricing/pricing.mock.js +1 -1
- package/dist/src/infrastructure/tracking/tracking.d.ts +1 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.d.ts +2 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +4 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.d.ts +2 -2
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.d.ts +5 -5
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.d.ts +5 -4
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.d.ts +2 -3
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +5 -7
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/views/feedback/Feedback.js +10 -9
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.d.ts +2 -3
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +17 -9
- package/dist/src/projection/checkoutFeedback/checkoutFeedback.constants.d.ts +11 -0
- package/dist/src/projection/checkoutFeedback/checkoutFeedback.constants.js +10 -0
- package/dist/src/projection/checkoutFeedback/checkoutFeedback.d.ts +22 -2
- package/dist/src/projection/checkoutFeedback/checkoutFeedback.metadata.d.ts +21 -0
- package/dist/src/projection/checkoutFeedback/checkoutFeedback.metadata.js +1 -0
- package/dist/src/projection/checkoutFeedback/checkoutFeedback.typeguards.d.ts +3 -0
- package/dist/src/projection/checkoutFeedback/checkoutFeedback.typeguards.js +7 -0
- package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.d.ts +25 -0
- package/dist/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.js +8 -0
- package/dist/src/projection/price/price.d.ts +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +5 -5
- package/src/ExpoRoot.tsx +2 -2
- package/src/domain/checkoutItem/model/price.ts +1 -1
- package/src/infrastructure/delivery/baseBootstrap.ts +9 -9
- package/src/infrastructure/delivery/bootstrap.mock.ts +5 -4
- package/src/infrastructure/delivery/bootstrap.ts +2 -2
- package/src/infrastructure/projection/checkoutFeedback/checkoutFeedbackDefinition.mock.ts +110 -0
- package/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.test.ts +52 -0
- package/src/infrastructure/projection/checkoutFeedback/httpCheckoutFeedbackDefinitionByCheckoutIdView.ts +30 -0
- package/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.test.ts +58 -0
- package/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.ts +25 -0
- package/src/infrastructure/projection/checkoutItem/checkoutItem.mock.ts +1 -1
- package/src/infrastructure/projection/pricing/pricing.mock.ts +1 -1
- package/src/infrastructure/tracking/tracking.ts +1 -1
- package/src/infrastructure/tracking/useTrackCheckout.test.tsx +1 -2
- package/src/infrastructure/tracking/useTrackCheckout.ts +1 -2
- package/src/infrastructure/ui/components/atoms/price/Price.test.tsx +1 -1
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.test.tsx +25 -30
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.tsx +12 -13
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.test.tsx +19 -26
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.test.tsx +26 -26
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/behaviors/useCheckoutQuestionItem.tsx +6 -6
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.ts +5 -4
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.test.tsx +7 -11
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultReturnQuestionItem.test.tsx +16 -10
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.test.tsx +16 -22
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.test.tsx +16 -14
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.tsx +13 -14
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.test.tsx +9 -19
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +7 -5
- package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +11 -5
- package/src/infrastructure/ui/views/feedback/Feedback.tsx +10 -9
- package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.test.tsx +2 -2
- package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +20 -13
- package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.test.tsx +1 -2
- package/src/infrastructure/ui/views/return/components/price/Price.test.tsx +1 -1
- package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.test.tsx +1 -2
- package/src/projection/checkoutFeedback/checkoutFeedback.constants.ts +16 -0
- package/src/projection/checkoutFeedback/checkoutFeedback.metadata.ts +28 -0
- package/src/projection/checkoutFeedback/checkoutFeedback.ts +38 -2
- package/src/projection/checkoutFeedback/checkoutFeedback.typeguards.ts +13 -0
- package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.test.ts +52 -0
- package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.ts +61 -0
- package/src/projection/price/price.ts +1 -1
- package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +0 -9
- package/dist/src/domain/checkoutItem/model/currency.d.ts +0 -6
- package/dist/src/domain/checkoutItem/model/currency.js +0 -7
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.d.ts +0 -12
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.js +0 -10
- package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.d.ts +0 -10
- package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.js +0 -9
- package/dist/src/projection/checkoutQuestion/checkoutQuestion.d.ts +0 -18
- package/dist/src/projection/checkoutQuestion/checkoutQuestion.js +0 -10
- package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.d.ts +0 -25
- package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.js +0 -8
- package/src/domain/checkoutItem/model/currency.ts +0 -7
- package/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.ts +0 -108
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.test.ts +0 -55
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.ts +0 -34
- package/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.test.ts +0 -38
- package/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.ts +0 -21
- package/src/projection/checkoutQuestion/checkoutQuestion.ts +0 -20
- package/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.test.ts +0 -31
- package/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.ts +0 -61
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { mock } from "jest-mock-extended";
|
|
2
|
-
import { QueryBus } from "@lookiero/messaging";
|
|
3
|
-
import { CheckoutQuestionProjection, CheckoutQuestionType } from "./checkoutQuestion";
|
|
4
|
-
import {
|
|
5
|
-
listCheckoutQuestionsByCheckoutId,
|
|
6
|
-
listCheckoutQuestionsByCheckoutIdHandler as sut,
|
|
7
|
-
} from "./listCheckoutQuestionsByCheckoutId";
|
|
8
|
-
|
|
9
|
-
const checkoutId = "29790d24-b139-4ab8-b618-d796d101e974";
|
|
10
|
-
const checkoutQuestionsProjection: CheckoutQuestionProjection[] = [
|
|
11
|
-
{
|
|
12
|
-
id: "efe07b97-f6fb-4b6a-ba92-b68519320b2c",
|
|
13
|
-
name: "main_title",
|
|
14
|
-
placeholder: "",
|
|
15
|
-
type: CheckoutQuestionType.HOST_DEFAULT,
|
|
16
|
-
showCondition: [],
|
|
17
|
-
},
|
|
18
|
-
];
|
|
19
|
-
const queryBus = mock<QueryBus>();
|
|
20
|
-
const signal = mock<AbortSignal>();
|
|
21
|
-
|
|
22
|
-
describe("listCheckoutQuestionsByCheckoutId", () => {
|
|
23
|
-
it("returns checkout questions by checkout id", async () => {
|
|
24
|
-
const query = listCheckoutQuestionsByCheckoutId({ checkoutId });
|
|
25
|
-
const view = jest.fn(() => Promise.resolve(checkoutQuestionsProjection));
|
|
26
|
-
|
|
27
|
-
const checkoutQuestionsProjectionResult = await sut({ view, queryBus, signal })(query);
|
|
28
|
-
|
|
29
|
-
expect(checkoutQuestionsProjectionResult).toBe(checkoutQuestionsProjection);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CancelableQueryViewArgs,
|
|
3
|
-
query,
|
|
4
|
-
Query,
|
|
5
|
-
QueryHandlerFunction,
|
|
6
|
-
QueryHandlerFunctionArgs,
|
|
7
|
-
} from "@lookiero/messaging";
|
|
8
|
-
import { CheckoutQuestionProjection } from "./checkoutQuestion";
|
|
9
|
-
|
|
10
|
-
const LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID = "list_checkout_questions_by_checkout_id";
|
|
11
|
-
|
|
12
|
-
interface ListCheckoutQuestionsByCheckoutIdPayload {
|
|
13
|
-
readonly checkoutId: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface ListCheckoutQuestionsByCheckoutId
|
|
17
|
-
extends Query<typeof LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID>,
|
|
18
|
-
ListCheckoutQuestionsByCheckoutIdPayload {}
|
|
19
|
-
|
|
20
|
-
interface ListCheckoutQuestionsByCheckoutIdFunction {
|
|
21
|
-
(payload: ListCheckoutQuestionsByCheckoutIdPayload): ListCheckoutQuestionsByCheckoutId;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const listCheckoutQuestionsByCheckoutId: ListCheckoutQuestionsByCheckoutIdFunction = (payload) => ({
|
|
25
|
-
...query({ name: LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID }),
|
|
26
|
-
...payload,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
type ListCheckoutQuestionsByCheckoutIdResult = CheckoutQuestionProjection[] | null;
|
|
30
|
-
|
|
31
|
-
interface CheckoutQuestionsByCheckoutIdViewArgs extends CancelableQueryViewArgs {
|
|
32
|
-
readonly checkoutId: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface CheckoutQuestionsByCheckoutIdView {
|
|
36
|
-
(args: CheckoutQuestionsByCheckoutIdViewArgs): Promise<ListCheckoutQuestionsByCheckoutIdResult>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface ListCheckoutQuestionsByCheckoutIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {
|
|
40
|
-
readonly view: CheckoutQuestionsByCheckoutIdView;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const listCheckoutQuestionsByCheckoutIdHandler: QueryHandlerFunction<
|
|
44
|
-
ListCheckoutQuestionsByCheckoutId,
|
|
45
|
-
ListCheckoutQuestionsByCheckoutIdResult,
|
|
46
|
-
ListCheckoutQuestionsByCheckoutIdHandlerFunctionArgs
|
|
47
|
-
> =
|
|
48
|
-
({ view, signal }) =>
|
|
49
|
-
async ({ checkoutId }) =>
|
|
50
|
-
view({ checkoutId, signal });
|
|
51
|
-
|
|
52
|
-
export type {
|
|
53
|
-
ListCheckoutQuestionsByCheckoutId,
|
|
54
|
-
CheckoutQuestionsByCheckoutIdView,
|
|
55
|
-
ListCheckoutQuestionsByCheckoutIdResult,
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
LIST_CHECKOUT_QUESTIONS_BY_CHECKOUT_ID,
|
|
59
|
-
listCheckoutQuestionsByCheckoutId,
|
|
60
|
-
listCheckoutQuestionsByCheckoutIdHandler,
|
|
61
|
-
};
|