@redneckz/wildless-cms-uni-blocks 0.14.797 → 0.14.798
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 +180 -63
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/{pasreEsiaProfile.d.ts → parseEsiaProfile.d.ts} +1 -1
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +8 -1
- package/bundle/retail/api/doRequest.d.ts +3 -0
- package/bundle/retail/api/updateUserTask.d.ts +2 -0
- package/bundle/retail/api/uploadFile.d.ts +3 -0
- package/bundle/retail/model/LeadFormState.d.ts +13 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +11 -2
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/{pasreEsiaProfile.d.ts → parseEsiaProfile.d.ts} +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +141 -0
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +8 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +8 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.js +1 -0
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/dist/retail/adaptors/getCreditFormTaskData.js +1 -0
- package/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/dist/retail/api/doRequest.d.ts +3 -0
- package/dist/retail/api/doRequest.js +3 -2
- package/dist/retail/api/doRequest.js.map +1 -1
- package/dist/retail/api/updateUserTask.d.ts +2 -0
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/uploadFile.d.ts +3 -0
- package/dist/retail/api/uploadFile.js +22 -0
- package/dist/retail/api/uploadFile.js.map +1 -0
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -0
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +10 -8
- 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 +8 -8
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/model/LeadFormState.d.ts +13 -0
- package/dist/retail/utils/updateOrganizationFields.js +3 -1
- package/dist/retail/utils/updateOrganizationFields.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/NameField.js +2 -1
- package/dist/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/dist/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +11 -2
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/{pasreEsiaProfile.d.ts → parseEsiaProfile.d.ts} +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +138 -0
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +8 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +8 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.js +1 -0
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/lib/retail/adaptors/getCreditFormTaskData.js +1 -0
- package/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/lib/retail/api/doRequest.d.ts +3 -0
- package/lib/retail/api/doRequest.js +1 -1
- package/lib/retail/api/doRequest.js.map +1 -1
- package/lib/retail/api/updateUserTask.d.ts +2 -0
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/uploadFile.d.ts +3 -0
- package/lib/retail/api/uploadFile.js +19 -0
- package/lib/retail/api/uploadFile.js.map +1 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -0
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +10 -8
- 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 +8 -8
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/model/LeadFormState.d.ts +13 -0
- package/lib/retail/utils/updateOrganizationFields.js +3 -1
- package/lib/retail/utils/updateOrganizationFields.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/NameField.js +2 -1
- package/lib/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/lib/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +180 -63
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/{pasreEsiaProfile.d.ts → parseEsiaProfile.d.ts} +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +8 -1
- package/mobile/bundle/retail/api/doRequest.d.ts +3 -0
- package/mobile/bundle/retail/api/updateUserTask.d.ts +2 -0
- package/mobile/bundle/retail/api/uploadFile.d.ts +3 -0
- package/mobile/bundle/retail/model/LeadFormState.d.ts +13 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +11 -2
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +141 -0
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +8 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +8 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js +1 -0
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js +1 -0
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/dist/retail/api/doRequest.d.ts +3 -0
- package/mobile/dist/retail/api/doRequest.js +3 -2
- package/mobile/dist/retail/api/doRequest.js.map +1 -1
- package/mobile/dist/retail/api/updateUserTask.d.ts +2 -0
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/api/uploadFile.d.ts +3 -0
- package/mobile/dist/retail/api/uploadFile.js +22 -0
- package/mobile/dist/retail/api/uploadFile.js.map +1 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -0
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +10 -8
- 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 +8 -8
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/model/LeadFormState.d.ts +13 -0
- package/mobile/dist/retail/utils/updateOrganizationFields.js +3 -1
- package/mobile/dist/retail/utils/updateOrganizationFields.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/NameField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +11 -2
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +3 -0
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +138 -0
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +8 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +8 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js +1 -0
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js +1 -0
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/lib/retail/api/doRequest.d.ts +3 -0
- package/mobile/lib/retail/api/doRequest.js +1 -1
- package/mobile/lib/retail/api/doRequest.js.map +1 -1
- package/mobile/lib/retail/api/updateUserTask.d.ts +2 -0
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/api/uploadFile.d.ts +3 -0
- package/mobile/lib/retail/api/uploadFile.js +19 -0
- package/mobile/lib/retail/api/uploadFile.js.map +1 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +1 -0
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +10 -8
- 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 +8 -8
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/model/LeadFormState.d.ts +13 -0
- package/mobile/lib/retail/utils/updateOrganizationFields.js +3 -1
- package/mobile/lib/retail/utils/updateOrganizationFields.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/NameField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/NameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SurnameField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/SurnameField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +13 -2
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +185 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +64 -52
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +24 -8
- package/mobile/src/components/CreditCardForm/getCreditCardFormTaskData.ts +1 -0
- package/mobile/src/retail/adaptors/getCreditFormTaskData.ts +1 -0
- package/mobile/src/retail/api/doRequest.ts +1 -1
- package/mobile/src/retail/api/updateUserTask.ts +3 -0
- package/mobile/src/retail/api/uploadFile.ts +28 -0
- package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +1 -0
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +12 -7
- 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 +8 -8
- package/mobile/src/retail/model/LeadFormState.ts +14 -0
- package/mobile/src/retail/utils/updateOrganizationFields.ts +3 -1
- package/mobile/src/ui-kit/FormField/Fields/MiddleNameField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/Fields/NameField.tsx +8 -1
- package/mobile/src/ui-kit/FormField/Fields/SurnameField.tsx +8 -1
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +13 -2
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +185 -0
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +64 -52
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +24 -8
- package/src/components/CreditCardForm/getCreditCardFormTaskData.ts +1 -0
- package/src/retail/adaptors/getCreditFormTaskData.ts +1 -0
- package/src/retail/api/doRequest.ts +1 -1
- package/src/retail/api/updateUserTask.ts +3 -0
- package/src/retail/api/uploadFile.ts +28 -0
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +1 -0
- package/src/retail/components/Fields/DaDataInnField.tsx +12 -7
- 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 +8 -8
- package/src/retail/model/LeadFormState.ts +14 -0
- package/src/retail/utils/updateOrganizationFields.ts +3 -1
- package/src/ui-kit/FormField/Fields/MiddleNameField.tsx +2 -0
- package/src/ui-kit/FormField/Fields/NameField.tsx +8 -1
- package/src/ui-kit/FormField/Fields/SurnameField.tsx +8 -1
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +0 -63
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +0 -1
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +0 -60
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +0 -1
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +0 -3
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +0 -63
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +0 -1
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +0 -3
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +0 -60
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +0 -1
- package/mobile/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +0 -82
- package/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +0 -82
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAddressFromDaDataItem } from '../components/Fields/AddressField.js';
|
|
2
2
|
import { getEmployeesNumberOption, getOrganizationActivityType, getOrganizationKind, getOrganizationType, } from './getOrganizationParams.js';
|
|
3
3
|
export const updateOrganizationFields = (store, field, item) => {
|
|
4
|
-
const { okved, okopf, inn } = getOrganizationRequisites(item);
|
|
4
|
+
const { okved, okopf, inn, organizationName } = getOrganizationRequisites(item);
|
|
5
5
|
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
6
6
|
field?.('organizationAddress')?.onChange?.(getAddressFromDaDataItem(item.data?.address));
|
|
7
7
|
const organizationData = {
|
|
@@ -9,6 +9,7 @@ export const updateOrganizationFields = (store, field, item) => {
|
|
|
9
9
|
employerActivities: getOrganizationActivityType(store?.employerActivities ?? [], okved),
|
|
10
10
|
organization: getOrganizationType(store?.organization ?? [], okopf, inn),
|
|
11
11
|
employerOrganization: getOrganizationKind(store?.employerOrganization ?? [], okopf),
|
|
12
|
+
organizationName,
|
|
12
13
|
};
|
|
13
14
|
for (const fieldName in organizationData) {
|
|
14
15
|
organizationData[fieldName] && field?.(fieldName)?.onChange?.(organizationData[fieldName]);
|
|
@@ -18,5 +19,6 @@ const getOrganizationRequisites = (item) => ({
|
|
|
18
19
|
inn: item.data?.inn ?? '',
|
|
19
20
|
okopf: Number(item.data?.opf?.code),
|
|
20
21
|
okved: item.data?.okved ?? '',
|
|
22
|
+
organizationName: item.data?.name?.short_with_opf ?? '',
|
|
21
23
|
});
|
|
22
24
|
//# sourceMappingURL=updateOrganizationFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateOrganizationFields.js","sourceRoot":"","sources":["../../../src/retail/utils/updateOrganizationFields.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,KAAgC,EAChC,KAA+B,EAC/B,IAAsB,EACtB,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"updateOrganizationFields.js","sourceRoot":"","sources":["../../../src/retail/utils/updateOrganizationFields.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,KAAgC,EAChC,KAA+B,EAC/B,IAAsB,EACtB,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAEhF,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAExD,KAAK,EAAE,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,CACxC,wBAAwB,CAAC,IAAI,CAAC,IAAI,EAAE,OAA2B,CAAC,CACjE,CAAC;IAEF,MAAM,gBAAgB,GAAG;QACvB,aAAa,EAAE,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;QACxF,kBAAkB,EAAE,2BAA2B,CAAC,KAAK,EAAE,kBAAkB,IAAI,EAAE,EAAE,KAAK,CAAC;QACvF,YAAY,EAAE,mBAAmB,CAAC,KAAK,EAAE,YAAY,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC;QACxE,oBAAoB,EAAE,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,IAAI,EAAE,EAAE,KAAK,CAAC;QACnF,gBAAgB;KACjB,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,gBAAgB,EAAE;QACxC,gBAAgB,CAAC,SAAS,CAAC,IAAI,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;KAC5F;AACH,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,IAAsB,EAAE,EAAE,CAAC,CAAC;IAC7D,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE;IACzB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC;IACnC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;IAC7B,gBAAgB,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,IAAI,EAAE;CACxD,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { isEsiaAuthorize } from '../../../retail/utils/isEsiaAuthorize.js';
|
|
3
4
|
import { InputControl } from '../../Input/InputControl.js';
|
|
4
|
-
export const MiddleNameField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", maxLength: 60, ...field(input?.name ?? ''), ...input })));
|
|
5
|
+
export const MiddleNameField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", maxLength: 60, disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(input?.name ?? ''), ...input })));
|
|
5
6
|
//# sourceMappingURL=MiddleNameField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiddleNameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/MiddleNameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACzE,KAAC,YAAY,IACX,KAAK,EAAC,sLAAqC,EAC3C,SAAS,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"MiddleNameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/MiddleNameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACzE,KAAC,YAAY,IACX,KAAK,EAAC,sLAAqC,EAC3C,SAAS,EAAE,EAAE,EACb,QAAQ,EAAE,KAAK,EAAE,YAAY,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,KACrE,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,KACxB,KAAK,GACT,CACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { isEsiaAuthorize } from '../../../retail/utils/isEsiaAuthorize.js';
|
|
3
4
|
import { InputControl } from '../../Input/InputControl.js';
|
|
4
|
-
export const NameField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u0418\u043C\u044F", maxLength: 60, ...field(input?.name ?? ''), ...input })));
|
|
5
|
+
export const NameField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u0418\u043C\u044F", maxLength: 60, disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(input?.name ?? ''), ...input })));
|
|
5
6
|
//# sourceMappingURL=NameField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/NameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACnE,KAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"NameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/NameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACnE,KAAC,YAAY,IACX,KAAK,EAAC,oBAAK,EACX,SAAS,EAAE,EAAE,EACb,QAAQ,EAAE,KAAK,EAAE,YAAY,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,KACrE,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,KACxB,KAAK,GACT,CACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { isEsiaAuthorize } from '../../../retail/utils/isEsiaAuthorize.js';
|
|
3
4
|
import { InputControl } from '../../Input/InputControl.js';
|
|
4
|
-
export const SurnameField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", maxLength: 60, ...field(input?.name ?? ''), ...input })));
|
|
5
|
+
export const SurnameField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", maxLength: 60, disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(input?.name ?? ''), ...input })));
|
|
5
6
|
//# sourceMappingURL=SurnameField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SurnameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/SurnameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACtE,KAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"SurnameField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/SurnameField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACtE,KAAC,YAAY,IACX,KAAK,EAAC,4CAAS,EACf,SAAS,EAAE,EAAE,EACb,QAAQ,EAAE,KAAK,EAAE,YAAY,IAAI,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,KACrE,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,KACxB,KAAK,GACT,CACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
4
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
4
5
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
5
6
|
import { validatorObj } from '../../retail/validator/validatorObj';
|
|
@@ -10,6 +11,7 @@ import { inputColumnStyles } from '../../ui-kit/FormField/inputColumnStyle';
|
|
|
10
11
|
import { renderTitle } from '../../ui-kit/FormField/renderTitle';
|
|
11
12
|
import { Loader } from '../../ui-kit/Loader/Loader';
|
|
12
13
|
import { ResponseTypeDialog } from '../../ui-kit/ResponseTypeDialog/ResponseTypeDialog';
|
|
14
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
13
15
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
14
16
|
import { style } from '../../utils/style';
|
|
15
17
|
import { getApplicationFormData } from './applicationFormData';
|
|
@@ -32,6 +34,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
32
34
|
data,
|
|
33
35
|
...rest
|
|
34
36
|
}) => {
|
|
37
|
+
const [esiaError, { setTrue: setEsiaError }] = useBool(false);
|
|
35
38
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
36
39
|
const inputs = useMemo(
|
|
37
40
|
() => (applicationFormData?.flatMap((_) => _?.inputs) || []) as FieldRetailDef[],
|
|
@@ -40,15 +43,17 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
40
43
|
|
|
41
44
|
const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
|
|
42
45
|
|
|
43
|
-
const [initialFormState, { isLoading }] = useInitApplicationLead(
|
|
46
|
+
const [initialFormState, { isLoading }] = useInitApplicationLead({
|
|
44
47
|
inputs,
|
|
45
48
|
nextStepLink,
|
|
46
49
|
productType,
|
|
47
|
-
|
|
50
|
+
setEsiaError,
|
|
51
|
+
});
|
|
48
52
|
const { isSending, ok, handleSubmit } = useApplicationLeadApi({
|
|
49
53
|
programId,
|
|
50
54
|
nextStepLink,
|
|
51
55
|
productType,
|
|
56
|
+
esiaError,
|
|
52
57
|
data,
|
|
53
58
|
});
|
|
54
59
|
|
|
@@ -82,6 +87,12 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
82
87
|
</div>
|
|
83
88
|
))}
|
|
84
89
|
{renderSubmitButton(button, isSending)}
|
|
90
|
+
{esiaError ? (
|
|
91
|
+
<Text size="text-m" font="font-medium" color="text-error">
|
|
92
|
+
Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля
|
|
93
|
+
вручную.
|
|
94
|
+
</Text>
|
|
95
|
+
) : null}
|
|
85
96
|
</form>
|
|
86
97
|
</ApplicationFormLayout>
|
|
87
98
|
);
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
import { type UpdateProfileEsiaResponse } from '../../retail/api/updateProfileEsia';
|
|
3
|
+
import { uploadFile, type DocumentCategory } from '../../retail/api/uploadFile';
|
|
4
|
+
import { type Address, type File, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
5
|
+
import { normalizePhone } from '../../ui-kit/PhoneInput/normalizePhone';
|
|
6
|
+
|
|
7
|
+
export const parseEsiaProfile = async (
|
|
8
|
+
esiaProfile: UpdateProfileEsiaResponse,
|
|
9
|
+
taskId: string,
|
|
10
|
+
isDebit: boolean,
|
|
11
|
+
): Promise<LeadFormState> => {
|
|
12
|
+
isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
|
|
13
|
+
|
|
14
|
+
const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } =
|
|
15
|
+
esiaProfile;
|
|
16
|
+
const files: File[] = [];
|
|
17
|
+
|
|
18
|
+
if (!isDebit) {
|
|
19
|
+
await saveDocument({
|
|
20
|
+
document: esiaAdditionalDocument.pdfFileWorkbook,
|
|
21
|
+
taskId,
|
|
22
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
23
|
+
files,
|
|
24
|
+
});
|
|
25
|
+
await saveDocument({
|
|
26
|
+
document: esiaAdditionalDocument.pdfFilePayout,
|
|
27
|
+
taskId,
|
|
28
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
29
|
+
files,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const mainData = {
|
|
34
|
+
name: profile.name,
|
|
35
|
+
surname: profile.surname,
|
|
36
|
+
middleName: profile.midname,
|
|
37
|
+
limitedBirthday: profile.birthDate,
|
|
38
|
+
phone: normalizePhone(profile.phone),
|
|
39
|
+
email: profile.email,
|
|
40
|
+
dulIssueDate: document.dulIssueDate,
|
|
41
|
+
dulIssuedBy: document.dulIssuedBy,
|
|
42
|
+
dulNumber: document.dulNumber,
|
|
43
|
+
dulSerie: document.dulSerie,
|
|
44
|
+
dulSubdivisionCode: document.dulSubdivisionCode,
|
|
45
|
+
birthPlace: addInfo.birthPlace,
|
|
46
|
+
addressRegistration: buildAddress(addressRegistration),
|
|
47
|
+
addressFact: buildAddress(addressFact),
|
|
48
|
+
esiaAccountTypeCd: profile.esiaAccountType,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
...mainData,
|
|
53
|
+
...(!isDebit && {
|
|
54
|
+
snils: addInfo.snils,
|
|
55
|
+
inn: esiaAdditionalDocument.inn,
|
|
56
|
+
wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
|
|
57
|
+
beginDate: esiaAdditionalDocument.startWorkDate,
|
|
58
|
+
experience5Years: getYearFromMonth(esiaAdditionalDocument.workLengthInFiveYears).toString(),
|
|
59
|
+
generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
|
|
60
|
+
lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
|
|
61
|
+
jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
62
|
+
files,
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const concatFullAddress = (address: Array<string | undefined>): string => {
|
|
68
|
+
return address.reduce((acc: string, value) => {
|
|
69
|
+
if (value) {
|
|
70
|
+
return acc ? `${acc}, ${value}` : value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return acc;
|
|
74
|
+
}, '');
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']): Address => {
|
|
78
|
+
const {
|
|
79
|
+
postcode,
|
|
80
|
+
region,
|
|
81
|
+
regionCode,
|
|
82
|
+
locality,
|
|
83
|
+
city,
|
|
84
|
+
street,
|
|
85
|
+
house,
|
|
86
|
+
building,
|
|
87
|
+
block,
|
|
88
|
+
apartment,
|
|
89
|
+
} = fields;
|
|
90
|
+
|
|
91
|
+
const place = locality || city;
|
|
92
|
+
|
|
93
|
+
const fullAddress = concatFullAddress([
|
|
94
|
+
postcode,
|
|
95
|
+
region,
|
|
96
|
+
place,
|
|
97
|
+
street ? `ул ${street}` : undefined,
|
|
98
|
+
house ? `д ${house}` : undefined,
|
|
99
|
+
block ? `к ${block}` : undefined,
|
|
100
|
+
building ? `стр ${building}` : undefined,
|
|
101
|
+
apartment ? `кв ${apartment}` : undefined,
|
|
102
|
+
]);
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
...fields,
|
|
106
|
+
regionCode: regionCode?.key,
|
|
107
|
+
fullAddress,
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const getYearFromMonth = (month: number) => Math.floor(month / 12);
|
|
112
|
+
|
|
113
|
+
const saveDocument = async ({
|
|
114
|
+
document,
|
|
115
|
+
taskId,
|
|
116
|
+
category,
|
|
117
|
+
files,
|
|
118
|
+
}: {
|
|
119
|
+
document: string;
|
|
120
|
+
taskId: string;
|
|
121
|
+
category: DocumentCategory;
|
|
122
|
+
files: File[];
|
|
123
|
+
}) => {
|
|
124
|
+
await fetch(`data:'application/pdf';base64,${document}`)
|
|
125
|
+
.then((res) => res.blob())
|
|
126
|
+
.then((value) => uploadFile(value, taskId, category))
|
|
127
|
+
.then((file) => files.push(file));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
|
|
131
|
+
const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
|
|
132
|
+
|
|
133
|
+
const data = [
|
|
134
|
+
profile.name,
|
|
135
|
+
profile.surname,
|
|
136
|
+
profile.midname,
|
|
137
|
+
profile.birthDate,
|
|
138
|
+
profile.phone,
|
|
139
|
+
profile.email,
|
|
140
|
+
document.dulIssueDate,
|
|
141
|
+
document.dulIssuedBy,
|
|
142
|
+
document.dulNumber,
|
|
143
|
+
document.dulSerie,
|
|
144
|
+
document.dulSubdivisionCode,
|
|
145
|
+
addressRegistration,
|
|
146
|
+
profile.esiaAccountType,
|
|
147
|
+
esiaAdditionalDocument.inn,
|
|
148
|
+
esiaAdditionalDocument.averageMonthlyIncome.toString(),
|
|
149
|
+
esiaAdditionalDocument.startWorkDate,
|
|
150
|
+
esiaAdditionalDocument.workLengthInFiveYears.toString(),
|
|
151
|
+
esiaAdditionalDocument.workLength.toString(),
|
|
152
|
+
esiaAdditionalDocument.workLengthLastJob.toString(),
|
|
153
|
+
esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
154
|
+
esiaAdditionalDocument.pdfFilePayout,
|
|
155
|
+
esiaAdditionalDocument.pdfFileWorkbook,
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
if (!data.every((_) => Boolean(_))) {
|
|
159
|
+
throw new Error();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const checkEsiaDataForDebit = (esiaProfile: UpdateProfileEsiaResponse) => {
|
|
164
|
+
const { profile, document, addressRegistration } = esiaProfile;
|
|
165
|
+
|
|
166
|
+
const data = [
|
|
167
|
+
profile.name,
|
|
168
|
+
profile.surname,
|
|
169
|
+
profile.midname,
|
|
170
|
+
profile.birthDate,
|
|
171
|
+
profile.phone,
|
|
172
|
+
profile.email,
|
|
173
|
+
document.dulIssueDate,
|
|
174
|
+
document.dulIssuedBy,
|
|
175
|
+
document.dulNumber,
|
|
176
|
+
document.dulSerie,
|
|
177
|
+
document.dulSubdivisionCode,
|
|
178
|
+
addressRegistration,
|
|
179
|
+
profile.esiaAccountType,
|
|
180
|
+
];
|
|
181
|
+
|
|
182
|
+
if (!data.every((_) => Boolean(_))) {
|
|
183
|
+
throw new Error();
|
|
184
|
+
}
|
|
185
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
4
|
+
import { locationNavigator } from '../../external/locationNavigator';
|
|
4
5
|
import { type AspectsProps } from '../../model/AspectsProps';
|
|
5
6
|
import { createDraftTask } from '../../retail/api/createDraftTask';
|
|
6
7
|
import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
@@ -27,6 +28,7 @@ interface ApplicationLeadApiProps extends AspectsProps {
|
|
|
27
28
|
programId: string;
|
|
28
29
|
nextStepLink: string;
|
|
29
30
|
productType: ProductType;
|
|
31
|
+
esiaError: boolean;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -34,76 +36,86 @@ export const useApplicationLeadApi = ({
|
|
|
34
36
|
programId,
|
|
35
37
|
nextStepLink,
|
|
36
38
|
productType,
|
|
39
|
+
esiaError,
|
|
37
40
|
data,
|
|
38
41
|
}: ApplicationLeadApiProps) => {
|
|
39
42
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
40
43
|
const [ok, setOK] = useState<boolean | undefined>();
|
|
41
44
|
const saveUserData = useSaveUserData();
|
|
42
45
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
46
|
+
const navigator = locationNavigator();
|
|
43
47
|
|
|
44
48
|
const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
|
|
45
49
|
const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
|
|
46
50
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
47
51
|
const draftDialog = useDraftDialog();
|
|
48
52
|
|
|
49
|
-
const handleSubmit = useCallback(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
profile: { phone: formatPhone(formData.phone as string) },
|
|
54
|
-
});
|
|
53
|
+
const handleSubmit = useCallback(
|
|
54
|
+
async (formData: LeadFormState) => {
|
|
55
|
+
if (esiaError) {
|
|
56
|
+
navigator.assign(nextStepLink);
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (lastTaskId) {
|
|
78
|
-
const task = await getTaskById({ taskId: lastTaskId });
|
|
79
|
-
verifyPhoneDialog.close();
|
|
80
|
-
draftDialog.open({
|
|
81
|
-
task,
|
|
82
|
-
isFromLead: true,
|
|
83
|
-
sendAspects,
|
|
84
|
-
onClose: sendCurrentTask,
|
|
85
|
-
});
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
startSending();
|
|
62
|
+
const profileId = await createUserProfile({
|
|
63
|
+
profile: { phone: formatPhone(formData.phone as string) },
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (profileId && formData?.phone) {
|
|
67
|
+
const sendCurrentTask = async () => {
|
|
68
|
+
await updateUserData({
|
|
69
|
+
programId,
|
|
70
|
+
profileId,
|
|
71
|
+
formData,
|
|
72
|
+
productType,
|
|
73
|
+
saveUserData,
|
|
74
|
+
sendAspects,
|
|
75
|
+
});
|
|
76
|
+
verifyPhoneDialog.close();
|
|
77
|
+
if (productType === 'debitCard') {
|
|
78
|
+
openEsiaLoginDialog();
|
|
86
79
|
} else {
|
|
87
|
-
|
|
80
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
88
81
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
};
|
|
83
|
+
const handleSuccessVerify = async () => {
|
|
84
|
+
try {
|
|
85
|
+
const lastTaskId = await getLastTaskStatus({ profileId, programId });
|
|
86
|
+
|
|
87
|
+
if (lastTaskId) {
|
|
88
|
+
const task = await getTaskById({ taskId: lastTaskId });
|
|
89
|
+
verifyPhoneDialog.close();
|
|
90
|
+
draftDialog.open({
|
|
91
|
+
task,
|
|
92
|
+
isFromLead: true,
|
|
93
|
+
sendAspects,
|
|
94
|
+
onClose: sendCurrentTask,
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
await sendCurrentTask();
|
|
98
|
+
}
|
|
99
|
+
} catch {
|
|
100
|
+
setOK(false);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
93
103
|
|
|
94
|
-
|
|
104
|
+
const acceptedConsents = getAcceptedConsents(formData, productType);
|
|
95
105
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
verifyPhoneDialog.open({
|
|
107
|
+
phone: formData?.phone,
|
|
108
|
+
consents: acceptedConsents,
|
|
109
|
+
onSuccess: handleSuccessVerify,
|
|
110
|
+
});
|
|
111
|
+
endSending();
|
|
112
|
+
}
|
|
113
|
+
} catch {
|
|
114
|
+
setOK(false);
|
|
102
115
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, []);
|
|
116
|
+
},
|
|
117
|
+
[esiaError],
|
|
118
|
+
);
|
|
107
119
|
|
|
108
120
|
return { isSending, ok, handleSubmit };
|
|
109
121
|
};
|
|
@@ -8,14 +8,22 @@ import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
|
8
8
|
import { safeJsonParse } from '../../utils/safeJsonParse';
|
|
9
9
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
10
10
|
import { getInitialFormState } from './getInitialFormState';
|
|
11
|
-
import { parseEsiaProfile } from './
|
|
11
|
+
import { parseEsiaProfile } from './parseEsiaProfile';
|
|
12
12
|
import { useLeadFormStore } from './useLeadFormStore';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
inputs: FieldRetailDef[]
|
|
16
|
-
nextStepLink: string
|
|
17
|
-
productType: ProductType
|
|
18
|
-
|
|
14
|
+
type InitApplicationLeadProps = {
|
|
15
|
+
inputs: FieldRetailDef[];
|
|
16
|
+
nextStepLink: string;
|
|
17
|
+
productType: ProductType;
|
|
18
|
+
setEsiaError: () => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const useInitApplicationLead = ({
|
|
22
|
+
inputs,
|
|
23
|
+
nextStepLink,
|
|
24
|
+
productType,
|
|
25
|
+
setEsiaError,
|
|
26
|
+
}: InitApplicationLeadProps): [LeadFormState, { isLoading: boolean }] => {
|
|
19
27
|
const navigator = locationNavigator();
|
|
20
28
|
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
21
29
|
|
|
@@ -38,14 +46,22 @@ export const useInitApplicationLead = (
|
|
|
38
46
|
redirectUri: globalThis.location?.href,
|
|
39
47
|
});
|
|
40
48
|
|
|
41
|
-
if (data) {
|
|
49
|
+
if (data && leadFormStore?.taskId) {
|
|
50
|
+
const parsedData = await parseEsiaProfile(
|
|
51
|
+
data,
|
|
52
|
+
leadFormStore.taskId.toString(),
|
|
53
|
+
productType === 'debitCard',
|
|
54
|
+
);
|
|
55
|
+
|
|
42
56
|
saveForm((_) => ({
|
|
43
57
|
..._,
|
|
44
|
-
...
|
|
58
|
+
...parsedData,
|
|
45
59
|
}));
|
|
46
60
|
}
|
|
47
61
|
|
|
48
62
|
navigator.assign(nextStepLink);
|
|
63
|
+
} catch {
|
|
64
|
+
setEsiaError();
|
|
49
65
|
} finally {
|
|
50
66
|
endLoading();
|
|
51
67
|
}
|
|
@@ -38,7 +38,7 @@ export async function doRequest(
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const getAuthorizationHeaders = () => {
|
|
41
|
+
export const getAuthorizationHeaders = () => {
|
|
42
42
|
const token = sessionStorage.getItem('accessToken');
|
|
43
43
|
|
|
44
44
|
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
1
2
|
import { type Nullable } from '@redneckz/uni-jsx/lib/utils/ts/Nullable';
|
|
2
3
|
import { type Option } from '../../ui-kit/Select/Option';
|
|
4
|
+
import { type File } from '../model/LeadFormState';
|
|
3
5
|
import { doRequest } from './doRequest';
|
|
4
6
|
|
|
5
7
|
type ParticipantAddress = {
|
|
@@ -145,6 +147,7 @@ export type UpdateUserTaskBody = {
|
|
|
145
147
|
creditPeriod?: number;
|
|
146
148
|
paymentTypeCd?: PaymentType;
|
|
147
149
|
marketingInfo?: MarketingInfo;
|
|
150
|
+
files?: File[];
|
|
148
151
|
};
|
|
149
152
|
};
|
|
150
153
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type File } from '../model/LeadFormState';
|
|
2
|
+
import { getAuthorizationHeaders } from './doRequest';
|
|
3
|
+
|
|
4
|
+
export type DocumentCategory = 'CONFIRMING_EMPLOYMENT_DOC' | 'CONFIRMING_INCOME_DOC';
|
|
5
|
+
|
|
6
|
+
export const uploadFile = async (
|
|
7
|
+
file: Blob,
|
|
8
|
+
taskId: string,
|
|
9
|
+
documentCategory: DocumentCategory,
|
|
10
|
+
): Promise<File> => {
|
|
11
|
+
const fd = new FormData();
|
|
12
|
+
fd.append('taskId', taskId);
|
|
13
|
+
fd.append('documentCategory', documentCategory);
|
|
14
|
+
fd.append('file', file, 'file.pdf');
|
|
15
|
+
|
|
16
|
+
const res = await globalThis
|
|
17
|
+
?.fetch?.(`/light-api-cash/v1/file`, {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
headers: {
|
|
20
|
+
...getAuthorizationHeaders(),
|
|
21
|
+
},
|
|
22
|
+
credentials: 'include',
|
|
23
|
+
body: fd,
|
|
24
|
+
})
|
|
25
|
+
.then((response) => response.json());
|
|
26
|
+
|
|
27
|
+
return res;
|
|
28
|
+
};
|
|
@@ -4,37 +4,42 @@ 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
|
|
|
10
11
|
export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
11
12
|
const store = useRetailFormStore();
|
|
13
|
+
const { employerActivities, employerOrganization, organization, amountWorkers } = store;
|
|
12
14
|
const esiaAccountTypeCd = field?.('esiaAccountTypeCd')?.value;
|
|
13
15
|
const inn = field?.('inn')?.value;
|
|
14
16
|
|
|
15
17
|
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
16
|
-
field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
|
|
17
18
|
updateOrganizationFields(store, field, item);
|
|
18
19
|
}, []);
|
|
19
20
|
|
|
20
21
|
useEffect(() => {
|
|
21
|
-
if (
|
|
22
|
+
if (
|
|
23
|
+
!esiaAccountTypeCd ||
|
|
24
|
+
!inn ||
|
|
25
|
+
!(employerActivities && employerOrganization && organization && amountWorkers)
|
|
26
|
+
) {
|
|
22
27
|
return;
|
|
23
28
|
}
|
|
24
29
|
(async () => {
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
field
|
|
28
|
-
updateOrganizationFields(store, field, organization);
|
|
30
|
+
const organizationData = await getOrganizationFromInn(inn as string);
|
|
31
|
+
if (organizationData) {
|
|
32
|
+
updateOrganizationFields(store, field, organizationData);
|
|
29
33
|
}
|
|
30
34
|
})();
|
|
31
|
-
}, []);
|
|
35
|
+
}, [employerActivities, employerOrganization, organization, amountWorkers]);
|
|
32
36
|
|
|
33
37
|
return (
|
|
34
38
|
<DaDataInputControl
|
|
35
39
|
label="ИНН"
|
|
36
40
|
isInteger={true}
|
|
37
41
|
maxLength={12}
|
|
42
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input.name ?? '')}
|
|
38
43
|
{...input}
|
|
39
44
|
{...field(input?.name ?? '')}
|
|
40
45
|
onDaDataChange={onDaDataChange}
|