@redneckz/wildless-cms-uni-blocks 0.14.636 → 0.14.637
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/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/bundle/bundle.umd.js +54 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/dist/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +52 -0
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +49 -0
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/mobile/bundle/bundle.umd.js +54 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/mobile/dist/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +52 -0
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +49 -0
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateProfileEsia.ts +7 -7
- package/mobile/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +69 -0
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -3
- package/package.json +1 -1
- package/src/api/RetailAPI/updateProfileEsia.ts +7 -7
- package/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +69 -0
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -3
|
@@ -11,7 +11,7 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
11
11
|
surname: string;
|
|
12
12
|
name: string;
|
|
13
13
|
midname: string;
|
|
14
|
-
birthDate:
|
|
14
|
+
birthDate: Date;
|
|
15
15
|
phone: string;
|
|
16
16
|
email: string;
|
|
17
17
|
esiaAccountType: {
|
|
@@ -39,11 +39,11 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
41
|
city: string;
|
|
42
|
-
locality:
|
|
42
|
+
locality: string;
|
|
43
43
|
street: string;
|
|
44
44
|
house: string;
|
|
45
|
-
building:
|
|
46
|
-
block:
|
|
45
|
+
building: string;
|
|
46
|
+
block: string;
|
|
47
47
|
apartment: string;
|
|
48
48
|
};
|
|
49
49
|
addressFact: {
|
|
@@ -55,11 +55,11 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
55
55
|
value: string;
|
|
56
56
|
};
|
|
57
57
|
city: string;
|
|
58
|
-
locality:
|
|
58
|
+
locality: string;
|
|
59
59
|
street: string;
|
|
60
60
|
house: string;
|
|
61
|
-
building:
|
|
62
|
-
block:
|
|
61
|
+
building: string;
|
|
62
|
+
block: string;
|
|
63
63
|
apartment: string;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.parseEsiaProfile = void 0;
|
|
3
|
+
const normalizePhone_1 = require("../../ui-kit/PhoneInput/normalizePhone");
|
|
4
|
+
const parseEsiaProfile = (esiaProfile) => {
|
|
5
|
+
const { profile, addInfo, document, addressRegistration, addressFact } = esiaProfile;
|
|
6
|
+
return {
|
|
7
|
+
name: profile?.name,
|
|
8
|
+
surname: profile?.surname,
|
|
9
|
+
middleName: profile?.midname,
|
|
10
|
+
birthday: profile?.birthDate,
|
|
11
|
+
phone: (0, normalizePhone_1.normalizePhone)(profile?.phone),
|
|
12
|
+
email: profile?.email,
|
|
13
|
+
dulIssueDateField: document?.dulIssueDate,
|
|
14
|
+
dulIssuedBy: document?.dulIssuedBy,
|
|
15
|
+
dulNumber: document?.dulNumber,
|
|
16
|
+
dulSerie: document?.dulSerie,
|
|
17
|
+
dulSubdivisionCode: document?.dulSubdivisionCode,
|
|
18
|
+
snils: addInfo?.snils,
|
|
19
|
+
birthPlace: addInfo?.birthPlace,
|
|
20
|
+
addressRegistration: buildAddress(addressRegistration),
|
|
21
|
+
addressFact: buildAddress(addressFact),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.parseEsiaProfile = parseEsiaProfile;
|
|
25
|
+
const concatFullAddress = (address) => {
|
|
26
|
+
return address.reduce((acc, value) => {
|
|
27
|
+
if (value) {
|
|
28
|
+
return acc ? `${acc}, ${value}` : value;
|
|
29
|
+
}
|
|
30
|
+
return acc;
|
|
31
|
+
}, '');
|
|
32
|
+
};
|
|
33
|
+
const buildAddress = (fields) => {
|
|
34
|
+
const { postcode, region, regionCode, locality, city, street, house, building, block, apartment, } = fields;
|
|
35
|
+
const place = locality || city;
|
|
36
|
+
const fullAddress = concatFullAddress([
|
|
37
|
+
postcode,
|
|
38
|
+
region,
|
|
39
|
+
place,
|
|
40
|
+
street ? `ул ${street}` : undefined,
|
|
41
|
+
house ? `д ${house}` : undefined,
|
|
42
|
+
block ? `к ${block}` : undefined,
|
|
43
|
+
building ? `стр ${building}` : undefined,
|
|
44
|
+
apartment ? `кв ${apartment}` : undefined,
|
|
45
|
+
]);
|
|
46
|
+
return {
|
|
47
|
+
...fields,
|
|
48
|
+
regionCode: regionCode?.key,
|
|
49
|
+
fullAddress,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=pasreEsiaProfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pasreEsiaProfile.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/pasreEsiaProfile.ts"],"names":[],"mappings":";;AACA,2EAAwE;AAGjE,MAAM,gBAAgB,GAAG,CAAC,WAAsC,EAAa,EAAE;IACpF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;IAErF,OAAO;QACL,IAAI,EAAE,OAAO,EAAE,IAAI;QACnB,OAAO,EAAE,OAAO,EAAE,OAAO;QACzB,UAAU,EAAE,OAAO,EAAE,OAAO;QAC5B,QAAQ,EAAE,OAAO,EAAE,SAAS;QAC5B,KAAK,EAAE,IAAA,+BAAc,EAAC,OAAO,EAAE,KAAK,CAAC;QACrC,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,iBAAiB,EAAE,QAAQ,EAAE,YAAY;QACzC,WAAW,EAAE,QAAQ,EAAE,WAAW;QAClC,SAAS,EAAE,QAAQ,EAAE,SAAS;QAC9B,QAAQ,EAAE,QAAQ,EAAE,QAAQ;QAC5B,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB;QACh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1C,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,MAAM;QACT,UAAU,EAAE,UAAU,EAAE,GAAG;QAC3B,WAAW;KACZ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,10 +3,11 @@ exports.useInitApplicationLead = void 0;
|
|
|
3
3
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
4
|
const updateProfileEsia_1 = require("../../api/RetailAPI/updateProfileEsia");
|
|
5
5
|
const useLocalStorage_1 = require("../../hooks/useLocalStorage");
|
|
6
|
+
const pasreEsiaProfile_1 = require("./pasreEsiaProfile");
|
|
6
7
|
const useInitApplicationLead = (nextStepLink) => {
|
|
7
8
|
const [isLoading, setIsLoading] = (0, hooks_1.useState)(false);
|
|
8
9
|
const [profileId] = (0, useLocalStorage_1.useLocalStorage)('profileId');
|
|
9
|
-
const [,
|
|
10
|
+
const [leadForm, setLeadForm] = (0, useLocalStorage_1.useLocalStorage)('leadForm');
|
|
10
11
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
11
12
|
const code = params.get('code');
|
|
12
13
|
const state = params.get('state');
|
|
@@ -18,7 +19,10 @@ const useInitApplicationLead = (nextStepLink) => {
|
|
|
18
19
|
state,
|
|
19
20
|
redirectUri: globalThis.location?.href,
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
+
setLeadForm({
|
|
23
|
+
...leadForm,
|
|
24
|
+
...(0, pasreEsiaProfile_1.parseEsiaProfile)(data),
|
|
25
|
+
});
|
|
22
26
|
globalThis.location.href = nextStepLink;
|
|
23
27
|
}
|
|
24
28
|
}, []);
|
|
@@ -28,7 +32,6 @@ const useInitApplicationLead = (nextStepLink) => {
|
|
|
28
32
|
updateEsiaProfile();
|
|
29
33
|
}
|
|
30
34
|
else {
|
|
31
|
-
setEsiaData('');
|
|
32
35
|
sessionStorage.removeItem('accessToken');
|
|
33
36
|
sessionStorage.removeItem('refreshToken');
|
|
34
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitApplicationLead.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/useInitApplicationLead.ts"],"names":[],"mappings":";;AAAA,uDAA+E;AAE/E,6EAA0E;AAC1E,iEAA8D;
|
|
1
|
+
{"version":3,"file":"useInitApplicationLead.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/useInitApplicationLead.ts"],"names":[],"mappings":";;AAAA,uDAA+E;AAE/E,6EAA0E;AAC1E,iEAA8D;AAE9D,yDAAsD;AAE/C,MAAM,sBAAsB,GAAG,CAAC,YAAoB,EAAE,EAAE;IAC7D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,SAAS,CAAC,GAAG,IAAA,iCAAe,EAAS,WAAW,CAAC,CAAC;IACzD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,iCAAe,EAAY,UAAU,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,kBAAkB,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACpF,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAElC,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAC/C,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,IAAA,qCAAiB,EAAC;gBACnC,SAAS,EAAE,SAAS;gBACpB,IAAI;gBACJ,KAAK;gBACL,WAAW,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI;aACvC,CAAC,CAAC;YAEH,WAAW,CAAC;gBACV,GAAG,QAAQ;gBACX,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC;aAC1B,CAAC,CAAC;YAEH,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC;SACzC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,IAAI,EAAE;YACR,YAAY,CAAC,IAAI,CAAC,CAAC;YACnB,iBAAiB,EAAE,CAAC;SACrB;aAAM;YACL,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YACzC,cAAc,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;SAC3C;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,sBAAsB,0BAuCjC"}
|
|
@@ -11,7 +11,7 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
11
11
|
surname: string;
|
|
12
12
|
name: string;
|
|
13
13
|
midname: string;
|
|
14
|
-
birthDate:
|
|
14
|
+
birthDate: Date;
|
|
15
15
|
phone: string;
|
|
16
16
|
email: string;
|
|
17
17
|
esiaAccountType: {
|
|
@@ -39,11 +39,11 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
41
|
city: string;
|
|
42
|
-
locality:
|
|
42
|
+
locality: string;
|
|
43
43
|
street: string;
|
|
44
44
|
house: string;
|
|
45
|
-
building:
|
|
46
|
-
block:
|
|
45
|
+
building: string;
|
|
46
|
+
block: string;
|
|
47
47
|
apartment: string;
|
|
48
48
|
};
|
|
49
49
|
addressFact: {
|
|
@@ -55,11 +55,11 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
55
55
|
value: string;
|
|
56
56
|
};
|
|
57
57
|
city: string;
|
|
58
|
-
locality:
|
|
58
|
+
locality: string;
|
|
59
59
|
street: string;
|
|
60
60
|
house: string;
|
|
61
|
-
building:
|
|
62
|
-
block:
|
|
61
|
+
building: string;
|
|
62
|
+
block: string;
|
|
63
63
|
apartment: string;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { normalizePhone } from '../../ui-kit/PhoneInput/normalizePhone.js';
|
|
2
|
+
export const parseEsiaProfile = (esiaProfile) => {
|
|
3
|
+
const { profile, addInfo, document, addressRegistration, addressFact } = esiaProfile;
|
|
4
|
+
return {
|
|
5
|
+
name: profile?.name,
|
|
6
|
+
surname: profile?.surname,
|
|
7
|
+
middleName: profile?.midname,
|
|
8
|
+
birthday: profile?.birthDate,
|
|
9
|
+
phone: normalizePhone(profile?.phone),
|
|
10
|
+
email: profile?.email,
|
|
11
|
+
dulIssueDateField: document?.dulIssueDate,
|
|
12
|
+
dulIssuedBy: document?.dulIssuedBy,
|
|
13
|
+
dulNumber: document?.dulNumber,
|
|
14
|
+
dulSerie: document?.dulSerie,
|
|
15
|
+
dulSubdivisionCode: document?.dulSubdivisionCode,
|
|
16
|
+
snils: addInfo?.snils,
|
|
17
|
+
birthPlace: addInfo?.birthPlace,
|
|
18
|
+
addressRegistration: buildAddress(addressRegistration),
|
|
19
|
+
addressFact: buildAddress(addressFact),
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const concatFullAddress = (address) => {
|
|
23
|
+
return address.reduce((acc, value) => {
|
|
24
|
+
if (value) {
|
|
25
|
+
return acc ? `${acc}, ${value}` : value;
|
|
26
|
+
}
|
|
27
|
+
return acc;
|
|
28
|
+
}, '');
|
|
29
|
+
};
|
|
30
|
+
const buildAddress = (fields) => {
|
|
31
|
+
const { postcode, region, regionCode, locality, city, street, house, building, block, apartment, } = fields;
|
|
32
|
+
const place = locality || city;
|
|
33
|
+
const fullAddress = concatFullAddress([
|
|
34
|
+
postcode,
|
|
35
|
+
region,
|
|
36
|
+
place,
|
|
37
|
+
street ? `ул ${street}` : undefined,
|
|
38
|
+
house ? `д ${house}` : undefined,
|
|
39
|
+
block ? `к ${block}` : undefined,
|
|
40
|
+
building ? `стр ${building}` : undefined,
|
|
41
|
+
apartment ? `кв ${apartment}` : undefined,
|
|
42
|
+
]);
|
|
43
|
+
return {
|
|
44
|
+
...fields,
|
|
45
|
+
regionCode: regionCode?.key,
|
|
46
|
+
fullAddress,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=pasreEsiaProfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pasreEsiaProfile.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/pasreEsiaProfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAGxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,WAAsC,EAAa,EAAE;IACpF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;IAErF,OAAO;QACL,IAAI,EAAE,OAAO,EAAE,IAAI;QACnB,OAAO,EAAE,OAAO,EAAE,OAAO;QACzB,UAAU,EAAE,OAAO,EAAE,OAAO;QAC5B,QAAQ,EAAE,OAAO,EAAE,SAAS;QAC5B,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC;QACrC,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,iBAAiB,EAAE,QAAQ,EAAE,YAAY;QACzC,WAAW,EAAE,QAAQ,EAAE,WAAW;QAClC,SAAS,EAAE,QAAQ,EAAE,SAAS;QAC9B,QAAQ,EAAE,QAAQ,EAAE,QAAQ;QAC5B,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB;QAChD,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,UAAU,EAAE,OAAO,EAAE,UAAU;QAC/B,mBAAmB,EAAE,YAAY,CAAC,mBAAmB,CAAC;QACtD,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC;KACvC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,OAAkC,EAAU,EAAE;IACvE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,KAAK,EAAE,EAAE;QAC3C,IAAI,KAAK,EAAE;YACT,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;SACzC;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,MAAwD,EAAW,EAAE;IACzF,MAAM,EACJ,QAAQ,EACR,MAAM,EACN,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,GACV,GAAG,MAAM,CAAC;IAEX,MAAM,KAAK,GAAG,QAAQ,IAAI,IAAI,CAAC;IAE/B,MAAM,WAAW,GAAG,iBAAiB,CAAC;QACpC,QAAQ;QACR,MAAM;QACN,KAAK;QACL,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;QACnC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS;QAChC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS;QAChC,QAAQ,CAAC,CAAC,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;QACxC,SAAS,CAAC,CAAC,CAAC,MAAM,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS;KAC1C,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,MAAM;QACT,UAAU,EAAE,UAAU,EAAE,GAAG;QAC3B,WAAW;KACZ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { updateProfileEsia } from '../../api/RetailAPI/updateProfileEsia.js';
|
|
3
3
|
import { useLocalStorage } from '../../hooks/useLocalStorage.js';
|
|
4
|
+
import { parseEsiaProfile } from './pasreEsiaProfile.js';
|
|
4
5
|
export const useInitApplicationLead = (nextStepLink) => {
|
|
5
6
|
const [isLoading, setIsLoading] = useState(false);
|
|
6
7
|
const [profileId] = useLocalStorage('profileId');
|
|
7
|
-
const [,
|
|
8
|
+
const [leadForm, setLeadForm] = useLocalStorage('leadForm');
|
|
8
9
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
9
10
|
const code = params.get('code');
|
|
10
11
|
const state = params.get('state');
|
|
@@ -16,7 +17,10 @@ export const useInitApplicationLead = (nextStepLink) => {
|
|
|
16
17
|
state,
|
|
17
18
|
redirectUri: globalThis.location?.href,
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
+
setLeadForm({
|
|
21
|
+
...leadForm,
|
|
22
|
+
...parseEsiaProfile(data),
|
|
23
|
+
});
|
|
20
24
|
globalThis.location.href = nextStepLink;
|
|
21
25
|
}
|
|
22
26
|
}, []);
|
|
@@ -26,7 +30,6 @@ export const useInitApplicationLead = (nextStepLink) => {
|
|
|
26
30
|
updateEsiaProfile();
|
|
27
31
|
}
|
|
28
32
|
else {
|
|
29
|
-
setEsiaData('');
|
|
30
33
|
sessionStorage.removeItem('accessToken');
|
|
31
34
|
sessionStorage.removeItem('refreshToken');
|
|
32
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitApplicationLead.js","sourceRoot":"","sources":["../../../src/components/ApplicationLeadForm/useInitApplicationLead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,YAAoB,EAAE,EAAE;I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AAE,SAAS;gBACpB,IAAI;gBACJ,KAAK;gBACL,WAAW,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI;aACvC,CAAC,CAAC;YAEH,WAAW,CAAC;gBACV,GAAG,QAAQ;gBACX,GAAG,gBAAgB,CAAC,IAAI,CAAC;aAC1B,CAAC,CAAC;YAEH,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC;SACzC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,EAAE;YACR,YAAY,CAAC,IAAI,CAAC,CAAC;YACnB,iBAAiB,EAAE,CAAC;SACrB;aAAM;YACL,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YACzC,cAAc,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;SAC3C;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,SAAS;KACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
11
11
|
surname: string;
|
|
12
12
|
name: string;
|
|
13
13
|
midname: string;
|
|
14
|
-
birthDate:
|
|
14
|
+
birthDate: Date;
|
|
15
15
|
phone: string;
|
|
16
16
|
email: string;
|
|
17
17
|
esiaAccountType: {
|
|
@@ -39,11 +39,11 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
41
|
city: string;
|
|
42
|
-
locality:
|
|
42
|
+
locality: string;
|
|
43
43
|
street: string;
|
|
44
44
|
house: string;
|
|
45
|
-
building:
|
|
46
|
-
block:
|
|
45
|
+
building: string;
|
|
46
|
+
block: string;
|
|
47
47
|
apartment: string;
|
|
48
48
|
};
|
|
49
49
|
addressFact: {
|
|
@@ -55,11 +55,11 @@ export declare type UpdateProfileEsiaResponse = {
|
|
|
55
55
|
value: string;
|
|
56
56
|
};
|
|
57
57
|
city: string;
|
|
58
|
-
locality:
|
|
58
|
+
locality: string;
|
|
59
59
|
street: string;
|
|
60
60
|
house: string;
|
|
61
|
-
building:
|
|
62
|
-
block:
|
|
61
|
+
building: string;
|
|
62
|
+
block: string;
|
|
63
63
|
apartment: string;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -4113,10 +4113,58 @@
|
|
|
4113
4113
|
|
|
4114
4114
|
const updateProfileEsia = (body) => doRequest('/esia/updateProfileEsia', 'POST', body);
|
|
4115
4115
|
|
|
4116
|
+
const parseEsiaProfile = (esiaProfile) => {
|
|
4117
|
+
const { profile, addInfo, document, addressRegistration, addressFact } = esiaProfile;
|
|
4118
|
+
return {
|
|
4119
|
+
name: profile?.name,
|
|
4120
|
+
surname: profile?.surname,
|
|
4121
|
+
middleName: profile?.midname,
|
|
4122
|
+
birthday: profile?.birthDate,
|
|
4123
|
+
phone: normalizePhone(profile?.phone),
|
|
4124
|
+
email: profile?.email,
|
|
4125
|
+
dulIssueDateField: document?.dulIssueDate,
|
|
4126
|
+
dulIssuedBy: document?.dulIssuedBy,
|
|
4127
|
+
dulNumber: document?.dulNumber,
|
|
4128
|
+
dulSerie: document?.dulSerie,
|
|
4129
|
+
dulSubdivisionCode: document?.dulSubdivisionCode,
|
|
4130
|
+
snils: addInfo?.snils,
|
|
4131
|
+
birthPlace: addInfo?.birthPlace,
|
|
4132
|
+
addressRegistration: buildAddress(addressRegistration),
|
|
4133
|
+
addressFact: buildAddress(addressFact),
|
|
4134
|
+
};
|
|
4135
|
+
};
|
|
4136
|
+
const concatFullAddress = (address) => {
|
|
4137
|
+
return address.reduce((acc, value) => {
|
|
4138
|
+
if (value) {
|
|
4139
|
+
return acc ? `${acc}, ${value}` : value;
|
|
4140
|
+
}
|
|
4141
|
+
return acc;
|
|
4142
|
+
}, '');
|
|
4143
|
+
};
|
|
4144
|
+
const buildAddress = (fields) => {
|
|
4145
|
+
const { postcode, region, regionCode, locality, city, street, house, building, block, apartment, } = fields;
|
|
4146
|
+
const place = locality || city;
|
|
4147
|
+
const fullAddress = concatFullAddress([
|
|
4148
|
+
postcode,
|
|
4149
|
+
region,
|
|
4150
|
+
place,
|
|
4151
|
+
street ? `ул ${street}` : undefined,
|
|
4152
|
+
house ? `д ${house}` : undefined,
|
|
4153
|
+
block ? `к ${block}` : undefined,
|
|
4154
|
+
building ? `стр ${building}` : undefined,
|
|
4155
|
+
apartment ? `кв ${apartment}` : undefined,
|
|
4156
|
+
]);
|
|
4157
|
+
return {
|
|
4158
|
+
...fields,
|
|
4159
|
+
regionCode: regionCode?.key,
|
|
4160
|
+
fullAddress,
|
|
4161
|
+
};
|
|
4162
|
+
};
|
|
4163
|
+
|
|
4116
4164
|
const useInitApplicationLead = (nextStepLink) => {
|
|
4117
4165
|
const [isLoading, setIsLoading] = useState(false);
|
|
4118
4166
|
const [profileId] = useLocalStorage('profileId');
|
|
4119
|
-
const [,
|
|
4167
|
+
const [leadForm, setLeadForm] = useLocalStorage('leadForm');
|
|
4120
4168
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
4121
4169
|
const code = params.get('code');
|
|
4122
4170
|
const state = params.get('state');
|
|
@@ -4128,7 +4176,10 @@
|
|
|
4128
4176
|
state,
|
|
4129
4177
|
redirectUri: globalThis.location?.href,
|
|
4130
4178
|
});
|
|
4131
|
-
|
|
4179
|
+
setLeadForm({
|
|
4180
|
+
...leadForm,
|
|
4181
|
+
...parseEsiaProfile(data),
|
|
4182
|
+
});
|
|
4132
4183
|
globalThis.location.href = nextStepLink;
|
|
4133
4184
|
}
|
|
4134
4185
|
}, []);
|
|
@@ -4138,7 +4189,6 @@
|
|
|
4138
4189
|
updateEsiaProfile();
|
|
4139
4190
|
}
|
|
4140
4191
|
else {
|
|
4141
|
-
setEsiaData('');
|
|
4142
4192
|
sessionStorage.removeItem('accessToken');
|
|
4143
4193
|
sessionStorage.removeItem('refreshToken');
|
|
4144
4194
|
}
|
|
@@ -8202,7 +8252,7 @@
|
|
|
8202
8252
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
8203
8253
|
});
|
|
8204
8254
|
|
|
8205
|
-
const packageVersion = "0.14.
|
|
8255
|
+
const packageVersion = "0.14.636";
|
|
8206
8256
|
|
|
8207
8257
|
exports.Blocks = Blocks;
|
|
8208
8258
|
exports.ContentPage = ContentPage;
|