@redneckz/wildless-cms-uni-blocks 0.16.6-credit → 0.16.7-credit
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 +36 -26
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +3 -1
- package/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/bundle/retail/api/saveReferalInfo.d.ts +2 -4
- package/bundle/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/bundle/retail/model/LeadFormState.d.ts +0 -3
- package/bundle/retail/model/ReferalData.d.ts +6 -0
- package/bundle/utils/getSessionQuery.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +0 -3
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +3 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +28 -14
- 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/retail/api/saveReferalInfo.d.ts +2 -4
- package/dist/retail/api/saveReferalInfo.js.map +1 -1
- package/dist/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/dist/retail/model/LeadFormState.d.ts +0 -3
- package/dist/retail/model/ReferalData.d.ts +6 -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/ApplicationLeadForm/getInitialFormState.js +0 -3
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +3 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +28 -14
- 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/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/retail/api/saveReferalInfo.d.ts +2 -4
- package/lib/retail/api/saveReferalInfo.js.map +1 -1
- package/lib/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/lib/retail/model/LeadFormState.d.ts +0 -3
- package/lib/retail/model/ReferalData.d.ts +6 -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 +36 -26
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +3 -1
- package/mobile/bundle/components/ApplicationLeadForm/useLeadFormStore.d.ts +3 -0
- package/mobile/bundle/retail/api/saveReferalInfo.d.ts +2 -4
- package/mobile/bundle/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/mobile/bundle/retail/model/LeadFormState.d.ts +0 -3
- package/mobile/bundle/retail/model/ReferalData.d.ts +6 -0
- package/mobile/bundle/utils/getSessionQuery.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +0 -3
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +3 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +28 -14
- 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/retail/api/saveReferalInfo.d.ts +2 -4
- package/mobile/dist/retail/api/saveReferalInfo.js.map +1 -1
- package/mobile/dist/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/mobile/dist/retail/model/LeadFormState.d.ts +0 -3
- package/mobile/dist/retail/model/ReferalData.d.ts +6 -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/getInitialFormState.js +0 -3
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +3 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +28 -14
- 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/retail/api/saveReferalInfo.d.ts +2 -4
- package/mobile/lib/retail/api/saveReferalInfo.js.map +1 -1
- package/mobile/lib/retail/hooks/useRetailFormStore.d.ts +1 -0
- package/mobile/lib/retail/model/LeadFormState.d.ts +0 -3
- package/mobile/lib/retail/model/ReferalData.d.ts +6 -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/ApplicationLeadForm/getInitialFormState.tsx +0 -3
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +4 -1
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +11 -6
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +35 -15
- package/mobile/src/components/ApplicationLeadForm/useLeadFormStore.ts +2 -0
- package/mobile/src/retail/api/saveReferalInfo.ts +2 -4
- package/mobile/src/retail/model/LeadFormState.ts +0 -3
- package/mobile/src/retail/model/ReferalData.ts +7 -0
- package/mobile/src/utils/getSessionQuery.ts +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +0 -3
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +4 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +11 -6
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +35 -15
- package/src/components/ApplicationLeadForm/useLeadFormStore.ts +2 -0
- package/src/retail/api/saveReferalInfo.ts +2 -4
- package/src/retail/model/LeadFormState.ts +0 -3
- package/src/retail/model/ReferalData.ts +7 -0
- package/src/utils/getSessionQuery.ts +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
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.js';
|
|
3
4
|
import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile.js';
|
|
5
|
+
import { QUERY_STORAGE_KEY } from '../../utils/getSessionQuery.js';
|
|
4
6
|
import { EsiaStatuses } from './ApplicationLeadFormContent.js';
|
|
5
7
|
import { getInitialFormState } from './getInitialFormState.js';
|
|
6
8
|
import { parseEsiaProfile } from './parseEsiaProfile.js';
|
|
@@ -31,25 +33,22 @@ export const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esi
|
|
|
31
33
|
setEsiaStatus(EsiaStatuses.Error);
|
|
32
34
|
}
|
|
33
35
|
}, []);
|
|
34
|
-
const saveReferalData = useCallback((referalData) => {
|
|
35
|
-
saveForm((_) => ({
|
|
36
|
-
..._,
|
|
37
|
-
...referalData,
|
|
38
|
-
}));
|
|
39
|
-
}, []);
|
|
40
36
|
useEffect(() => {
|
|
41
37
|
leadFormStore.productType = productType;
|
|
42
|
-
const
|
|
43
|
-
const code = params.get('code');
|
|
44
|
-
const state = params.get('state');
|
|
45
|
-
const referalCode = params.get('referalCode');
|
|
38
|
+
const { code, state, referalCode, refererCode, productId } = getLeadQueryParams(leadFormStore.referalData);
|
|
46
39
|
if (referalCode) {
|
|
47
|
-
|
|
48
|
-
refererCode
|
|
40
|
+
leadFormStore.referalData = {
|
|
41
|
+
refererCode,
|
|
49
42
|
referalCode,
|
|
50
|
-
productId
|
|
43
|
+
productId,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
else if (!code) {
|
|
47
|
+
leadFormStore.referalData = {
|
|
48
|
+
refererCode: null,
|
|
49
|
+
referalCode: null,
|
|
50
|
+
productId: null,
|
|
51
51
|
};
|
|
52
|
-
saveReferalData(referalData);
|
|
53
52
|
}
|
|
54
53
|
if (code && state) {
|
|
55
54
|
requestEsiaProfile(code, state);
|
|
@@ -61,4 +60,19 @@ export const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esi
|
|
|
61
60
|
}, []);
|
|
62
61
|
return initialFormState;
|
|
63
62
|
};
|
|
63
|
+
const getLeadQueryParams = (referalData) => {
|
|
64
|
+
const queryStorage = new URLSearchParams(decodeURIComponent(globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || ''));
|
|
65
|
+
const code = queryStorage.get('code');
|
|
66
|
+
const state = queryStorage.get('state');
|
|
67
|
+
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
68
|
+
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
69
|
+
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
70
|
+
return {
|
|
71
|
+
code,
|
|
72
|
+
state,
|
|
73
|
+
referalCode,
|
|
74
|
+
refererCode,
|
|
75
|
+
productId,
|
|
76
|
+
};
|
|
77
|
+
};
|
|
64
78
|
//# sourceMappingURL=useInitApplicationLead.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitApplicationLead.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/useInitApplicationLead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"useInitApplicationLead.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/useInitApplicationLead.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
2
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
2
3
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
3
4
|
export interface LeadFormStoreSlice {
|
|
4
5
|
leadForm: LeadFormState;
|
|
@@ -7,6 +8,7 @@ export interface LeadFormStoreSlice {
|
|
|
7
8
|
participantId: number;
|
|
8
9
|
programId: string;
|
|
9
10
|
productType: ProductType;
|
|
11
|
+
referalData: ReferalData;
|
|
10
12
|
}
|
|
11
13
|
export declare const useLeadFormStore: () => {
|
|
12
14
|
leadForm: LeadFormState | null;
|
|
@@ -15,4 +17,5 @@ export declare const useLeadFormStore: () => {
|
|
|
15
17
|
participantId: number | null;
|
|
16
18
|
programId: string | null;
|
|
17
19
|
productType: ProductType | null;
|
|
20
|
+
referalData: ReferalData | null;
|
|
18
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLeadFormStore.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/useLeadFormStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"useLeadFormStore.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/useLeadFormStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAe1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,aAAa,EAAsB,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReferalData } from '../model/ReferalData';
|
|
2
|
+
export declare type SaveReferalInfo = ReferalData & {
|
|
2
3
|
taskId: number;
|
|
3
|
-
refererCode?: string;
|
|
4
|
-
referalCode?: string;
|
|
5
|
-
productId?: string;
|
|
6
4
|
};
|
|
7
5
|
export declare const saveReferalInfo: (body: SaveReferalInfo) => Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveReferalInfo.js","sourceRoot":"","sources":["../../../src/retail/api/saveReferalInfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"saveReferalInfo.js","sourceRoot":"","sources":["../../../src/retail/api/saveReferalInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,EAAE,CACvD,SAAS,CAAC,0BAA0B,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -36,4 +36,5 @@ export declare const useRetailFormStore: () => {
|
|
|
36
36
|
participantId: number | null;
|
|
37
37
|
programId: string | null;
|
|
38
38
|
productType: import("../../components/ApplicationLeadForm/ApplicationLeadFormContent").ProductType | null;
|
|
39
|
+
referalData: import("../model/ReferalData").ReferalData | null;
|
|
39
40
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferalData.js","sourceRoot":"","sources":["../../../src/retail/model/ReferalData.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSessionQuery.js","sourceRoot":"","sources":["../../src/utils/getSessionQuery.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"getSessionQuery.js","sourceRoot":"","sources":["../../src/utils/getSessionQuery.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GACV,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;IAE7F,IAAI,MAAM,EAAE;QACV,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;KAC/D;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { getParticipantContacts } from '../../retail/adaptors/utils';
|
|
|
4
4
|
import { type CreateUserTaskDebitBody } from '../../retail/api/createUserTaskDebit';
|
|
5
5
|
import { type MarketingInfo, type UpdateUserTaskBody } from '../../retail/api/updateUserTask';
|
|
6
6
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
7
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
7
8
|
import { formatDate } from '../../utils/formatDate';
|
|
8
9
|
import { formatPhone } from '../../utils/formatPhone';
|
|
9
10
|
import { debitProgrammIdToCardCodesMap } from '../DebitForm/utils';
|
|
@@ -13,6 +14,7 @@ type getLeadFormTaskDataProps = {
|
|
|
13
14
|
taskId: number;
|
|
14
15
|
profileId: number;
|
|
15
16
|
formData: LeadFormState;
|
|
17
|
+
referalCode?: ReferalData['refererCode'];
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export const getCreditLeadFormTaskData = ({
|
|
@@ -20,8 +22,9 @@ export const getCreditLeadFormTaskData = ({
|
|
|
20
22
|
taskId,
|
|
21
23
|
profileId,
|
|
22
24
|
formData,
|
|
25
|
+
referalCode,
|
|
23
26
|
}: getLeadFormTaskDataProps): UpdateUserTaskBody => {
|
|
24
|
-
const { name, surname, middleName, limitedBirthday, phone, email
|
|
27
|
+
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
25
28
|
const navigator = locationNavigator();
|
|
26
29
|
const taskSource = referalCode ? 'ReferalSF' : navigator.origin;
|
|
27
30
|
|
|
@@ -15,12 +15,14 @@ import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/us
|
|
|
15
15
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
16
16
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
17
17
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
18
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
18
19
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
19
20
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
20
21
|
import { formatPhone } from '../../utils/formatPhone';
|
|
21
22
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
22
23
|
import { productTypeToConsentsMap } from './consents';
|
|
23
24
|
import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
|
|
25
|
+
import { useLeadFormStore } from './useLeadFormStore';
|
|
24
26
|
import { useSaveUserData, type UserData } from './useSaveUserData';
|
|
25
27
|
import { useSendLeadFormAspects } from './useSendLeadFormAspects';
|
|
26
28
|
|
|
@@ -40,6 +42,8 @@ export const useApplicationLeadApi = ({
|
|
|
40
42
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
41
43
|
const [ok, setOK] = useState<boolean | undefined>();
|
|
42
44
|
const saveUserData = useSaveUserData();
|
|
45
|
+
const leadFormStore = useLeadFormStore();
|
|
46
|
+
|
|
43
47
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
44
48
|
const navigator = locationNavigator();
|
|
45
49
|
|
|
@@ -58,6 +62,7 @@ export const useApplicationLeadApi = ({
|
|
|
58
62
|
const profileId = await createUserProfile({
|
|
59
63
|
profile: { phone: formatPhone(transformedFormData.phone as string) },
|
|
60
64
|
});
|
|
65
|
+
const referalData = leadFormStore.referalData;
|
|
61
66
|
|
|
62
67
|
if (!profileId) {
|
|
63
68
|
throw new Error();
|
|
@@ -69,6 +74,7 @@ export const useApplicationLeadApi = ({
|
|
|
69
74
|
profileId,
|
|
70
75
|
formData: transformedFormData,
|
|
71
76
|
productType,
|
|
77
|
+
referalData,
|
|
72
78
|
saveUserData,
|
|
73
79
|
sendAspects,
|
|
74
80
|
});
|
|
@@ -130,6 +136,7 @@ const updateUserData = async ({
|
|
|
130
136
|
profileId,
|
|
131
137
|
formData,
|
|
132
138
|
productType,
|
|
139
|
+
referalData,
|
|
133
140
|
saveUserData,
|
|
134
141
|
sendAspects,
|
|
135
142
|
}: {
|
|
@@ -137,15 +144,14 @@ const updateUserData = async ({
|
|
|
137
144
|
profileId: number;
|
|
138
145
|
formData: LeadFormState;
|
|
139
146
|
productType: ProductType;
|
|
147
|
+
referalData: ReferalData | null;
|
|
140
148
|
saveUserData: (userData: UserData) => void;
|
|
141
149
|
sendAspects: (profileId: number, taskId: number) => void;
|
|
142
150
|
}) => {
|
|
143
151
|
let taskId: number;
|
|
144
152
|
let participantId: number;
|
|
145
|
-
const refererCode = formData.refererCode;
|
|
146
|
-
const referalCode = formData.referalCode;
|
|
147
|
-
const productId = formData.productId;
|
|
148
153
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
154
|
+
const referalCode = referalData?.referalCode;
|
|
149
155
|
|
|
150
156
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
151
157
|
|
|
@@ -169,14 +175,13 @@ const updateUserData = async ({
|
|
|
169
175
|
taskId,
|
|
170
176
|
profileId,
|
|
171
177
|
formData,
|
|
178
|
+
referalCode,
|
|
172
179
|
}),
|
|
173
180
|
);
|
|
174
181
|
if (referalCode) {
|
|
175
182
|
await saveReferalInfo({
|
|
176
183
|
taskId,
|
|
177
|
-
|
|
178
|
-
referalCode,
|
|
179
|
-
productId,
|
|
184
|
+
...referalData,
|
|
180
185
|
});
|
|
181
186
|
}
|
|
182
187
|
}
|
|
@@ -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';
|
|
@@ -54,28 +57,25 @@ export const useInitApplicationLead = ({
|
|
|
54
57
|
}
|
|
55
58
|
}, []);
|
|
56
59
|
|
|
57
|
-
const saveReferalData = useCallback((referalData: Record<string, string | null>) => {
|
|
58
|
-
saveForm((_) => ({
|
|
59
|
-
..._,
|
|
60
|
-
...referalData,
|
|
61
|
-
}));
|
|
62
|
-
}, []);
|
|
63
|
-
|
|
64
60
|
useEffect(() => {
|
|
65
61
|
leadFormStore.productType = productType;
|
|
66
62
|
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const referalCode = params.get('referalCode');
|
|
63
|
+
const { code, state, referalCode, refererCode, productId } = getLeadQueryParams(
|
|
64
|
+
leadFormStore.referalData,
|
|
65
|
+
);
|
|
71
66
|
|
|
72
67
|
if (referalCode) {
|
|
73
|
-
|
|
74
|
-
refererCode
|
|
68
|
+
leadFormStore.referalData = {
|
|
69
|
+
refererCode,
|
|
75
70
|
referalCode,
|
|
76
|
-
productId
|
|
71
|
+
productId,
|
|
72
|
+
};
|
|
73
|
+
} else if (!code) {
|
|
74
|
+
leadFormStore.referalData = {
|
|
75
|
+
refererCode: null,
|
|
76
|
+
referalCode: null,
|
|
77
|
+
productId: null,
|
|
77
78
|
};
|
|
78
|
-
saveReferalData(referalData);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (code && state) {
|
|
@@ -88,3 +88,23 @@ export const useInitApplicationLead = ({
|
|
|
88
88
|
|
|
89
89
|
return initialFormState;
|
|
90
90
|
};
|
|
91
|
+
|
|
92
|
+
const getLeadQueryParams = (referalData: ReferalData | null) => {
|
|
93
|
+
const queryStorage = new URLSearchParams(
|
|
94
|
+
decodeURIComponent(globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || ''),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const code = queryStorage.get('code');
|
|
98
|
+
const state = queryStorage.get('state');
|
|
99
|
+
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
100
|
+
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
101
|
+
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
code,
|
|
105
|
+
state,
|
|
106
|
+
referalCode,
|
|
107
|
+
refererCode,
|
|
108
|
+
productId,
|
|
109
|
+
};
|
|
110
|
+
};
|
|
@@ -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>();
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { type ReferalData } from '../model/ReferalData';
|
|
1
2
|
import { doRequest } from './doRequest';
|
|
2
3
|
|
|
3
|
-
export type SaveReferalInfo = {
|
|
4
|
+
export type SaveReferalInfo = ReferalData & {
|
|
4
5
|
taskId: number;
|
|
5
|
-
refererCode?: string;
|
|
6
|
-
referalCode?: string;
|
|
7
|
-
productId?: string;
|
|
8
6
|
};
|
|
9
7
|
|
|
10
8
|
export const saveReferalInfo = (body: SaveReferalInfo) =>
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { getParticipantContacts } from '../../retail/adaptors/utils';
|
|
|
4
4
|
import { type CreateUserTaskDebitBody } from '../../retail/api/createUserTaskDebit';
|
|
5
5
|
import { type MarketingInfo, type UpdateUserTaskBody } from '../../retail/api/updateUserTask';
|
|
6
6
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
7
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
7
8
|
import { formatDate } from '../../utils/formatDate';
|
|
8
9
|
import { formatPhone } from '../../utils/formatPhone';
|
|
9
10
|
import { debitProgrammIdToCardCodesMap } from '../DebitForm/utils';
|
|
@@ -13,6 +14,7 @@ type getLeadFormTaskDataProps = {
|
|
|
13
14
|
taskId: number;
|
|
14
15
|
profileId: number;
|
|
15
16
|
formData: LeadFormState;
|
|
17
|
+
referalCode?: ReferalData['refererCode'];
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export const getCreditLeadFormTaskData = ({
|
|
@@ -20,8 +22,9 @@ export const getCreditLeadFormTaskData = ({
|
|
|
20
22
|
taskId,
|
|
21
23
|
profileId,
|
|
22
24
|
formData,
|
|
25
|
+
referalCode,
|
|
23
26
|
}: getLeadFormTaskDataProps): UpdateUserTaskBody => {
|
|
24
|
-
const { name, surname, middleName, limitedBirthday, phone, email
|
|
27
|
+
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
25
28
|
const navigator = locationNavigator();
|
|
26
29
|
const taskSource = referalCode ? 'ReferalSF' : navigator.origin;
|
|
27
30
|
|
|
@@ -15,12 +15,14 @@ import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/us
|
|
|
15
15
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
16
16
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
17
17
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
18
|
+
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
18
19
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
19
20
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
20
21
|
import { formatPhone } from '../../utils/formatPhone';
|
|
21
22
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
22
23
|
import { productTypeToConsentsMap } from './consents';
|
|
23
24
|
import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
|
|
25
|
+
import { useLeadFormStore } from './useLeadFormStore';
|
|
24
26
|
import { useSaveUserData, type UserData } from './useSaveUserData';
|
|
25
27
|
import { useSendLeadFormAspects } from './useSendLeadFormAspects';
|
|
26
28
|
|
|
@@ -40,6 +42,8 @@ export const useApplicationLeadApi = ({
|
|
|
40
42
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
41
43
|
const [ok, setOK] = useState<boolean | undefined>();
|
|
42
44
|
const saveUserData = useSaveUserData();
|
|
45
|
+
const leadFormStore = useLeadFormStore();
|
|
46
|
+
|
|
43
47
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
44
48
|
const navigator = locationNavigator();
|
|
45
49
|
|
|
@@ -58,6 +62,7 @@ export const useApplicationLeadApi = ({
|
|
|
58
62
|
const profileId = await createUserProfile({
|
|
59
63
|
profile: { phone: formatPhone(transformedFormData.phone as string) },
|
|
60
64
|
});
|
|
65
|
+
const referalData = leadFormStore.referalData;
|
|
61
66
|
|
|
62
67
|
if (!profileId) {
|
|
63
68
|
throw new Error();
|
|
@@ -69,6 +74,7 @@ export const useApplicationLeadApi = ({
|
|
|
69
74
|
profileId,
|
|
70
75
|
formData: transformedFormData,
|
|
71
76
|
productType,
|
|
77
|
+
referalData,
|
|
72
78
|
saveUserData,
|
|
73
79
|
sendAspects,
|
|
74
80
|
});
|
|
@@ -130,6 +136,7 @@ const updateUserData = async ({
|
|
|
130
136
|
profileId,
|
|
131
137
|
formData,
|
|
132
138
|
productType,
|
|
139
|
+
referalData,
|
|
133
140
|
saveUserData,
|
|
134
141
|
sendAspects,
|
|
135
142
|
}: {
|
|
@@ -137,15 +144,14 @@ const updateUserData = async ({
|
|
|
137
144
|
profileId: number;
|
|
138
145
|
formData: LeadFormState;
|
|
139
146
|
productType: ProductType;
|
|
147
|
+
referalData: ReferalData | null;
|
|
140
148
|
saveUserData: (userData: UserData) => void;
|
|
141
149
|
sendAspects: (profileId: number, taskId: number) => void;
|
|
142
150
|
}) => {
|
|
143
151
|
let taskId: number;
|
|
144
152
|
let participantId: number;
|
|
145
|
-
const refererCode = formData.refererCode;
|
|
146
|
-
const referalCode = formData.referalCode;
|
|
147
|
-
const productId = formData.productId;
|
|
148
153
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
154
|
+
const referalCode = referalData?.referalCode;
|
|
149
155
|
|
|
150
156
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
151
157
|
|
|
@@ -169,14 +175,13 @@ const updateUserData = async ({
|
|
|
169
175
|
taskId,
|
|
170
176
|
profileId,
|
|
171
177
|
formData,
|
|
178
|
+
referalCode,
|
|
172
179
|
}),
|
|
173
180
|
);
|
|
174
181
|
if (referalCode) {
|
|
175
182
|
await saveReferalInfo({
|
|
176
183
|
taskId,
|
|
177
|
-
|
|
178
|
-
referalCode,
|
|
179
|
-
productId,
|
|
184
|
+
...referalData,
|
|
180
185
|
});
|
|
181
186
|
}
|
|
182
187
|
}
|
|
@@ -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';
|
|
@@ -54,28 +57,25 @@ export const useInitApplicationLead = ({
|
|
|
54
57
|
}
|
|
55
58
|
}, []);
|
|
56
59
|
|
|
57
|
-
const saveReferalData = useCallback((referalData: Record<string, string | null>) => {
|
|
58
|
-
saveForm((_) => ({
|
|
59
|
-
..._,
|
|
60
|
-
...referalData,
|
|
61
|
-
}));
|
|
62
|
-
}, []);
|
|
63
|
-
|
|
64
60
|
useEffect(() => {
|
|
65
61
|
leadFormStore.productType = productType;
|
|
66
62
|
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const referalCode = params.get('referalCode');
|
|
63
|
+
const { code, state, referalCode, refererCode, productId } = getLeadQueryParams(
|
|
64
|
+
leadFormStore.referalData,
|
|
65
|
+
);
|
|
71
66
|
|
|
72
67
|
if (referalCode) {
|
|
73
|
-
|
|
74
|
-
refererCode
|
|
68
|
+
leadFormStore.referalData = {
|
|
69
|
+
refererCode,
|
|
75
70
|
referalCode,
|
|
76
|
-
productId
|
|
71
|
+
productId,
|
|
72
|
+
};
|
|
73
|
+
} else if (!code) {
|
|
74
|
+
leadFormStore.referalData = {
|
|
75
|
+
refererCode: null,
|
|
76
|
+
referalCode: null,
|
|
77
|
+
productId: null,
|
|
77
78
|
};
|
|
78
|
-
saveReferalData(referalData);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (code && state) {
|
|
@@ -88,3 +88,23 @@ export const useInitApplicationLead = ({
|
|
|
88
88
|
|
|
89
89
|
return initialFormState;
|
|
90
90
|
};
|
|
91
|
+
|
|
92
|
+
const getLeadQueryParams = (referalData: ReferalData | null) => {
|
|
93
|
+
const queryStorage = new URLSearchParams(
|
|
94
|
+
decodeURIComponent(globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || ''),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const code = queryStorage.get('code');
|
|
98
|
+
const state = queryStorage.get('state');
|
|
99
|
+
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
100
|
+
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
101
|
+
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
code,
|
|
105
|
+
state,
|
|
106
|
+
referalCode,
|
|
107
|
+
refererCode,
|
|
108
|
+
productId,
|
|
109
|
+
};
|
|
110
|
+
};
|
|
@@ -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>();
|