@redneckz/wildless-cms-uni-blocks 0.14.863 → 0.14.865
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/bundle/bundle.umd.js +93 -25
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -2
- package/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -1
- package/bundle/components/DebitForm/getDebitCardFormTaskData.d.ts +3 -1
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/bundle/retail/adaptors/getCreditFormTaskData.d.ts +3 -1
- package/bundle/retail/api/draftTasksKZO.d.ts +1 -0
- package/bundle/retail/api/saveReferalInfo.d.ts +5 -0
- package/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -0
- package/bundle/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/bundle/retail/components/DraftDialog/useDraftDialog.d.ts +2 -9
- package/bundle/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/bundle/retail/model/ReferalData.d.ts +7 -0
- package/bundle/utils/getSessionQuery.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -2
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +6 -4
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +36 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -1
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +2 -0
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +2 -0
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/components/DebitForm/getDebitCardFormTaskData.d.ts +3 -1
- package/dist/components/DebitForm/getDebitCardFormTaskData.js +3 -2
- package/dist/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/dist/components/DebitForm/useDebitFormAPI.js +2 -0
- package/dist/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/retail/adaptors/getCreditFormTaskData.d.ts +3 -1
- package/dist/retail/adaptors/getCreditFormTaskData.js +3 -2
- package/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/dist/retail/api/draftTasksKZO.d.ts +1 -0
- package/dist/retail/api/draftTasksKZO.js.map +1 -1
- package/dist/retail/api/saveReferalInfo.d.ts +5 -0
- package/dist/retail/api/saveReferalInfo.js +6 -0
- package/dist/retail/api/saveReferalInfo.js.map +1 -0
- package/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -0
- package/dist/retail/components/DraftDialog/DraftDialog.js +13 -4
- package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +3 -2
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/components/DraftDialog/useDraftDialog.d.ts +2 -9
- package/dist/retail/components/DraftDialog/useDraftDialog.js +4 -2
- package/dist/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
- package/dist/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/dist/retail/model/ReferalData.d.ts +7 -0
- package/dist/retail/model/ReferalData.js +2 -0
- package/dist/retail/model/ReferalData.js.map +1 -0
- package/dist/utils/getSessionQuery.d.ts +1 -0
- package/dist/utils/getSessionQuery.js +4 -4
- package/dist/utils/getSessionQuery.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -2
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +6 -4
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +36 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/lib/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -1
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +2 -0
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +2 -0
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/components/DebitForm/getDebitCardFormTaskData.d.ts +3 -1
- package/lib/components/DebitForm/getDebitCardFormTaskData.js +3 -2
- package/lib/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/lib/components/DebitForm/useDebitFormAPI.js +2 -0
- package/lib/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/retail/adaptors/getCreditFormTaskData.d.ts +3 -1
- package/lib/retail/adaptors/getCreditFormTaskData.js +3 -2
- package/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/lib/retail/api/draftTasksKZO.d.ts +1 -0
- package/lib/retail/api/draftTasksKZO.js.map +1 -1
- package/lib/retail/api/saveReferalInfo.d.ts +5 -0
- package/lib/retail/api/saveReferalInfo.js +3 -0
- package/lib/retail/api/saveReferalInfo.js.map +1 -0
- package/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -0
- package/lib/retail/components/DraftDialog/DraftDialog.js +13 -4
- package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +3 -2
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/components/DraftDialog/useDraftDialog.d.ts +2 -9
- package/lib/retail/components/DraftDialog/useDraftDialog.js +4 -2
- package/lib/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
- package/lib/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/lib/retail/model/ReferalData.d.ts +7 -0
- package/lib/retail/model/ReferalData.js +2 -0
- package/lib/retail/model/ReferalData.js.map +1 -0
- package/lib/utils/getSessionQuery.d.ts +1 -0
- package/lib/utils/getSessionQuery.js +1 -1
- package/lib/utils/getSessionQuery.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +88 -23
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -2
- package/mobile/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/mobile/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -1
- package/mobile/bundle/components/DebitForm/getDebitCardFormTaskData.d.ts +3 -1
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/bundle/retail/adaptors/getCreditFormTaskData.d.ts +3 -1
- package/mobile/bundle/retail/api/draftTasksKZO.d.ts +1 -0
- package/mobile/bundle/retail/api/saveReferalInfo.d.ts +5 -0
- package/mobile/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -0
- package/mobile/bundle/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/mobile/bundle/retail/components/DraftDialog/useDraftDialog.d.ts +2 -9
- package/mobile/bundle/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/mobile/bundle/retail/model/ReferalData.d.ts +7 -0
- package/mobile/bundle/utils/getSessionQuery.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -2
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +6 -4
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +36 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -1
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +2 -0
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +2 -0
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.d.ts +3 -1
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.js +3 -2
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/mobile/dist/components/DebitForm/useDebitFormAPI.js +2 -0
- package/mobile/dist/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.d.ts +3 -1
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js +3 -2
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/dist/retail/api/draftTasksKZO.d.ts +1 -0
- package/mobile/dist/retail/api/draftTasksKZO.js.map +1 -1
- package/mobile/dist/retail/api/saveReferalInfo.d.ts +5 -0
- package/mobile/dist/retail/api/saveReferalInfo.js +6 -0
- package/mobile/dist/retail/api/saveReferalInfo.js.map +1 -0
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -0
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +13 -4
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +3 -2
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/useDraftDialog.d.ts +2 -9
- package/mobile/dist/retail/components/DraftDialog/useDraftDialog.js +4 -2
- package/mobile/dist/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
- package/mobile/dist/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/mobile/dist/retail/model/ReferalData.d.ts +7 -0
- package/mobile/dist/retail/model/ReferalData.js +2 -0
- package/mobile/dist/retail/model/ReferalData.js.map +1 -0
- package/mobile/dist/utils/getSessionQuery.d.ts +1 -0
- package/mobile/dist/utils/getSessionQuery.js +4 -4
- package/mobile/dist/utils/getSessionQuery.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -2
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +6 -4
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +36 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/mobile/lib/components/ApplicationLeadForm/useLeadFormStore.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -1
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js +3 -2
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +2 -0
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +2 -0
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.d.ts +3 -1
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.js +3 -2
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/mobile/lib/components/DebitForm/useDebitFormAPI.js +2 -0
- package/mobile/lib/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.d.ts +3 -1
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js +3 -2
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/lib/retail/api/draftTasksKZO.d.ts +1 -0
- package/mobile/lib/retail/api/draftTasksKZO.js.map +1 -1
- package/mobile/lib/retail/api/saveReferalInfo.d.ts +5 -0
- package/mobile/lib/retail/api/saveReferalInfo.js +3 -0
- package/mobile/lib/retail/api/saveReferalInfo.js.map +1 -0
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -0
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +13 -4
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +3 -2
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/useDraftDialog.d.ts +2 -9
- package/mobile/lib/retail/components/DraftDialog/useDraftDialog.js +4 -2
- package/mobile/lib/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
- package/mobile/lib/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/mobile/lib/retail/model/ReferalData.d.ts +7 -0
- package/mobile/lib/retail/model/ReferalData.js +2 -0
- package/mobile/lib/retail/model/ReferalData.js.map +1 -0
- package/mobile/lib/utils/getSessionQuery.d.ts +1 -0
- package/mobile/lib/utils/getSessionQuery.js +1 -1
- package/mobile/lib/utils/getSessionQuery.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +39 -0
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +8 -2
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +21 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +43 -4
- package/mobile/src/components/ApplicationLeadForm/useLeadFormStore.ts +2 -0
- package/mobile/src/components/CreditCardForm/getCreditCardFormTaskData.ts +5 -1
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +2 -0
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +2 -0
- package/mobile/src/components/DebitForm/getDebitCardFormTaskData.ts +5 -1
- package/mobile/src/components/DebitForm/useDebitFormAPI.tsx +2 -0
- package/mobile/src/model/FormTypeFieldDef.ts +1 -0
- package/mobile/src/retail/adaptors/getCreditFormTaskData.ts +5 -1
- package/mobile/src/retail/api/draftTasksKZO.ts +1 -0
- package/mobile/src/retail/api/saveReferalInfo.ts +9 -0
- package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +15 -3
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +5 -2
- package/mobile/src/retail/components/DraftDialog/useDraftDialog.tsx +5 -11
- package/mobile/src/retail/model/ReferalData.ts +8 -0
- package/mobile/src/utils/getSessionQuery.ts +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +39 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +26 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +26 -0
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +8 -2
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +21 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +43 -4
- package/src/components/ApplicationLeadForm/useLeadFormStore.ts +2 -0
- package/src/components/CreditCardForm/getCreditCardFormTaskData.ts +5 -1
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +2 -0
- package/src/components/CreditForm/useCreditFormAPI.tsx +2 -0
- package/src/components/DebitForm/getDebitCardFormTaskData.ts +5 -1
- package/src/components/DebitForm/useDebitFormAPI.tsx +2 -0
- package/src/icons/IconName.ts +2 -2
- package/src/model/FormTypeFieldDef.ts +1 -0
- package/src/retail/adaptors/getCreditFormTaskData.ts +5 -1
- package/src/retail/api/draftTasksKZO.ts +1 -0
- package/src/retail/api/saveReferalInfo.ts +9 -0
- package/src/retail/components/DraftDialog/DraftDialog.tsx +15 -3
- package/src/retail/components/DraftDialog/parseDraftTask.ts +5 -2
- package/src/retail/components/DraftDialog/useDraftDialog.tsx +5 -11
- package/src/retail/model/ReferalData.ts +8 -0
- package/src/utils/getSessionQuery.ts +1 -1
|
@@ -8,18 +8,21 @@ import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
|
8
8
|
import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
|
|
9
9
|
import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
|
|
10
10
|
import { getTaskById } from '../../retail/api/getTaskById';
|
|
11
|
+
import { saveReferalInfo } from '../../retail/api/saveReferalInfo';
|
|
11
12
|
import { updateUserProfile } from '../../retail/api/updateUserProfile';
|
|
12
13
|
import { updateUserTask } from '../../retail/api/updateUserTask';
|
|
13
14
|
import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
|
|
14
15
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
15
16
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
16
17
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
18
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
17
19
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
18
20
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
19
21
|
import { formatPhone } from '../../utils/formatPhone';
|
|
20
22
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
21
23
|
import { productTypeToConsentsMap } from './consents';
|
|
22
24
|
import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
|
|
25
|
+
import { useLeadFormStore } from './useLeadFormStore';
|
|
23
26
|
import { useSaveUserData, type UserData } from './useSaveUserData';
|
|
24
27
|
import { useSendLeadFormAspects } from './useSendLeadFormAspects';
|
|
25
28
|
|
|
@@ -39,6 +42,8 @@ export const useApplicationLeadApi = ({
|
|
|
39
42
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
40
43
|
const [ok, setOK] = useState<boolean | undefined>();
|
|
41
44
|
const saveUserData = useSaveUserData();
|
|
45
|
+
const leadFormStore = useLeadFormStore();
|
|
46
|
+
|
|
42
47
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
43
48
|
const navigator = locationNavigator();
|
|
44
49
|
|
|
@@ -57,6 +62,7 @@ export const useApplicationLeadApi = ({
|
|
|
57
62
|
const profileId = await createUserProfile({
|
|
58
63
|
profile: { phone: formatPhone(transformedFormData.phone as string) },
|
|
59
64
|
});
|
|
65
|
+
const referalData = leadFormStore.referalData;
|
|
60
66
|
|
|
61
67
|
if (!profileId) {
|
|
62
68
|
throw new Error();
|
|
@@ -68,6 +74,7 @@ export const useApplicationLeadApi = ({
|
|
|
68
74
|
profileId,
|
|
69
75
|
formData: transformedFormData,
|
|
70
76
|
productType,
|
|
77
|
+
referalData,
|
|
71
78
|
saveUserData,
|
|
72
79
|
sendAspects,
|
|
73
80
|
});
|
|
@@ -88,6 +95,7 @@ export const useApplicationLeadApi = ({
|
|
|
88
95
|
draftDialog.open({
|
|
89
96
|
task,
|
|
90
97
|
isFromLead: true,
|
|
98
|
+
isDebit: productType === 'debitCard',
|
|
91
99
|
sendAspects,
|
|
92
100
|
onClose: sendCurrentTask,
|
|
93
101
|
});
|
|
@@ -129,6 +137,7 @@ const updateUserData = async ({
|
|
|
129
137
|
profileId,
|
|
130
138
|
formData,
|
|
131
139
|
productType,
|
|
140
|
+
referalData,
|
|
132
141
|
saveUserData,
|
|
133
142
|
sendAspects,
|
|
134
143
|
}: {
|
|
@@ -136,18 +145,22 @@ const updateUserData = async ({
|
|
|
136
145
|
profileId: number;
|
|
137
146
|
formData: LeadFormState;
|
|
138
147
|
productType: ProductType;
|
|
148
|
+
referalData: ReferalData | null;
|
|
139
149
|
saveUserData: (userData: UserData) => void;
|
|
140
150
|
sendAspects: (profileId: number, taskId: number) => void;
|
|
141
151
|
}) => {
|
|
142
152
|
let taskId: number;
|
|
143
153
|
let participantId: number;
|
|
144
154
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
155
|
+
const isTaskWithReferalCode = referalData?.isTaskWithReferalCode;
|
|
145
156
|
|
|
146
157
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
147
158
|
|
|
148
159
|
try {
|
|
149
160
|
if (productType === 'debitCard') {
|
|
150
|
-
const debitData = await createUserTaskDebit(
|
|
161
|
+
const debitData = await createUserTaskDebit(
|
|
162
|
+
getDebitLeadFormTaskData(formData, programId, isTaskWithReferalCode),
|
|
163
|
+
);
|
|
151
164
|
|
|
152
165
|
taskId = debitData.taskId;
|
|
153
166
|
participantId = debitData.participantId;
|
|
@@ -165,9 +178,16 @@ const updateUserData = async ({
|
|
|
165
178
|
taskId,
|
|
166
179
|
profileId,
|
|
167
180
|
formData,
|
|
181
|
+
isTaskWithReferalCode,
|
|
168
182
|
}),
|
|
169
183
|
);
|
|
170
184
|
}
|
|
185
|
+
if (isTaskWithReferalCode) {
|
|
186
|
+
await saveReferalInfo({
|
|
187
|
+
taskId,
|
|
188
|
+
...referalData,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
171
191
|
|
|
172
192
|
sendAspects(profileId, taskId);
|
|
173
193
|
saveUserData({ participantId, taskId, profileId, programId, formData });
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
/* eslint-disable max-lines-per-function */
|
|
1
2
|
import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { useSetter } from '../../hooks/useSetter';
|
|
3
4
|
import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
|
|
4
5
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
6
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
5
7
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
8
|
+
import { QUERY_STORAGE_KEY } from '../../utils/getSessionQuery';
|
|
6
9
|
import { EsiaStatuses, type ProductType } from './ApplicationLeadFormContent';
|
|
7
10
|
import { getInitialFormState } from './getInitialFormState';
|
|
8
11
|
import { parseEsiaProfile } from './parseEsiaProfile';
|
|
@@ -24,6 +27,7 @@ export const useInitApplicationLead = ({
|
|
|
24
27
|
}: InitApplicationLeadProps): LeadFormState => {
|
|
25
28
|
const leadFormStore = useLeadFormStore();
|
|
26
29
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
30
|
+
const queryFromStorage = globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY);
|
|
27
31
|
|
|
28
32
|
const initialFormState = useMemo(
|
|
29
33
|
() => getInitialFormState(inputs, leadFormStore.leadForm, esiaAuthSuccess),
|
|
@@ -57,9 +61,26 @@ export const useInitApplicationLead = ({
|
|
|
57
61
|
useEffect(() => {
|
|
58
62
|
leadFormStore.productType = productType;
|
|
59
63
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
const { code, state, referalCode, refererCode, productId } = getLeadQueryParams(
|
|
65
|
+
leadFormStore.referalData,
|
|
66
|
+
queryFromStorage,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (referalCode) {
|
|
70
|
+
leadFormStore.referalData = {
|
|
71
|
+
refererCode,
|
|
72
|
+
referalCode,
|
|
73
|
+
productId,
|
|
74
|
+
isTaskWithReferalCode: true,
|
|
75
|
+
};
|
|
76
|
+
} else if (!code) {
|
|
77
|
+
leadFormStore.referalData = {
|
|
78
|
+
refererCode: null,
|
|
79
|
+
referalCode: null,
|
|
80
|
+
productId: null,
|
|
81
|
+
isTaskWithReferalCode: false,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
63
84
|
|
|
64
85
|
if (code && state) {
|
|
65
86
|
requestEsiaProfile(code, state);
|
|
@@ -67,7 +88,25 @@ export const useInitApplicationLead = ({
|
|
|
67
88
|
sessionStorage.removeItem('accessToken');
|
|
68
89
|
sessionStorage.removeItem('refreshToken');
|
|
69
90
|
}
|
|
70
|
-
}, []);
|
|
91
|
+
}, [queryFromStorage]);
|
|
71
92
|
|
|
72
93
|
return initialFormState;
|
|
73
94
|
};
|
|
95
|
+
|
|
96
|
+
const getLeadQueryParams = (referalData: ReferalData | null, queryFromStorage: string | null) => {
|
|
97
|
+
const queryStorage = new URLSearchParams(decodeURIComponent(queryFromStorage || ''));
|
|
98
|
+
|
|
99
|
+
const code = queryStorage.get('code');
|
|
100
|
+
const state = queryStorage.get('state');
|
|
101
|
+
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
102
|
+
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
103
|
+
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
code,
|
|
107
|
+
state,
|
|
108
|
+
referalCode,
|
|
109
|
+
refererCode,
|
|
110
|
+
productId,
|
|
111
|
+
};
|
|
112
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useLocalStore } from '@redneckz/uni-jsx/lib/Store/useLocalStore';
|
|
2
2
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
3
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
3
4
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
4
5
|
|
|
5
6
|
export interface LeadFormStoreSlice {
|
|
@@ -9,6 +10,7 @@ export interface LeadFormStoreSlice {
|
|
|
9
10
|
participantId: number;
|
|
10
11
|
programId: string;
|
|
11
12
|
productType: ProductType;
|
|
13
|
+
referalData: ReferalData;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export const useLeadFormStore = () => useLocalStore<LeadFormStoreSlice>();
|
|
@@ -6,6 +6,7 @@ import { getFamilyStatusAndIncomeData } from '../../retail/adaptors/getFamilySta
|
|
|
6
6
|
import { getPersonalInfoData } from '../../retail/adaptors/getPersonalInfoData';
|
|
7
7
|
import { type Participant, type UpdateUserTaskBody } from '../../retail/api/updateUserTask';
|
|
8
8
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
9
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
9
10
|
import {
|
|
10
11
|
getDeliveryCreditCardData,
|
|
11
12
|
getDeliveryData,
|
|
@@ -18,6 +19,7 @@ type getCreditCardFormTaskDataProps = {
|
|
|
18
19
|
profileId: number;
|
|
19
20
|
formData: LeadFormState;
|
|
20
21
|
step?: number;
|
|
22
|
+
isTaskWithReferalCode?: ReferalData['isTaskWithReferalCode'];
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export const getCreditCardFormTaskData = ({
|
|
@@ -26,14 +28,16 @@ export const getCreditCardFormTaskData = ({
|
|
|
26
28
|
profileId,
|
|
27
29
|
formData,
|
|
28
30
|
step = 0,
|
|
31
|
+
isTaskWithReferalCode,
|
|
29
32
|
}: getCreditCardFormTaskDataProps): UpdateUserTaskBody => {
|
|
30
33
|
const navigator = locationNavigator();
|
|
34
|
+
const taskSource = isTaskWithReferalCode ? 'ReferalSF' : navigator.origin;
|
|
31
35
|
|
|
32
36
|
return {
|
|
33
37
|
sendToBank: true,
|
|
34
38
|
taskKind: 'UNITED',
|
|
35
39
|
task: {
|
|
36
|
-
taskSource
|
|
40
|
+
taskSource,
|
|
37
41
|
id: taskId,
|
|
38
42
|
...getOfficeCode(formData),
|
|
39
43
|
authorizedAgentId: formData?.bankEmployeeCode,
|
|
@@ -48,6 +48,7 @@ export const useCreditCardFormAPI = ({
|
|
|
48
48
|
async (formData: LeadFormState) => {
|
|
49
49
|
startSending();
|
|
50
50
|
retailFormStore.leadForm = formData;
|
|
51
|
+
const referalData = retailFormStore.referalData;
|
|
51
52
|
|
|
52
53
|
try {
|
|
53
54
|
const { taskId, profileId, participantId } = retailFormStore;
|
|
@@ -59,6 +60,7 @@ export const useCreditCardFormAPI = ({
|
|
|
59
60
|
profileId,
|
|
60
61
|
step,
|
|
61
62
|
formData: formData as any,
|
|
63
|
+
isTaskWithReferalCode: referalData?.isTaskWithReferalCode,
|
|
62
64
|
}),
|
|
63
65
|
);
|
|
64
66
|
resetForm(response);
|
|
@@ -52,6 +52,7 @@ export const useCreditFormAPI = ({
|
|
|
52
52
|
async (formData: LeadFormState) => {
|
|
53
53
|
startSending();
|
|
54
54
|
retailFormStore.leadForm = formData;
|
|
55
|
+
const referalData = retailFormStore.referalData;
|
|
55
56
|
|
|
56
57
|
try {
|
|
57
58
|
const { taskId, profileId, participantId } = retailFormStore;
|
|
@@ -63,6 +64,7 @@ export const useCreditFormAPI = ({
|
|
|
63
64
|
profileId,
|
|
64
65
|
step,
|
|
65
66
|
formData: formData as any,
|
|
67
|
+
isTaskWithReferalCode: referalData?.isTaskWithReferalCode,
|
|
66
68
|
}),
|
|
67
69
|
);
|
|
68
70
|
resetForm(response);
|
|
@@ -4,6 +4,7 @@ import { getPersonalInfoData } from '../../retail/adaptors/getPersonalInfoData';
|
|
|
4
4
|
import { type Participant } from '../../retail/api/updateUserTask';
|
|
5
5
|
import { type UpdateUserTaskDebitBody } from '../../retail/api/updateUserTaskDebit';
|
|
6
6
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
7
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
7
8
|
import {
|
|
8
9
|
getDebitCardData,
|
|
9
10
|
getDeliveryData,
|
|
@@ -18,6 +19,7 @@ type getDebitFormTaskDataProps = {
|
|
|
18
19
|
formData: LeadFormState;
|
|
19
20
|
programId: string;
|
|
20
21
|
step?: number;
|
|
22
|
+
isTaskWithReferalCode?: ReferalData['isTaskWithReferalCode'];
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export const getDebitCardFormTaskData = ({
|
|
@@ -26,12 +28,14 @@ export const getDebitCardFormTaskData = ({
|
|
|
26
28
|
formData,
|
|
27
29
|
programId,
|
|
28
30
|
step = 0,
|
|
31
|
+
isTaskWithReferalCode,
|
|
29
32
|
}: getDebitFormTaskDataProps): UpdateUserTaskDebitBody => {
|
|
30
33
|
const navigator = locationNavigator();
|
|
34
|
+
const taskSource = isTaskWithReferalCode ? 'ReferalSF' : navigator.origin;
|
|
31
35
|
|
|
32
36
|
return {
|
|
33
37
|
task: {
|
|
34
|
-
taskSource
|
|
38
|
+
taskSource,
|
|
35
39
|
id: taskId,
|
|
36
40
|
creditProgram: {
|
|
37
41
|
code: debitProgrammIdToCardCodesMap[programId],
|
|
@@ -40,6 +40,7 @@ export const useDebitFormAPI = ({
|
|
|
40
40
|
async (formData: LeadFormState) => {
|
|
41
41
|
startSending();
|
|
42
42
|
retailFormStore.leadForm = formData;
|
|
43
|
+
const referalData = retailFormStore.referalData;
|
|
43
44
|
|
|
44
45
|
try {
|
|
45
46
|
const { taskId, participantId, programId } = retailFormStore;
|
|
@@ -51,6 +52,7 @@ export const useDebitFormAPI = ({
|
|
|
51
52
|
programId,
|
|
52
53
|
step,
|
|
53
54
|
formData: formData as any,
|
|
55
|
+
isTaskWithReferalCode: referalData?.isTaskWithReferalCode,
|
|
54
56
|
}),
|
|
55
57
|
);
|
|
56
58
|
}
|
package/src/icons/IconName.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const IconsWithoutInversion = new Set([
|
|
|
7
7
|
]);
|
|
8
8
|
|
|
9
9
|
export enum IconMap {
|
|
10
|
-
YoutubeIcon = 'YoutubeIcon', WalletWithMoneyIcon = 'WalletWithMoneyIcon', WalletIcon = 'WalletIcon', WalletAddIcon = 'WalletAddIcon', VKIcon = 'VKIcon', UserTickIcon = 'UserTickIcon', UserSquareIcon = 'UserSquareIcon', UserGeoLocationIcon = 'UserGeoLocationIcon', TelegramIcon = 'TelegramIcon', StarIcon = 'StarIcon', SoundIcon = 'SoundIcon', SmallClockIcon = 'SmallClockIcon', SignDocsIcon = 'SignDocsIcon', ShieldTickIcon = 'ShieldTickIcon', SecurityСardIcon = 'SecurityСardIcon', SafeIcon = 'SafeIcon', RutubeIcon = 'RutubeIcon', RustoreIcon = 'RustoreIcon', RoundRubleIcon = 'RoundRubleIcon', ResponseOKIcon = 'ResponseOKIcon', ResponseFailIcon = 'ResponseFailIcon', RefreshIcon = 'RefreshIcon', ProfileIcon = 'ProfileIcon', Profile2UserIcon = 'Profile2UserIcon', PlusIcon = 'PlusIcon', PlusCircleIcon = 'PlusCircleIcon', PlayMarketIcon = 'PlayMarketIcon', PhoneIcon = 'PhoneIcon', PhoneCallingIcon = 'PhoneCallingIcon', PersonalCardIcon = 'PersonalCardIcon',
|
|
10
|
+
YoutubeIcon = 'YoutubeIcon', WalletWithMoneyIcon = 'WalletWithMoneyIcon', WalletIcon = 'WalletIcon', WalletAddIcon = 'WalletAddIcon', VKIcon = 'VKIcon', UserTickIcon = 'UserTickIcon', UserSquareIcon = 'UserSquareIcon', UserGeoLocationIcon = 'UserGeoLocationIcon', TelegramIcon = 'TelegramIcon', StarIcon = 'StarIcon', SoundIcon = 'SoundIcon', SmallClockIcon = 'SmallClockIcon', SignDocsIcon = 'SignDocsIcon', ShieldTickIcon = 'ShieldTickIcon', SecurityСardIcon = 'SecurityСardIcon', SafeIcon = 'SafeIcon', RutubeIcon = 'RutubeIcon', RustoreIcon = 'RustoreIcon', RoundRubleIcon = 'RoundRubleIcon', ResponseOKIcon = 'ResponseOKIcon', ResponseFailIcon = 'ResponseFailIcon', RefreshIcon = 'RefreshIcon', ProfileIcon = 'ProfileIcon', Profile2UserIcon = 'Profile2UserIcon', PlusIcon = 'PlusIcon', PlusCircleIcon = 'PlusCircleIcon', PlayMarketIcon = 'PlayMarketIcon', PhoneIcon = 'PhoneIcon', PhoneCallingIcon = 'PhoneCallingIcon', PersonalCardIcon = 'PersonalCardIcon', PercentageRoundIcon = 'PercentageRoundIcon', PercentIcon = 'PercentIcon', PassSendIcon = 'PassSendIcon', PackA4Icon = 'PackA4Icon', OkIcon = 'OkIcon', NotificationBingIcon = 'NotificationBingIcon', NewLoanIcon = 'NewLoanIcon', NewDocIcon = 'NewDocIcon', MonitorMobileIcon = 'MonitorMobileIcon', MoneyInsuranceIcon = 'MoneyInsuranceIcon', MoneyIcon = 'MoneyIcon', MinusIcon = 'MinusIcon', MapOpenedIcon = 'MapOpenedIcon', MapMarkerSingleIcon = 'MapMarkerSingleIcon', MapMarkerClusterYellowIcon = 'MapMarkerClusterYellowIcon', MapMarkerClusterIcon = 'MapMarkerClusterIcon', MailIcon = 'MailIcon', MagnifierIcon = 'MagnifierIcon', LoupeIcon = 'LoupeIcon', LogoIcon = 'LogoIcon', LockIcon = 'LockIcon', InfoCircleIcon = 'InfoCircleIcon', HuaweiIcon = 'HuaweiIcon', HouseIcon = 'HouseIcon', HeartTickIcon = 'HeartTickIcon', HeartIcon = 'HeartIcon', HeadphonesIcon = 'HeadphonesIcon', GridIcon = 'GridIcon', GpsIcon = 'GpsIcon', GosUslugiIcon = 'GosUslugiIcon', GlobalIcon = 'GlobalIcon', GeolocationIcon = 'GeolocationIcon', FullScreenIcon = 'FullScreenIcon', FaxIcon = 'FaxIcon', EuroIcon = 'EuroIcon', EmptyWalletIcon = 'EmptyWalletIcon', EmptyWalletChangeIcon = 'EmptyWalletChangeIcon', DzenIcon = 'DzenIcon', DoneSimpleIcon = 'DoneSimpleIcon', DoneIcon = 'DoneIcon', DollarIcon = 'DollarIcon', DocIcon = 'DocIcon', DocDownloadIcon = 'DocDownloadIcon', DiscountShapeIcon = 'DiscountShapeIcon', DevIcon = 'DevIcon', CupIcon = 'CupIcon', CourtHouseIcon = 'CourtHouseIcon', CopyIcon = 'CopyIcon', ConvertCardIcon = 'ConvertCardIcon', CoinIcon = 'CoinIcon', CloseIcon = 'CloseIcon', ClientIcon = 'ClientIcon', ChineseYuanRenminbiIcon = 'ChineseYuanRenminbiIcon', ChevronLeftIcon = 'ChevronLeftIcon', ChatBotIcon = 'ChatBotIcon', ChartSquareIcon = 'ChartSquareIcon', ChartRoundIcon = 'ChartRoundIcon', ChartIcon = 'ChartIcon', CardTickIcon = 'CardTickIcon', CardSendIcon = 'CardSendIcon', CardPosIcon = 'CardPosIcon', CardIcon = 'CardIcon', CalendarTickIcon = 'CalendarTickIcon', CalendarIcon = 'CalendarIcon', CalendarCircleIcon = 'CalendarCircleIcon', BurgerIcon = 'BurgerIcon', BuildingIcon = 'BuildingIcon', BriefcaseIcon = 'BriefcaseIcon', BelarusianFlag = 'BelarusianFlag', BankIcon = 'BankIcon', BankColorIcon = 'BankColorIcon', AtmIcon = 'AtmIcon', ArrowUpSolidIcon = 'ArrowUpSolidIcon', ArrowUpIcon = 'ArrowUpIcon', ArrowTopRightIcon = 'ArrowTopRightIcon', ArrowRightIcon = 'ArrowRightIcon', ArrowLeftIcon = 'ArrowLeftIcon', ArrowDownSolidIcon = 'ArrowDownSolidIcon', ArrowDownIcon = 'ArrowDownIcon', AppleIcon = 'AppleIcon', AlarmIcon = 'AlarmIcon', ActualBalanceIcon = 'ActualBalanceIcon', AchievementIcon = 'AchievementIcon'
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export enum IconTitleMap {
|
|
@@ -22,4 +22,4 @@ export enum IconTitleMap {
|
|
|
22
22
|
* 'Лого «Youtube»', 'Кошелёк с деньгами', 'Кошелёк', 'Кошелёк с плюсом', 'Лого «VK»', 'Пользователь', 'Пользователь в рамке', 'Самолётик', 'Лого «Telegram»', 'Звезда', 'Кольцо', 'Маленькие часы', 'Подписанные документы', 'Безопасность', 'Безопасность', 'Сейф', 'Лого «Rutube»', 'Лого «Rustore»', 'Рубль (круг.)', 'Ок', 'Ошибка', 'RefreshIcon', 'Профиль', 'Профиль, 2 персоны', 'Плюс', 'Плюс в круге', 'Лого «PlayMarket»', 'Телефон', 'Звонящий телефон', 'Персональная карта', 'Проценты (круг.)', 'Проценты', 'Бизнес', 'Пачка бумаги А4', 'Лого «Одноклассники»', 'Колокольчик нотификаций', 'Новая заявка', 'Новый документ', 'Монитор и мобильный', 'Денежное страхование', 'Деньги', 'Минус', 'Иконка Развёрнутая карта', 'Маркер карты РСХБ', 'Маркер карты (желтый)', 'Маркер карты', 'E-mail', 'MagnifierIcon', 'Лупа', 'Логотип', 'Замок', 'InfoCircleIcon', 'Лого «Huawei»', 'Ипотека', 'Сердцебеение', 'Сердце', 'HeadphonesIcon', 'Сетка (белая)', 'Gps', 'ГосУслуги', 'Глобус', 'Геолокация', 'FullScreenIcon', 'Факс', 'Евро', 'Пустой кошелёк', 'Пустой кошелёк с возвратом', 'Лого «Дзен»', 'Зелёная \'галочка\'', 'Зелёная \'галочка\' в круге', 'Доллар', 'Документ', 'Скачать документ', 'Скидка', 'Разработка', 'Кубок', 'Здание суда', 'Копирование', 'Конвертирование', 'Монеты', 'Крестик', 'Клиент', 'Китайский юань', 'Стрелка \'Влево\'', 'Чат-бот', 'Деньги внутри кошелька', 'Диаграмма (в круге)', 'Инвестиции', 'Кред. карта с галочкой', 'Карта', 'Кред. карта под наклоном', 'Кред. карта', 'Календарь с галочкой', 'Календарь', 'Скруглённый календарь', 'Бургер', 'Здание с деревом', 'Портфель', 'Белорусский флаг', 'Банк', 'Банк (в цвете)', 'Банкомат', 'Стрелка сплошная \'Вверх\'', 'Стрелка \'Вверх\'', 'Стрелка \'Вверх-право\'', 'Стрелка \'Вправо\'', 'Стрелка \'Влево\'', 'Стрелка сплошная \'Вниз\'', 'Стрелка \'Вниз\'', 'Лого «Apple»', 'Предупреждение', 'Деньги', 'Достижение'
|
|
23
23
|
* ]
|
|
24
24
|
*/
|
|
25
|
-
export type IconName = '' | 'YoutubeIcon' | 'WalletWithMoneyIcon' | 'WalletIcon' | 'WalletAddIcon' | 'VKIcon' | 'UserTickIcon' | 'UserSquareIcon' | 'UserGeoLocationIcon' | 'TelegramIcon' | 'StarIcon' | 'SoundIcon' | 'SmallClockIcon' | 'SignDocsIcon' | 'ShieldTickIcon' | 'SecurityСardIcon' | 'SafeIcon' | 'RutubeIcon' | 'RustoreIcon' | 'RoundRubleIcon' | 'ResponseOKIcon' | 'ResponseFailIcon' | 'RefreshIcon' | 'ProfileIcon' | 'Profile2UserIcon' | 'PlusIcon' | 'PlusCircleIcon' | 'PlayMarketIcon' | 'PhoneIcon' | 'PhoneCallingIcon' | 'PersonalCardIcon' | '
|
|
25
|
+
export type IconName = '' | 'YoutubeIcon' | 'WalletWithMoneyIcon' | 'WalletIcon' | 'WalletAddIcon' | 'VKIcon' | 'UserTickIcon' | 'UserSquareIcon' | 'UserGeoLocationIcon' | 'TelegramIcon' | 'StarIcon' | 'SoundIcon' | 'SmallClockIcon' | 'SignDocsIcon' | 'ShieldTickIcon' | 'SecurityСardIcon' | 'SafeIcon' | 'RutubeIcon' | 'RustoreIcon' | 'RoundRubleIcon' | 'ResponseOKIcon' | 'ResponseFailIcon' | 'RefreshIcon' | 'ProfileIcon' | 'Profile2UserIcon' | 'PlusIcon' | 'PlusCircleIcon' | 'PlayMarketIcon' | 'PhoneIcon' | 'PhoneCallingIcon' | 'PersonalCardIcon' | 'PercentageRoundIcon' | 'PercentIcon' | 'PassSendIcon' | 'PackA4Icon' | 'OkIcon' | 'NotificationBingIcon' | 'NewLoanIcon' | 'NewDocIcon' | 'MonitorMobileIcon' | 'MoneyInsuranceIcon' | 'MoneyIcon' | 'MinusIcon' | 'MapOpenedIcon' | 'MapMarkerSingleIcon' | 'MapMarkerClusterYellowIcon' | 'MapMarkerClusterIcon' | 'MailIcon' | 'MagnifierIcon' | 'LoupeIcon' | 'LogoIcon' | 'LockIcon' | 'InfoCircleIcon' | 'HuaweiIcon' | 'HouseIcon' | 'HeartTickIcon' | 'HeartIcon' | 'HeadphonesIcon' | 'GridIcon' | 'GpsIcon' | 'GosUslugiIcon' | 'GlobalIcon' | 'GeolocationIcon' | 'FullScreenIcon' | 'FaxIcon' | 'EuroIcon' | 'EmptyWalletIcon' | 'EmptyWalletChangeIcon' | 'DzenIcon' | 'DoneSimpleIcon' | 'DoneIcon' | 'DollarIcon' | 'DocIcon' | 'DocDownloadIcon' | 'DiscountShapeIcon' | 'DevIcon' | 'CupIcon' | 'CourtHouseIcon' | 'CopyIcon' | 'ConvertCardIcon' | 'CoinIcon' | 'CloseIcon' | 'ClientIcon' | 'ChineseYuanRenminbiIcon' | 'ChevronLeftIcon' | 'ChatBotIcon' | 'ChartSquareIcon' | 'ChartRoundIcon' | 'ChartIcon' | 'CardTickIcon' | 'CardSendIcon' | 'CardPosIcon' | 'CardIcon' | 'CalendarTickIcon' | 'CalendarIcon' | 'CalendarCircleIcon' | 'BurgerIcon' | 'BuildingIcon' | 'BriefcaseIcon' | 'BelarusianFlag' | 'BankIcon' | 'BankColorIcon' | 'AtmIcon' | 'ArrowUpSolidIcon' | 'ArrowUpIcon' | 'ArrowTopRightIcon' | 'ArrowRightIcon' | 'ArrowLeftIcon' | 'ArrowDownSolidIcon' | 'ArrowDownIcon' | 'AppleIcon' | 'AlarmIcon' | 'ActualBalanceIcon' | 'AchievementIcon';
|
|
@@ -2,6 +2,7 @@ import { getCalcData } from '../../components/CreditForm/getCalcData';
|
|
|
2
2
|
import { locationNavigator } from '../../external/locationNavigator';
|
|
3
3
|
import { type Participant, type UpdateUserTaskBody } from '../api/updateUserTask';
|
|
4
4
|
import { type LeadFormState } from '../model/LeadFormState';
|
|
5
|
+
import { type ReferalData } from '../model/ReferalData';
|
|
5
6
|
import { getAdditionalInfoData } from './getAdditionalInfoData';
|
|
6
7
|
import { getCalculatorData } from './getCalculatorData';
|
|
7
8
|
import { getDeliveryCreditData } from './getDeliveryCreditData';
|
|
@@ -15,6 +16,7 @@ type getCreditFormTaskDataProps = {
|
|
|
15
16
|
profileId: number;
|
|
16
17
|
formData: LeadFormState;
|
|
17
18
|
step?: number;
|
|
19
|
+
isTaskWithReferalCode?: ReferalData['isTaskWithReferalCode'];
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
export const getCreditFormTaskData = ({
|
|
@@ -23,14 +25,16 @@ export const getCreditFormTaskData = ({
|
|
|
23
25
|
profileId,
|
|
24
26
|
formData,
|
|
25
27
|
step = 0,
|
|
28
|
+
isTaskWithReferalCode,
|
|
26
29
|
}: getCreditFormTaskDataProps): UpdateUserTaskBody => {
|
|
27
30
|
const navigator = locationNavigator();
|
|
31
|
+
const taskSource = isTaskWithReferalCode ? 'ReferalSF' : navigator.origin;
|
|
28
32
|
|
|
29
33
|
return {
|
|
30
34
|
sendToBank: true,
|
|
31
35
|
taskKind: 'UNITED',
|
|
32
36
|
task: {
|
|
33
|
-
taskSource
|
|
37
|
+
taskSource,
|
|
34
38
|
id: taskId,
|
|
35
39
|
authorizedAgentId: formData?.bankEmployeeCode,
|
|
36
40
|
participants: [
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReferalData } from '../model/ReferalData';
|
|
2
|
+
import { doRequest } from './doRequest';
|
|
3
|
+
|
|
4
|
+
export type SaveReferalInfo = ReferalData & {
|
|
5
|
+
taskId: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const saveReferalInfo = (body: SaveReferalInfo) =>
|
|
9
|
+
doRequest('/referal/saveReferalInfo', 'POST', body);
|
|
@@ -15,12 +15,14 @@ import { creditCodesToProgrammIdMap, creditProgramCodeToProductIdMap } from './u
|
|
|
15
15
|
export interface DraftDialogProps extends OnCloseProps {
|
|
16
16
|
task: Task;
|
|
17
17
|
isFromLead?: boolean;
|
|
18
|
+
isDebit?: boolean;
|
|
18
19
|
sendAspects?: (profileId: number, taskId: number) => void;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
22
23
|
task,
|
|
23
24
|
isFromLead = false,
|
|
25
|
+
isDebit = false,
|
|
24
26
|
sendAspects = noop,
|
|
25
27
|
onClose = noop,
|
|
26
28
|
}) {
|
|
@@ -31,21 +33,31 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
|
31
33
|
|
|
32
34
|
const programmId: string = creditProgramCodeToProductIdMap[creditProgram.code];
|
|
33
35
|
const isCredit = Boolean(creditCodesToProgrammIdMap[creditProgram.code]);
|
|
34
|
-
const
|
|
36
|
+
const getNextStepLink = () => {
|
|
37
|
+
if (isDebit) {
|
|
38
|
+
return '/debit-card-lead';
|
|
39
|
+
} else if (isCredit) {
|
|
40
|
+
return '/credit-lead';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return '/credit-card-lead';
|
|
44
|
+
};
|
|
35
45
|
|
|
36
46
|
const { id: participantId, profile } = participants[0];
|
|
37
47
|
|
|
38
48
|
const handleGoToDraft = useCallback(() => {
|
|
39
|
-
const taskFromDraft = parseDraftTask(task);
|
|
49
|
+
const [taskFromDraft, isTaskWithReferalCode] = parseDraftTask(task);
|
|
40
50
|
retailFormStore.participantId = participantId ?? null;
|
|
41
51
|
retailFormStore.taskId = taskId;
|
|
42
52
|
retailFormStore.profileId = profile?.id ?? null;
|
|
43
53
|
retailFormStore.programId = programmId;
|
|
44
54
|
retailFormStore.leadForm = taskFromDraft;
|
|
55
|
+
retailFormStore.referalData = { isTaskWithReferalCode };
|
|
56
|
+
|
|
45
57
|
if (profile?.id) {
|
|
46
58
|
sendAspects(profile.id, taskId);
|
|
47
59
|
}
|
|
48
|
-
navigator.assign(
|
|
60
|
+
navigator.assign(getNextStepLink());
|
|
49
61
|
}, []);
|
|
50
62
|
|
|
51
63
|
const handleGoToNewTask = useCallback(() => {
|
|
@@ -11,13 +11,14 @@ import {
|
|
|
11
11
|
INCOME_CERTIFICATE,
|
|
12
12
|
} from './utils';
|
|
13
13
|
|
|
14
|
-
export const parseDraftTask = (task: Task): LeadFormState => {
|
|
14
|
+
export const parseDraftTask = (task: Task): [LeadFormState, boolean] => {
|
|
15
15
|
const participant = task.participants[0];
|
|
16
16
|
const {
|
|
17
17
|
classCard: cardCategory,
|
|
18
18
|
codeWord,
|
|
19
19
|
paymentSystemTypeCd: paymentSystem,
|
|
20
20
|
currencyCode: currency,
|
|
21
|
+
taskSource,
|
|
21
22
|
} = task;
|
|
22
23
|
|
|
23
24
|
const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
|
|
@@ -71,7 +72,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
|
|
|
71
72
|
profile,
|
|
72
73
|
} = participant;
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
const taskFromDraft = {
|
|
75
76
|
currency: currency?.key,
|
|
76
77
|
paymentSystem: getSelectValue(paymentSystem),
|
|
77
78
|
cardCategory: getSelectValue(cardCategory),
|
|
@@ -128,4 +129,6 @@ export const parseDraftTask = (task: Task): LeadFormState => {
|
|
|
128
129
|
...getParticipantContacts(participantContacts),
|
|
129
130
|
...getParticipantGender(genderCd),
|
|
130
131
|
};
|
|
132
|
+
|
|
133
|
+
return [taskFromDraft, taskSource === 'ReferalSF'];
|
|
131
134
|
};
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import type { OnCloseProps } from '../../../model/OnCloseProps';
|
|
2
1
|
import { useDialog } from '../../../ui-kit/DialogManager/useDialog';
|
|
3
|
-
import { type
|
|
4
|
-
import { DraftDialog } from './DraftDialog';
|
|
2
|
+
import { DraftDialog, type DraftDialogProps } from './DraftDialog';
|
|
5
3
|
import { EmptyDraftDialog } from './EmptyDraftDialog';
|
|
6
4
|
|
|
7
|
-
type useDraftDialogOpenProps = OnCloseProps & {
|
|
8
|
-
task?: Task;
|
|
9
|
-
isFromLead?: boolean;
|
|
10
|
-
sendAspects?: (profileId: number, taskId: number) => void;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
5
|
export const useDraftDialog = () => {
|
|
14
6
|
const { open: openDraftDialog } = useDialog(DraftDialog);
|
|
15
7
|
const { open: openEmptyDraftDialog } = useDialog(EmptyDraftDialog);
|
|
16
8
|
|
|
17
9
|
return {
|
|
18
|
-
open: ({ task, isFromLead, onClose, sendAspects }:
|
|
19
|
-
task
|
|
10
|
+
open: ({ task, isFromLead, isDebit, onClose, sendAspects }: Partial<DraftDialogProps>) => {
|
|
11
|
+
task
|
|
12
|
+
? openDraftDialog({ task, isFromLead, isDebit, onClose, sendAspects })
|
|
13
|
+
: openEmptyDraftDialog({});
|
|
20
14
|
},
|
|
21
15
|
};
|
|
22
16
|
};
|