@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/useInit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E,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAChF,CAAC;IAEF,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACtF,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACtF,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEhF,OAAO;QACL,IAAI;QACJ,KAAK;QACL,WAAW;QACX,WAAW;QACX,SAAS;KACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -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"}
|
|
@@ -17,5 +17,5 @@ export interface OfficesAtmsMapLayoutProps<T> extends ComponentType, TitleProps
|
|
|
17
17
|
initFilterState?: InitFilterState;
|
|
18
18
|
descriptionData?: AtmsDef;
|
|
19
19
|
}
|
|
20
|
-
export declare const OfficesAtmsMapLayout: import("@redneckz/uni-jsx").UNIComponent<OfficesAtmsMapLayoutProps<
|
|
20
|
+
export declare const OfficesAtmsMapLayout: import("@redneckz/uni-jsx").UNIComponent<OfficesAtmsMapLayoutProps<Atm | Branch | RemoteWorkplace>, any, any>;
|
|
21
21
|
export declare const getFiltersWithNonEmptyData: (data: (Branch | Atm | RemoteWorkplace)[]) => string[];
|
|
@@ -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"}
|
|
@@ -5658,8 +5658,8 @@
|
|
|
5658
5658
|
};
|
|
5659
5659
|
|
|
5660
5660
|
/* eslint-disable camelcase */
|
|
5661
|
-
const getCreditLeadFormTaskData = ({ participantId, taskId, profileId, formData, }) => {
|
|
5662
|
-
const { name, surname, middleName, limitedBirthday, phone, email
|
|
5661
|
+
const getCreditLeadFormTaskData = ({ participantId, taskId, profileId, formData, referalCode, }) => {
|
|
5662
|
+
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
5663
5663
|
const navigator = locationNavigator();
|
|
5664
5664
|
const taskSource = referalCode ? 'ReferalSF' : navigator.origin;
|
|
5665
5665
|
return {
|
|
@@ -5766,6 +5766,7 @@
|
|
|
5766
5766
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
5767
5767
|
const [ok, setOK] = useState();
|
|
5768
5768
|
const saveUserData = useSaveUserData();
|
|
5769
|
+
const leadFormStore = useLeadFormStore();
|
|
5769
5770
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
5770
5771
|
const navigator = locationNavigator();
|
|
5771
5772
|
const goToNextStep = useCallback(() => {
|
|
@@ -5781,6 +5782,7 @@
|
|
|
5781
5782
|
const profileId = await createUserProfile({
|
|
5782
5783
|
profile: { phone: formatPhone(transformedFormData.phone) },
|
|
5783
5784
|
});
|
|
5785
|
+
const referalData = leadFormStore.referalData;
|
|
5784
5786
|
if (!profileId) {
|
|
5785
5787
|
throw new Error();
|
|
5786
5788
|
}
|
|
@@ -5790,6 +5792,7 @@
|
|
|
5790
5792
|
profileId,
|
|
5791
5793
|
formData: transformedFormData,
|
|
5792
5794
|
productType,
|
|
5795
|
+
referalData,
|
|
5793
5796
|
saveUserData,
|
|
5794
5797
|
sendAspects,
|
|
5795
5798
|
});
|
|
@@ -5844,13 +5847,11 @@
|
|
|
5844
5847
|
.filter((_) => formData[_])
|
|
5845
5848
|
.map((_) => consents[_]?.text);
|
|
5846
5849
|
};
|
|
5847
|
-
const updateUserData = async ({ programId, profileId, formData, productType, saveUserData, sendAspects, }) => {
|
|
5850
|
+
const updateUserData = async ({ programId, profileId, formData, productType, referalData, saveUserData, sendAspects, }) => {
|
|
5848
5851
|
let taskId;
|
|
5849
5852
|
let participantId;
|
|
5850
|
-
const refererCode = formData.refererCode;
|
|
5851
|
-
const referalCode = formData.referalCode;
|
|
5852
|
-
const productId = formData.productId;
|
|
5853
5853
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
5854
|
+
const referalCode = referalData?.referalCode;
|
|
5854
5855
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
5855
5856
|
try {
|
|
5856
5857
|
if (productType === 'debitCard') {
|
|
@@ -5870,13 +5871,12 @@
|
|
|
5870
5871
|
taskId,
|
|
5871
5872
|
profileId,
|
|
5872
5873
|
formData,
|
|
5874
|
+
referalCode,
|
|
5873
5875
|
}));
|
|
5874
5876
|
if (referalCode) {
|
|
5875
5877
|
await saveReferalInfo({
|
|
5876
5878
|
taskId,
|
|
5877
|
-
|
|
5878
|
-
referalCode,
|
|
5879
|
-
productId,
|
|
5879
|
+
...referalData,
|
|
5880
5880
|
});
|
|
5881
5881
|
}
|
|
5882
5882
|
}
|
|
@@ -5955,9 +5955,6 @@
|
|
|
5955
5955
|
consentInformMaterialsFlg: false,
|
|
5956
5956
|
consentPhotoFlg: false,
|
|
5957
5957
|
consentFATCA: false,
|
|
5958
|
-
refererCode: '',
|
|
5959
|
-
referalCode: '',
|
|
5960
|
-
productId: '',
|
|
5961
5958
|
};
|
|
5962
5959
|
const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
|
|
5963
5960
|
if (savedForm) {
|
|
@@ -6146,6 +6143,7 @@
|
|
|
6146
6143
|
return data.every(Boolean);
|
|
6147
6144
|
};
|
|
6148
6145
|
|
|
6146
|
+
/* eslint-disable max-lines-per-function */
|
|
6149
6147
|
const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
|
|
6150
6148
|
const leadFormStore = useLeadFormStore();
|
|
6151
6149
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
@@ -6172,25 +6170,22 @@
|
|
|
6172
6170
|
setEsiaStatus(EsiaStatuses.Error);
|
|
6173
6171
|
}
|
|
6174
6172
|
}, []);
|
|
6175
|
-
const saveReferalData = useCallback((referalData) => {
|
|
6176
|
-
saveForm((_) => ({
|
|
6177
|
-
..._,
|
|
6178
|
-
...referalData,
|
|
6179
|
-
}));
|
|
6180
|
-
}, []);
|
|
6181
6173
|
useEffect(() => {
|
|
6182
6174
|
leadFormStore.productType = productType;
|
|
6183
|
-
const
|
|
6184
|
-
const code = params.get('code');
|
|
6185
|
-
const state = params.get('state');
|
|
6186
|
-
const referalCode = params.get('referalCode');
|
|
6175
|
+
const { code, state, referalCode, refererCode, productId } = getLeadQueryParams(leadFormStore.referalData);
|
|
6187
6176
|
if (referalCode) {
|
|
6188
|
-
|
|
6189
|
-
refererCode
|
|
6177
|
+
leadFormStore.referalData = {
|
|
6178
|
+
refererCode,
|
|
6190
6179
|
referalCode,
|
|
6191
|
-
productId
|
|
6180
|
+
productId,
|
|
6181
|
+
};
|
|
6182
|
+
}
|
|
6183
|
+
else if (!code) {
|
|
6184
|
+
leadFormStore.referalData = {
|
|
6185
|
+
refererCode: null,
|
|
6186
|
+
referalCode: null,
|
|
6187
|
+
productId: null,
|
|
6192
6188
|
};
|
|
6193
|
-
saveReferalData(referalData);
|
|
6194
6189
|
}
|
|
6195
6190
|
if (code && state) {
|
|
6196
6191
|
requestEsiaProfile(code, state);
|
|
@@ -6201,6 +6196,21 @@
|
|
|
6201
6196
|
}
|
|
6202
6197
|
}, []);
|
|
6203
6198
|
return initialFormState;
|
|
6199
|
+
};
|
|
6200
|
+
const getLeadQueryParams = (referalData) => {
|
|
6201
|
+
const queryStorage = new URLSearchParams(decodeURIComponent(globalThis.sessionStorage?.getItem(QUERY_STORAGE_KEY) || ''));
|
|
6202
|
+
const code = queryStorage.get('code');
|
|
6203
|
+
const state = queryStorage.get('state');
|
|
6204
|
+
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
6205
|
+
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
6206
|
+
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
6207
|
+
return {
|
|
6208
|
+
code,
|
|
6209
|
+
state,
|
|
6210
|
+
referalCode,
|
|
6211
|
+
refererCode,
|
|
6212
|
+
productId,
|
|
6213
|
+
};
|
|
6204
6214
|
};
|
|
6205
6215
|
|
|
6206
6216
|
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
|