@redneckz/wildless-cms-uni-blocks 0.14.817 → 0.14.818
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 +109 -112
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/dist/retail/components/Fields/BeginDateField.js +2 -1
- package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +2 -1
- package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/dist/retail/components/Fields/Experience5YearsField.js +2 -1
- package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/retail/components/Fields/JobsNumberField.js +2 -1
- package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/retail/components/Fields/OrganizationNameField.js +2 -1
- package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/dist/retail/components/Fields/WagesField.js +2 -1
- package/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/dist/retail/content.js +7 -10
- package/dist/retail/content.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/lib/retail/components/Fields/BeginDateField.js +2 -1
- package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
- package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +2 -1
- package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/lib/retail/components/Fields/Experience5YearsField.js +2 -1
- package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/retail/components/Fields/JobsNumberField.js +2 -1
- package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/retail/components/Fields/OrganizationNameField.js +2 -1
- package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/lib/retail/components/Fields/WagesField.js +2 -1
- package/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/lib/retail/content.js +7 -10
- package/lib/retail/content.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +109 -112
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/dist/retail/components/Fields/BeginDateField.js +2 -1
- package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +2 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js +2 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js +2 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js +2 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/WagesField.js +2 -1
- package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/dist/retail/content.js +7 -10
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/lib/retail/components/Fields/BeginDateField.js +2 -1
- package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +2 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js +2 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js +2 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js +2 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/WagesField.js +2 -1
- package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/lib/retail/content.js +7 -10
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +24 -15
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -1
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +71 -80
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +0 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -14
- package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -2
- package/mobile/src/retail/components/Fields/BeginDateField.tsx +2 -0
- package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +2 -0
- package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
- package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
- package/mobile/src/retail/components/Fields/JobsNumberField.tsx +2 -0
- package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
- package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
- package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
- package/mobile/src/retail/content.tsx +7 -10
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +24 -15
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -1
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +71 -80
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +0 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -14
- package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -2
- package/src/retail/components/Fields/BeginDateField.tsx +2 -0
- package/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
- package/src/retail/components/Fields/DaDataInnField.tsx +2 -0
- package/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
- package/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
- package/src/retail/components/Fields/JobsNumberField.tsx +2 -0
- package/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
- package/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
- package/src/retail/components/Fields/WagesField.tsx +2 -0
- package/src/retail/content.tsx +7 -10
|
@@ -5,58 +5,19 @@ import { uploadFile, type DocumentCategory } from '../../retail/api/uploadFile';
|
|
|
5
5
|
import { type Address, type File, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
6
6
|
import { normalizePhone } from '../../ui-kit/PhoneInput/normalizePhone';
|
|
7
7
|
|
|
8
|
-
type Document = {
|
|
9
|
-
file: string;
|
|
10
|
-
category: DocumentCategory;
|
|
11
|
-
isPDF: boolean;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
8
|
export const parseEsiaProfile = async (
|
|
15
9
|
esiaProfile: EsiaRequestProfileResponse,
|
|
16
10
|
isDebit: boolean,
|
|
17
11
|
): Promise<LeadFormState> => {
|
|
18
|
-
|
|
12
|
+
checkEsiaData(esiaProfile);
|
|
13
|
+
const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
|
|
19
14
|
|
|
20
15
|
const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } =
|
|
21
16
|
esiaProfile;
|
|
22
17
|
let files: File[] = [];
|
|
23
18
|
|
|
24
|
-
if (
|
|
25
|
-
files = await saveDocuments(
|
|
26
|
-
{
|
|
27
|
-
file: esiaAdditionalDocument.pdfFileWorkbook,
|
|
28
|
-
category: 'CONFIRMING_INCOME_DOC',
|
|
29
|
-
isPDF: true,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
file: esiaAdditionalDocument.pdfFilePayout,
|
|
33
|
-
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
34
|
-
isPDF: true,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
file: esiaAdditionalDocument.pdfFileSigPayout,
|
|
38
|
-
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
39
|
-
isPDF: true,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
file: esiaAdditionalDocument.xmlFilePayout,
|
|
43
|
-
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
44
|
-
isPDF: false,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
file: esiaAdditionalDocument.xmlFileSigPayout,
|
|
48
|
-
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
49
|
-
isPDF: false,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
file: esiaAdditionalDocument.xmlFileWorkbook,
|
|
53
|
-
category: 'CONFIRMING_INCOME_DOC',
|
|
54
|
-
isPDF: false,
|
|
55
|
-
},
|
|
56
|
-
//TODO: После тестирования добавить документы снизу
|
|
57
|
-
// {file: esiaAdditionalDocument.pdfFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: true},
|
|
58
|
-
// {file: esiaAdditionalDocument.xmlFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: false},
|
|
59
|
-
]);
|
|
19
|
+
if (isFullEsiaData) {
|
|
20
|
+
files = await saveDocuments(esiaAdditionalDocument);
|
|
60
21
|
}
|
|
61
22
|
|
|
62
23
|
const mainData = {
|
|
@@ -74,12 +35,12 @@ export const parseEsiaProfile = async (
|
|
|
74
35
|
birthPlace: addInfo.birthPlace,
|
|
75
36
|
addressRegistration: buildAddress(addressRegistration),
|
|
76
37
|
addressFact: buildAddress(addressFact),
|
|
77
|
-
esiaAccountTypeCd: profile.esiaAccountType,
|
|
38
|
+
esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
|
|
78
39
|
};
|
|
79
40
|
|
|
80
41
|
return {
|
|
81
42
|
...mainData,
|
|
82
|
-
...(
|
|
43
|
+
...(isFullEsiaData && {
|
|
83
44
|
snils: addInfo.snils,
|
|
84
45
|
inn: esiaAdditionalDocument.inn,
|
|
85
46
|
wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
|
|
@@ -88,6 +49,9 @@ export const parseEsiaProfile = async (
|
|
|
88
49
|
generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
|
|
89
50
|
lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
|
|
90
51
|
jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
52
|
+
esiaAccountTypeCd: profile.esiaAccountType,
|
|
53
|
+
confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
|
|
54
|
+
employment: { key: 'WORK', text: 'Работаю' },
|
|
91
55
|
files,
|
|
92
56
|
}),
|
|
93
57
|
};
|
|
@@ -139,23 +103,67 @@ const buildAddress = (fields: EsiaRequestProfileResponse['addressRegistration'])
|
|
|
139
103
|
|
|
140
104
|
const getYearFromMonth = (month: number) => Math.floor(month / 12);
|
|
141
105
|
|
|
142
|
-
const saveDocuments = async (
|
|
106
|
+
const saveDocuments = async (
|
|
107
|
+
esiaAdditionalDocument: EsiaRequestProfileResponse['esiaAdditionalDocument'],
|
|
108
|
+
): Promise<File[]> => {
|
|
143
109
|
const files: File[] = [];
|
|
110
|
+
const documents = [
|
|
111
|
+
{
|
|
112
|
+
file: esiaAdditionalDocument.pdfFileWorkbook,
|
|
113
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
114
|
+
isPDF: true,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
file: esiaAdditionalDocument.pdfFilePayout,
|
|
118
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
119
|
+
isPDF: true,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
file: esiaAdditionalDocument.pdfFileSigPayout,
|
|
123
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
124
|
+
isPDF: true,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
file: esiaAdditionalDocument.xmlFilePayout,
|
|
128
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
129
|
+
isPDF: false,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
file: esiaAdditionalDocument.xmlFileSigPayout,
|
|
133
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
134
|
+
isPDF: false,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
file: esiaAdditionalDocument.xmlFileWorkbook,
|
|
138
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
139
|
+
isPDF: false,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
file: esiaAdditionalDocument.pdfFileSigWorkbook,
|
|
143
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
144
|
+
isPDF: true,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
file: esiaAdditionalDocument.xmlFileSigWorkbook,
|
|
148
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
149
|
+
isPDF: false,
|
|
150
|
+
},
|
|
151
|
+
];
|
|
144
152
|
|
|
145
153
|
for (const doc of documents) {
|
|
146
154
|
const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
|
|
147
155
|
|
|
148
156
|
await fetch(`${contentType},${doc.file}`)
|
|
149
157
|
.then((res) => res.blob())
|
|
150
|
-
.then((value) => uploadFile(value, doc.category, doc.isPDF))
|
|
158
|
+
.then((value) => uploadFile(value, doc.category as DocumentCategory, doc.isPDF))
|
|
151
159
|
.then((file) => files.push(file));
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
return files;
|
|
155
163
|
};
|
|
156
164
|
|
|
157
|
-
const
|
|
158
|
-
const { profile, document, addressRegistration
|
|
165
|
+
const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
166
|
+
const { profile, document, addressRegistration } = esiaProfile;
|
|
159
167
|
|
|
160
168
|
const data = [
|
|
161
169
|
profile.name,
|
|
@@ -163,7 +171,6 @@ const checkEsiaDataForCredit = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
|
163
171
|
profile.midname,
|
|
164
172
|
profile.birthDate,
|
|
165
173
|
profile.phone,
|
|
166
|
-
profile.email,
|
|
167
174
|
document.dulIssueDate,
|
|
168
175
|
document.dulIssuedBy,
|
|
169
176
|
document.dulNumber,
|
|
@@ -171,6 +178,17 @@ const checkEsiaDataForCredit = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
|
171
178
|
document.dulSubdivisionCode,
|
|
172
179
|
addressRegistration,
|
|
173
180
|
profile.esiaAccountType,
|
|
181
|
+
];
|
|
182
|
+
|
|
183
|
+
if (!data.every((_) => Boolean(_))) {
|
|
184
|
+
throw new Error();
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const checkEsiaAdditionalDocument = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
189
|
+
const { esiaAdditionalDocument } = esiaProfile;
|
|
190
|
+
|
|
191
|
+
const data = [
|
|
174
192
|
esiaAdditionalDocument.inn,
|
|
175
193
|
esiaAdditionalDocument.averageMonthlyIncome.toString(),
|
|
176
194
|
esiaAdditionalDocument.startWorkDate,
|
|
@@ -184,36 +202,9 @@ const checkEsiaDataForCredit = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
|
184
202
|
esiaAdditionalDocument.xmlFilePayout,
|
|
185
203
|
esiaAdditionalDocument.xmlFileSigPayout,
|
|
186
204
|
esiaAdditionalDocument.xmlFileWorkbook,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// esiaAdditionalDocument.xmlFileSigWorkbook
|
|
190
|
-
];
|
|
191
|
-
|
|
192
|
-
if (!data.every((_) => Boolean(_))) {
|
|
193
|
-
throw new Error();
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
const checkEsiaDataForDebit = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
198
|
-
const { profile, document, addressRegistration } = esiaProfile;
|
|
199
|
-
|
|
200
|
-
const data = [
|
|
201
|
-
profile.name,
|
|
202
|
-
profile.surname,
|
|
203
|
-
profile.midname,
|
|
204
|
-
profile.birthDate,
|
|
205
|
-
profile.phone,
|
|
206
|
-
profile.email,
|
|
207
|
-
document.dulIssueDate,
|
|
208
|
-
document.dulIssuedBy,
|
|
209
|
-
document.dulNumber,
|
|
210
|
-
document.dulSerie,
|
|
211
|
-
document.dulSubdivisionCode,
|
|
212
|
-
addressRegistration,
|
|
213
|
-
profile.esiaAccountType,
|
|
205
|
+
esiaAdditionalDocument.pdfFileSigWorkbook,
|
|
206
|
+
esiaAdditionalDocument.xmlFileSigWorkbook,
|
|
214
207
|
];
|
|
215
208
|
|
|
216
|
-
|
|
217
|
-
throw new Error();
|
|
218
|
-
}
|
|
209
|
+
return data.every((_) => Boolean(_));
|
|
219
210
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
2
|
import { useSetter } from '../../hooks/useSetter';
|
|
4
3
|
import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
|
|
5
4
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
6
5
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
6
|
+
import { EsiaStatuses } from './ApplicationLeadForm';
|
|
7
7
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
8
8
|
import { getInitialFormState } from './getInitialFormState';
|
|
9
9
|
import { parseEsiaProfile } from './parseEsiaProfile';
|
|
@@ -13,20 +13,16 @@ type InitApplicationLeadProps = {
|
|
|
13
13
|
inputs: FieldRetailDef[];
|
|
14
14
|
nextStepLink: string;
|
|
15
15
|
productType: ProductType;
|
|
16
|
-
|
|
17
|
-
setEsiaAuthSuccess: () => void;
|
|
16
|
+
setEsiaStatus: (status: EsiaStatuses) => void;
|
|
18
17
|
esiaAuthSuccess: boolean;
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export const useInitApplicationLead = ({
|
|
22
21
|
inputs,
|
|
23
22
|
productType,
|
|
24
|
-
|
|
25
|
-
setEsiaAuthSuccess,
|
|
23
|
+
setEsiaStatus,
|
|
26
24
|
esiaAuthSuccess,
|
|
27
|
-
}: InitApplicationLeadProps):
|
|
28
|
-
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
29
|
-
|
|
25
|
+
}: InitApplicationLeadProps): LeadFormState => {
|
|
30
26
|
const leadFormStore = useLeadFormStore();
|
|
31
27
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
32
28
|
|
|
@@ -36,7 +32,7 @@ export const useInitApplicationLead = ({
|
|
|
36
32
|
);
|
|
37
33
|
|
|
38
34
|
const requestEsiaProfile = useCallback(async (code: string, state: string) => {
|
|
39
|
-
|
|
35
|
+
setEsiaStatus(EsiaStatuses.Pending);
|
|
40
36
|
try {
|
|
41
37
|
const data = await esiaRequestProfile({
|
|
42
38
|
code,
|
|
@@ -52,12 +48,10 @@ export const useInitApplicationLead = ({
|
|
|
52
48
|
..._,
|
|
53
49
|
...parsedData,
|
|
54
50
|
}));
|
|
55
|
-
|
|
51
|
+
setEsiaStatus(EsiaStatuses.Success);
|
|
56
52
|
}
|
|
57
53
|
} catch {
|
|
58
|
-
|
|
59
|
-
} finally {
|
|
60
|
-
endLoading();
|
|
54
|
+
setEsiaStatus(EsiaStatuses.Error);
|
|
61
55
|
}
|
|
62
56
|
}, []);
|
|
63
57
|
|
|
@@ -76,5 +70,5 @@ export const useInitApplicationLead = ({
|
|
|
76
70
|
}
|
|
77
71
|
}, []);
|
|
78
72
|
|
|
79
|
-
return
|
|
73
|
+
return initialFormState;
|
|
80
74
|
};
|
|
@@ -19,13 +19,12 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
19
19
|
snils,
|
|
20
20
|
armyIdFlg,
|
|
21
21
|
conscription,
|
|
22
|
-
esiaAccountTypeCd,
|
|
23
22
|
} = formData;
|
|
24
23
|
|
|
25
24
|
return {
|
|
26
25
|
maritalStatusCd: familyStatus,
|
|
27
26
|
totalDependents: familyMembers,
|
|
28
|
-
incomeCertificateCd:
|
|
27
|
+
incomeCertificateCd: confirmationIncome,
|
|
29
28
|
otherDependents: dependents,
|
|
30
29
|
childrenDependents: children,
|
|
31
30
|
militaryStatusCd: conscription,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { DatePickerControl } from '../../../ui-kit/DatePicker/DatePickerControl';
|
|
3
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
4
5
|
|
|
5
6
|
export const BeginDateField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
6
7
|
<DatePickerControl
|
|
7
8
|
label="Дата начала работы на текущем месте"
|
|
8
9
|
{...field(input?.name ?? '')}
|
|
9
10
|
{...input}
|
|
11
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
10
12
|
/>
|
|
11
13
|
));
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { InfoCard } from '../../../ui-kit/InfoCard/InfoCard';
|
|
3
4
|
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
5
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
4
6
|
import { SelectField } from './SelectField';
|
|
5
7
|
|
|
6
8
|
export const ConfirmationIncomeField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
7
9
|
const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
|
|
10
|
+
const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
|
|
8
11
|
|
|
9
12
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<div>
|
|
14
|
+
{filledByEsia ? (
|
|
15
|
+
<div className="mb-6">
|
|
16
|
+
<InfoCard __html="Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги" />
|
|
17
|
+
</div>
|
|
18
|
+
) : null}
|
|
19
|
+
<SelectField
|
|
20
|
+
field={field}
|
|
21
|
+
source={confirmationIncome}
|
|
22
|
+
label="Способ подтверждения дохода"
|
|
23
|
+
fieldName="confirmationIncome"
|
|
24
|
+
input={input}
|
|
25
|
+
disabled={filledByEsia}
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
17
28
|
);
|
|
18
29
|
});
|
|
@@ -4,6 +4,7 @@ import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProp
|
|
|
4
4
|
import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
|
|
5
5
|
import { getOrganizationFromInn } from '../../api/getOrganizationFromInn';
|
|
6
6
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
7
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
7
8
|
import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
|
|
8
9
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
9
10
|
|
|
@@ -41,6 +42,7 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
41
42
|
{...input}
|
|
42
43
|
{...field(input?.name ?? '')}
|
|
43
44
|
onDaDataChange={onDaDataChange}
|
|
45
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
44
46
|
/>
|
|
45
47
|
);
|
|
46
48
|
});
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
4
|
import { clamp } from '../../../utils/clamp';
|
|
5
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
5
6
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
6
7
|
|
|
7
8
|
const MAX_YEARS = 5;
|
|
@@ -22,6 +23,7 @@ export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
22
23
|
{...field(input?.name ?? '')}
|
|
23
24
|
{...input}
|
|
24
25
|
onChange={onChange}
|
|
26
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
25
27
|
/>
|
|
26
28
|
);
|
|
27
29
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -10,5 +11,6 @@ export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
10
11
|
placeholder="Количество лет"
|
|
11
12
|
{...field(input?.name ?? '')}
|
|
12
13
|
{...input}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
13
15
|
/>
|
|
14
16
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -10,5 +11,6 @@ export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
10
11
|
maxLength={2}
|
|
11
12
|
{...field(input?.name ?? '')}
|
|
12
13
|
{...input}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
13
15
|
/>
|
|
14
16
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -10,5 +11,6 @@ export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) =
|
|
|
10
11
|
maxLength={2}
|
|
11
12
|
{...field(input?.name ?? '')}
|
|
12
13
|
{...input}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
13
15
|
/>
|
|
14
16
|
));
|
|
@@ -3,6 +3,7 @@ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
4
|
import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
|
|
5
5
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
6
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
6
7
|
import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
|
|
7
8
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
8
9
|
|
|
@@ -19,6 +20,7 @@ export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
19
20
|
label="Наименование организации"
|
|
20
21
|
{...input}
|
|
21
22
|
{...field(input?.name ?? '')}
|
|
23
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
22
24
|
onDaDataChange={onDaDataChange}
|
|
23
25
|
/>
|
|
24
26
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -9,5 +10,6 @@ export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
9
10
|
isInteger={true}
|
|
10
11
|
{...field(input?.name ?? '')}
|
|
11
12
|
{...input}
|
|
13
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
12
14
|
/>
|
|
13
15
|
));
|
package/src/retail/content.tsx
CHANGED
|
@@ -139,7 +139,7 @@ const EMPLOYMENT_CONTENT: CreditCardSectionsProps[] = [
|
|
|
139
139
|
label: 'Телефон работодателя',
|
|
140
140
|
required: true,
|
|
141
141
|
},
|
|
142
|
-
{ name: 'beginDate', required: true },
|
|
142
|
+
{ name: 'beginDate', required: true, filledByEsia: true },
|
|
143
143
|
],
|
|
144
144
|
},
|
|
145
145
|
{
|
|
@@ -181,23 +181,20 @@ const FAMILY_STATUS_AND_INCOME_CONTENT: CreditCardSectionsProps[] = [
|
|
|
181
181
|
title: 'Совокупный доход',
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
|
+
columns: 1,
|
|
184
185
|
inputs: [
|
|
185
186
|
{
|
|
186
|
-
name: '
|
|
187
|
-
|
|
187
|
+
name: 'confirmationIncome',
|
|
188
|
+
required: true,
|
|
189
|
+
filledByEsia: true,
|
|
188
190
|
},
|
|
189
191
|
],
|
|
190
192
|
},
|
|
191
193
|
{
|
|
192
|
-
columns: 1,
|
|
193
194
|
inputs: [
|
|
194
195
|
{
|
|
195
|
-
name: '
|
|
196
|
-
|
|
197
|
-
condition: {
|
|
198
|
-
name: 'esiaAccountTypeCd',
|
|
199
|
-
values: [''],
|
|
200
|
-
},
|
|
196
|
+
name: 'infoCard',
|
|
197
|
+
label: 'Сумма основного и дополнительных доходов после вычета налога',
|
|
201
198
|
},
|
|
202
199
|
],
|
|
203
200
|
},
|