@redneckz/wildless-cms-uni-blocks 0.14.823 → 0.14.824
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 +229 -198
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/bundle/retail/api/checkCode.d.ts +1 -0
- package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
- package/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/bundle/retail/api/uploadFile.d.ts +1 -1
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/retail/api/checkCode.d.ts +1 -0
- package/dist/retail/api/checkCode.js +3 -2
- package/dist/retail/api/checkCode.js.map +1 -1
- package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/dist/retail/api/esiaRequestProfile.js +10 -0
- package/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/dist/retail/api/updateUserTask.d.ts +1 -0
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/uploadFile.d.ts +1 -1
- package/dist/retail/api/uploadFile.js +2 -3
- package/dist/retail/api/uploadFile.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.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 +11 -5
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/utils/mainFormStateMap.js +1 -0
- package/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/retail/api/checkCode.d.ts +1 -0
- package/lib/retail/api/checkCode.js +1 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/lib/retail/api/esiaRequestProfile.js +7 -0
- package/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/lib/retail/api/updateUserTask.d.ts +1 -0
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/uploadFile.d.ts +1 -1
- package/lib/retail/api/uploadFile.js +2 -3
- package/lib/retail/api/uploadFile.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.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 +11 -5
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/utils/mainFormStateMap.js +1 -0
- package/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +229 -198
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
- package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +1 -0
- package/mobile/dist/retail/api/checkCode.js +3 -2
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
- package/mobile/dist/retail/api/uploadFile.js +2 -3
- package/mobile/dist/retail/api/uploadFile.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.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 +11 -5
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
- package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +1 -0
- package/mobile/lib/retail/api/checkCode.js +1 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
- package/mobile/lib/retail/api/uploadFile.js +2 -3
- package/mobile/lib/retail/api/uploadFile.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.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 +11 -5
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
- package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
- package/mobile/src/retail/api/checkCode.ts +1 -1
- package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/mobile/src/retail/api/updateUserTask.ts +1 -0
- package/mobile/src/retail/api/uploadFile.ts +2 -3
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- 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 +11 -5
- package/mobile/src/retail/model/NameFieldDef.ts +1 -0
- package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
- package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
- package/src/retail/api/checkCode.ts +1 -1
- package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/src/retail/api/updateUserTask.ts +1 -0
- package/src/retail/api/uploadFile.ts +2 -3
- package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- 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 +11 -5
- package/src/retail/model/NameFieldDef.ts +1 -0
- package/src/retail/utils/mainFormStateMap.ts +1 -0
- package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/api/updateProfileEsia.js +0 -6
- package/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/lib/retail/api/updateProfileEsia.js +0 -3
- package/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
- package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
- package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
/* eslint-disable max-lines-per-function */
|
|
1
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
5
5
|
import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
|
|
6
6
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
@@ -18,6 +18,7 @@ import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
|
18
18
|
import { style } from '../../utils/style';
|
|
19
19
|
import { getApplicationFormData } from './applicationFormData';
|
|
20
20
|
import { type ApplicationLeadFormContent, type ProductType } from './ApplicationLeadFormContent';
|
|
21
|
+
import { EsiaLoginBanner } from './EsiaLoginBanner';
|
|
21
22
|
import { renderInputs } from './renderInputs';
|
|
22
23
|
import { renderSubmitButton } from './renderSubmitButton';
|
|
23
24
|
import { useApplicationLeadApi } from './useApplicationLeadApi';
|
|
@@ -25,6 +26,12 @@ import { useInitApplicationLead } from './useInitApplicationLead';
|
|
|
25
26
|
|
|
26
27
|
interface ApplicationLeadFormProps extends ApplicationLeadFormContent, UniBlockProps {}
|
|
27
28
|
|
|
29
|
+
export enum EsiaStatuses {
|
|
30
|
+
Success = 'SUCCESS',
|
|
31
|
+
Error = 'ERROR',
|
|
32
|
+
Pending = 'PENDING',
|
|
33
|
+
}
|
|
34
|
+
|
|
28
35
|
export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
29
36
|
({
|
|
30
37
|
className,
|
|
@@ -36,7 +43,8 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
36
43
|
data,
|
|
37
44
|
...rest
|
|
38
45
|
}) => {
|
|
39
|
-
const [
|
|
46
|
+
const [esiaStatus, setEsiaStatus] = useState<EsiaStatuses>();
|
|
47
|
+
const leadForm = useRef<HTMLFormElement | null>(null);
|
|
40
48
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
41
49
|
const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
|
|
42
50
|
|
|
@@ -46,21 +54,21 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
46
54
|
[inputs, extendedValidatorObj],
|
|
47
55
|
);
|
|
48
56
|
|
|
49
|
-
const
|
|
57
|
+
const initialFormState = useInitApplicationLead({
|
|
50
58
|
inputs,
|
|
51
59
|
nextStepLink,
|
|
52
60
|
productType,
|
|
53
|
-
|
|
61
|
+
setEsiaStatus,
|
|
62
|
+
esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
|
|
54
63
|
});
|
|
55
64
|
const { isSending, ok, handleSubmit } = useApplicationLeadApi({
|
|
56
65
|
programId,
|
|
57
66
|
nextStepLink,
|
|
58
67
|
productType,
|
|
59
|
-
esiaError,
|
|
60
68
|
data,
|
|
61
69
|
});
|
|
62
70
|
|
|
63
|
-
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
71
|
+
const [, { field, onSubmit, reset }] = useForm(initialFormState, {
|
|
64
72
|
formValidator,
|
|
65
73
|
onSubmit: handleSubmit,
|
|
66
74
|
});
|
|
@@ -72,14 +80,27 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
72
80
|
}
|
|
73
81
|
}, [ok]);
|
|
74
82
|
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (esiaStatus && leadForm?.current) {
|
|
85
|
+
leadForm.current.scrollIntoView({
|
|
86
|
+
block: 'start',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (esiaStatus === EsiaStatuses.Success) {
|
|
91
|
+
reset();
|
|
92
|
+
}
|
|
93
|
+
}, [leadForm?.current, esiaStatus]);
|
|
94
|
+
|
|
75
95
|
return (
|
|
76
96
|
<ApplicationFormLayout
|
|
77
97
|
className={style('container space-y-m', className)}
|
|
78
98
|
title={title}
|
|
79
99
|
{...rest}
|
|
80
100
|
>
|
|
81
|
-
<
|
|
82
|
-
|
|
101
|
+
{!esiaStatus ? <EsiaLoginBanner /> : null}
|
|
102
|
+
<form onSubmit={onSubmit} className="space-y-m relative" ref={leadForm}>
|
|
103
|
+
{esiaStatus === EsiaStatuses.Pending ? <Loader blur={false} /> : null}
|
|
83
104
|
{applicationFormData.map((_, i) => (
|
|
84
105
|
<div
|
|
85
106
|
key={`section-${i}`}
|
|
@@ -90,7 +111,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
90
111
|
</div>
|
|
91
112
|
))}
|
|
92
113
|
{renderSubmitButton(button, isSending)}
|
|
93
|
-
{
|
|
114
|
+
{esiaStatus === EsiaStatuses.Error ? (
|
|
94
115
|
<Text size="text-m" font="font-medium" color="text-error">
|
|
95
116
|
Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля
|
|
96
117
|
вручную.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { locationNavigator } from '../../external/locationNavigator';
|
|
4
|
+
import { getLink } from '../../retail/api/getLink';
|
|
5
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
6
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
7
|
+
|
|
8
|
+
export interface EsiaLoginBannerProps {
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(() => {
|
|
13
|
+
const navigator = locationNavigator();
|
|
14
|
+
|
|
15
|
+
const handleAuth = useCallback(async () => {
|
|
16
|
+
const resp = await getLink({
|
|
17
|
+
redirectUri: globalThis.location.origin + globalThis.location.pathname,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (resp?.link) {
|
|
21
|
+
navigator.assign(resp.link);
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className="flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9">
|
|
27
|
+
<div className="flex flex-col justify-around w-full">
|
|
28
|
+
<p className="mb-4 text-xl @md:text-2xl @md:mb-6">Заполните данные через Госуслуги</p>
|
|
29
|
+
<ul className="list-disc list-inside mb-9">
|
|
30
|
+
<li>Вероятность одобрения выше</li>
|
|
31
|
+
<li>Без справок о доходах и трудоустройстве</li>
|
|
32
|
+
<li>С защитой Ваших данных</li>
|
|
33
|
+
</ul>
|
|
34
|
+
<Img
|
|
35
|
+
className="block mb-6 self-center @md:hidden"
|
|
36
|
+
image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
|
|
37
|
+
height="80"
|
|
38
|
+
width="80"
|
|
39
|
+
/>
|
|
40
|
+
<Button type="button" onClick={handleAuth} className="w-full @md:w-fit">
|
|
41
|
+
Заполнить
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
44
|
+
<Img
|
|
45
|
+
className="hidden @md:block"
|
|
46
|
+
image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
|
|
47
|
+
height="164"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
});
|
|
@@ -3,32 +3,6 @@ import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
|
3
3
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
4
4
|
import { productTypeToConsentsMap } from './consents';
|
|
5
5
|
|
|
6
|
-
export const applicationFormData: SectionsRetailProps[] = [
|
|
7
|
-
{
|
|
8
|
-
columns: 2,
|
|
9
|
-
inputs: [
|
|
10
|
-
{ name: 'surname', required: true, dadata: true },
|
|
11
|
-
{ name: 'name', required: true, dadata: true },
|
|
12
|
-
{ name: 'middleName', dadata: true },
|
|
13
|
-
{ name: 'limitedBirthday', required: true },
|
|
14
|
-
{ name: 'phone', required: true },
|
|
15
|
-
{ name: 'email', required: true, dadata: true },
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
inputs: [
|
|
20
|
-
{ name: 'processPersonalDataFlg', required: true },
|
|
21
|
-
{ name: 'consentProviderFlg', required: true },
|
|
22
|
-
{ name: 'consentOthersFlg', required: true },
|
|
23
|
-
{ name: 'consentInformFlg' },
|
|
24
|
-
{ name: 'consentPfrFlg' },
|
|
25
|
-
{ name: 'consentInformMaterialsFlg' },
|
|
26
|
-
{ name: 'consentPhotoFlg' },
|
|
27
|
-
{ name: 'consentFATCA' },
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
6
|
export const getApplicationFormData = (productType: ProductType): SectionsRetailProps[] => {
|
|
33
7
|
const currentProductConsents = productTypeToConsentsMap[productType];
|
|
34
8
|
const allConsents: FieldRetailDef[] = [
|
|
@@ -46,11 +20,11 @@ export const getApplicationFormData = (productType: ProductType): SectionsRetail
|
|
|
46
20
|
{
|
|
47
21
|
columns: 2,
|
|
48
22
|
inputs: [
|
|
49
|
-
{ name: 'surname', required: true, dadata: true },
|
|
50
|
-
{ name: 'name', required: true, dadata: true },
|
|
51
|
-
{ name: 'middleName', dadata: true },
|
|
52
|
-
{ name: 'limitedBirthday', required: true },
|
|
53
|
-
{ name: 'phone', required: true },
|
|
23
|
+
{ name: 'surname', required: true, dadata: true, filledByEsia: true },
|
|
24
|
+
{ name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
25
|
+
{ name: 'middleName', dadata: true, filledByEsia: true },
|
|
26
|
+
{ name: 'limitedBirthday', required: true, filledByEsia: true },
|
|
27
|
+
{ name: 'phone', required: true, filledByEsia: true },
|
|
54
28
|
{ name: 'email', required: true, dadata: true },
|
|
55
29
|
],
|
|
56
30
|
},
|
|
@@ -21,9 +21,16 @@ const initialFormState = {
|
|
|
21
21
|
export const getInitialFormState = (
|
|
22
22
|
inputs: FieldRetailDef[],
|
|
23
23
|
savedForm: LeadFormState | null,
|
|
24
|
+
esiaAuthSuccess: boolean,
|
|
24
25
|
): LeadFormState => {
|
|
25
26
|
if (savedForm) {
|
|
26
|
-
return {
|
|
27
|
+
return {
|
|
28
|
+
...savedForm,
|
|
29
|
+
limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
|
|
30
|
+
...(!esiaAuthSuccess && {
|
|
31
|
+
esiaAccountTypeCd: { key: '' },
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
|
-
|
|
2
|
+
/* eslint-disable max-lines-per-function */
|
|
3
|
+
import { type EsiaRequestProfileResponse } from '../../retail/api/esiaRequestProfile';
|
|
3
4
|
import { uploadFile, type DocumentCategory } from '../../retail/api/uploadFile';
|
|
4
5
|
import { type Address, type File, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
5
6
|
import { normalizePhone } from '../../ui-kit/PhoneInput/normalizePhone';
|
|
6
7
|
|
|
7
8
|
export const parseEsiaProfile = async (
|
|
8
|
-
esiaProfile:
|
|
9
|
-
taskId: string,
|
|
9
|
+
esiaProfile: EsiaRequestProfileResponse,
|
|
10
10
|
isDebit: boolean,
|
|
11
11
|
): Promise<LeadFormState> => {
|
|
12
|
-
|
|
12
|
+
checkEsiaData(esiaProfile);
|
|
13
|
+
const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
|
|
13
14
|
|
|
14
15
|
const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } =
|
|
15
16
|
esiaProfile;
|
|
16
|
-
|
|
17
|
+
let files: File[] = [];
|
|
17
18
|
|
|
18
|
-
if (
|
|
19
|
-
await
|
|
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
|
-
});
|
|
19
|
+
if (isFullEsiaData) {
|
|
20
|
+
files = await saveDocuments(esiaAdditionalDocument);
|
|
31
21
|
}
|
|
32
22
|
|
|
33
23
|
const mainData = {
|
|
@@ -45,12 +35,12 @@ export const parseEsiaProfile = async (
|
|
|
45
35
|
birthPlace: addInfo.birthPlace,
|
|
46
36
|
addressRegistration: buildAddress(addressRegistration),
|
|
47
37
|
addressFact: buildAddress(addressFact),
|
|
48
|
-
esiaAccountTypeCd: profile.esiaAccountType,
|
|
38
|
+
esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
|
|
49
39
|
};
|
|
50
40
|
|
|
51
41
|
return {
|
|
52
42
|
...mainData,
|
|
53
|
-
...(
|
|
43
|
+
...(isFullEsiaData && {
|
|
54
44
|
snils: addInfo.snils,
|
|
55
45
|
inn: esiaAdditionalDocument.inn,
|
|
56
46
|
wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
|
|
@@ -59,6 +49,9 @@ export const parseEsiaProfile = async (
|
|
|
59
49
|
generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
|
|
60
50
|
lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
|
|
61
51
|
jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
52
|
+
esiaAccountTypeCd: profile.esiaAccountType,
|
|
53
|
+
confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
|
|
54
|
+
employment: { key: 'WORK', text: 'Работаю' },
|
|
62
55
|
files,
|
|
63
56
|
}),
|
|
64
57
|
};
|
|
@@ -74,7 +67,7 @@ const concatFullAddress = (address: Array<string | undefined>): string => {
|
|
|
74
67
|
}, '');
|
|
75
68
|
};
|
|
76
69
|
|
|
77
|
-
const buildAddress = (fields:
|
|
70
|
+
const buildAddress = (fields: EsiaRequestProfileResponse['addressRegistration']): Address => {
|
|
78
71
|
const {
|
|
79
72
|
postcode,
|
|
80
73
|
region,
|
|
@@ -110,25 +103,67 @@ const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']):
|
|
|
110
103
|
|
|
111
104
|
const getYearFromMonth = (month: number) => Math.floor(month / 12);
|
|
112
105
|
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
106
|
+
const saveDocuments = async (
|
|
107
|
+
esiaAdditionalDocument: EsiaRequestProfileResponse['esiaAdditionalDocument'],
|
|
108
|
+
): Promise<File[]> => {
|
|
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
|
+
];
|
|
152
|
+
|
|
153
|
+
for (const doc of documents) {
|
|
154
|
+
const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
|
|
155
|
+
|
|
156
|
+
await fetch(`${contentType},${doc.file}`)
|
|
157
|
+
.then((res) => res.blob())
|
|
158
|
+
.then((value) => uploadFile(value, doc.category as DocumentCategory, doc.isPDF))
|
|
159
|
+
.then((file) => files.push(file));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return files;
|
|
128
163
|
};
|
|
129
164
|
|
|
130
|
-
const
|
|
131
|
-
const { profile, document, addressRegistration
|
|
165
|
+
const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
166
|
+
const { profile, document, addressRegistration } = esiaProfile;
|
|
132
167
|
|
|
133
168
|
const data = [
|
|
134
169
|
profile.name,
|
|
@@ -136,7 +171,6 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
|
|
|
136
171
|
profile.midname,
|
|
137
172
|
profile.birthDate,
|
|
138
173
|
profile.phone,
|
|
139
|
-
profile.email,
|
|
140
174
|
document.dulIssueDate,
|
|
141
175
|
document.dulIssuedBy,
|
|
142
176
|
document.dulNumber,
|
|
@@ -144,15 +178,6 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
|
|
|
144
178
|
document.dulSubdivisionCode,
|
|
145
179
|
addressRegistration,
|
|
146
180
|
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
181
|
];
|
|
157
182
|
|
|
158
183
|
if (!data.every((_) => Boolean(_))) {
|
|
@@ -160,26 +185,26 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
|
|
|
160
185
|
}
|
|
161
186
|
};
|
|
162
187
|
|
|
163
|
-
const
|
|
164
|
-
const {
|
|
188
|
+
const checkEsiaAdditionalDocument = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
189
|
+
const { esiaAdditionalDocument } = esiaProfile;
|
|
165
190
|
|
|
166
191
|
const data = [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
192
|
+
esiaAdditionalDocument?.inn,
|
|
193
|
+
esiaAdditionalDocument?.averageMonthlyIncome?.toString(),
|
|
194
|
+
esiaAdditionalDocument?.startWorkDate,
|
|
195
|
+
esiaAdditionalDocument?.workLengthInFiveYears?.toString(),
|
|
196
|
+
esiaAdditionalDocument?.workLength?.toString(),
|
|
197
|
+
esiaAdditionalDocument?.workLengthLastJob?.toString(),
|
|
198
|
+
esiaAdditionalDocument?.jobsNumberInFiveYears?.toString(),
|
|
199
|
+
esiaAdditionalDocument?.pdfFilePayout,
|
|
200
|
+
esiaAdditionalDocument?.pdfFileWorkbook,
|
|
201
|
+
esiaAdditionalDocument?.pdfFileSigPayout,
|
|
202
|
+
esiaAdditionalDocument?.xmlFilePayout,
|
|
203
|
+
esiaAdditionalDocument?.xmlFileSigPayout,
|
|
204
|
+
esiaAdditionalDocument?.xmlFileWorkbook,
|
|
205
|
+
esiaAdditionalDocument?.pdfFileSigWorkbook,
|
|
206
|
+
esiaAdditionalDocument?.xmlFileSigWorkbook,
|
|
180
207
|
];
|
|
181
208
|
|
|
182
|
-
|
|
183
|
-
throw new Error();
|
|
184
|
-
}
|
|
209
|
+
return data.every((_) => Boolean(_));
|
|
185
210
|
};
|
|
@@ -12,7 +12,6 @@ import { updateUserProfile } from '../../retail/api/updateUserProfile';
|
|
|
12
12
|
import { updateUserTask } from '../../retail/api/updateUserTask';
|
|
13
13
|
import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
|
|
14
14
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
15
|
-
import { useEsiaLoginDialog } from '../../retail/components/EsiaLoginDialog/useEsiaLoginDialog';
|
|
16
15
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
17
16
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
18
17
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
@@ -28,7 +27,6 @@ interface ApplicationLeadApiProps extends AspectsProps {
|
|
|
28
27
|
programId: string;
|
|
29
28
|
nextStepLink: string;
|
|
30
29
|
productType: ProductType;
|
|
31
|
-
esiaError: boolean;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -36,7 +34,6 @@ export const useApplicationLeadApi = ({
|
|
|
36
34
|
programId,
|
|
37
35
|
nextStepLink,
|
|
38
36
|
productType,
|
|
39
|
-
esiaError,
|
|
40
37
|
data,
|
|
41
38
|
}: ApplicationLeadApiProps) => {
|
|
42
39
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
@@ -45,78 +42,72 @@ export const useApplicationLeadApi = ({
|
|
|
45
42
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
46
43
|
const navigator = locationNavigator();
|
|
47
44
|
|
|
48
|
-
const
|
|
49
|
-
|
|
45
|
+
const goToNextStep = useCallback(() => {
|
|
46
|
+
navigator.assign(nextStepLink);
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
50
50
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
51
51
|
const draftDialog = useDraftDialog();
|
|
52
52
|
|
|
53
|
-
const handleSubmit = useCallback(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
try {
|
|
61
|
-
startSending();
|
|
62
|
-
const transformedFormData = transformFormData(formData);
|
|
63
|
-
const profileId = await createUserProfile({
|
|
64
|
-
profile: { phone: formatPhone(transformedFormData.phone as string) },
|
|
65
|
-
});
|
|
53
|
+
const handleSubmit = useCallback(async (formData: LeadFormState) => {
|
|
54
|
+
try {
|
|
55
|
+
startSending();
|
|
56
|
+
const profileId = await createUserProfile({
|
|
57
|
+
profile: { phone: formatPhone(formData.phone as string) },
|
|
58
|
+
});
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
60
|
+
if (profileId && formData?.phone) {
|
|
61
|
+
const sendCurrentTask = async () => {
|
|
62
|
+
await updateUserData({
|
|
63
|
+
programId,
|
|
64
|
+
profileId,
|
|
65
|
+
formData,
|
|
66
|
+
productType,
|
|
67
|
+
saveUserData,
|
|
68
|
+
sendAspects,
|
|
69
|
+
});
|
|
70
|
+
verifyPhoneDialog.close();
|
|
71
|
+
if (productType === 'debitCard') {
|
|
72
|
+
goToNextStep();
|
|
73
|
+
} else {
|
|
74
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const handleSuccessVerify = async () => {
|
|
78
|
+
try {
|
|
79
|
+
const lastTaskId = await getLastTaskStatus({ profileId, programId });
|
|
80
|
+
|
|
81
|
+
if (lastTaskId) {
|
|
82
|
+
const task = await getTaskById({ taskId: lastTaskId });
|
|
83
|
+
verifyPhoneDialog.close();
|
|
84
|
+
draftDialog.open({
|
|
85
|
+
task,
|
|
86
|
+
isFromLead: true,
|
|
87
|
+
sendAspects,
|
|
88
|
+
onClose: sendCurrentTask,
|
|
89
|
+
});
|
|
80
90
|
} else {
|
|
81
|
-
|
|
91
|
+
await sendCurrentTask();
|
|
82
92
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (lastTaskId) {
|
|
89
|
-
const task = await getTaskById({ taskId: lastTaskId });
|
|
90
|
-
verifyPhoneDialog.close();
|
|
91
|
-
draftDialog.open({
|
|
92
|
-
task,
|
|
93
|
-
isFromLead: true,
|
|
94
|
-
sendAspects,
|
|
95
|
-
onClose: sendCurrentTask,
|
|
96
|
-
});
|
|
97
|
-
} else {
|
|
98
|
-
await sendCurrentTask();
|
|
99
|
-
}
|
|
100
|
-
} catch {
|
|
101
|
-
setOK(false);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
93
|
+
} catch {
|
|
94
|
+
setOK(false);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
104
97
|
|
|
105
|
-
|
|
98
|
+
const acceptedConsents = getAcceptedConsents(formData, productType);
|
|
106
99
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
} catch {
|
|
115
|
-
setOK(false);
|
|
100
|
+
verifyPhoneDialog.open({
|
|
101
|
+
phone: formData?.phone,
|
|
102
|
+
consents: acceptedConsents,
|
|
103
|
+
onSuccess: handleSuccessVerify,
|
|
104
|
+
});
|
|
105
|
+
endSending();
|
|
116
106
|
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
107
|
+
} catch {
|
|
108
|
+
setOK(false);
|
|
109
|
+
}
|
|
110
|
+
}, []);
|
|
120
111
|
|
|
121
112
|
return { isSending, ok, handleSubmit };
|
|
122
113
|
};
|
|
@@ -225,10 +216,3 @@ const transformConsentsFields = (
|
|
|
225
216
|
consentAssignmentClaimsFlg: consentOthersFlg,
|
|
226
217
|
};
|
|
227
218
|
};
|
|
228
|
-
|
|
229
|
-
const transformFormData = (formData: LeadFormState): LeadFormState => ({
|
|
230
|
-
...formData,
|
|
231
|
-
surname: formData.surname?.trim(),
|
|
232
|
-
name: formData.name?.trim(),
|
|
233
|
-
middleName: formData.middleName?.trim(),
|
|
234
|
-
});
|