@redneckz/wildless-cms-uni-blocks 0.14.820 → 0.14.821

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.
Files changed (377) hide show
  1. package/bundle/bundle.umd.js +184 -222
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  4. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  5. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  6. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  7. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  8. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  9. package/bundle/retail/api/checkCode.d.ts +0 -1
  10. package/{dist/retail/api/esiaRequestProfile.d.ts → bundle/retail/api/updateProfileEsia.d.ts} +4 -11
  11. package/bundle/retail/api/updateUserTask.d.ts +0 -1
  12. package/bundle/retail/api/uploadFile.d.ts +1 -1
  13. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  14. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  15. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  16. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  17. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  19. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  20. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  21. package/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  22. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  23. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  24. package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  25. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  26. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  27. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  29. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  30. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  32. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  33. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  35. package/dist/retail/api/checkCode.d.ts +0 -1
  36. package/dist/retail/api/checkCode.js +2 -3
  37. package/dist/retail/api/checkCode.js.map +1 -1
  38. package/{bundle/retail/api/esiaRequestProfile.d.ts → dist/retail/api/updateProfileEsia.d.ts} +4 -11
  39. package/dist/retail/api/updateProfileEsia.js +6 -0
  40. package/dist/retail/api/updateProfileEsia.js.map +1 -0
  41. package/dist/retail/api/updateUserTask.d.ts +0 -1
  42. package/dist/retail/api/updateUserTask.js.map +1 -1
  43. package/dist/retail/api/uploadFile.d.ts +1 -1
  44. package/dist/retail/api/uploadFile.js +3 -2
  45. package/dist/retail/api/uploadFile.js.map +1 -1
  46. package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  47. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  48. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  49. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  50. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  51. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  52. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  53. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  54. package/dist/retail/components/Fields/BeginDateField.js +1 -2
  55. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  56. package/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  57. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  58. package/dist/retail/components/Fields/DaDataInnField.js +1 -2
  59. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  60. package/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  61. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  62. package/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  63. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  64. package/dist/retail/components/Fields/JobsNumberField.js +1 -2
  65. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  66. package/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  67. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  68. package/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  69. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  70. package/dist/retail/components/Fields/WagesField.js +1 -2
  71. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  72. package/dist/retail/content.js +5 -11
  73. package/dist/retail/content.js.map +1 -1
  74. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  75. package/dist/retail/utils/mainFormStateMap.js +0 -1
  76. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  77. package/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  78. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  79. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  80. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  81. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  82. package/lib/common.css +1 -1
  83. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  84. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  85. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  86. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  87. package/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  88. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  89. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  90. package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  91. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  92. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  93. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  94. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  95. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  96. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  97. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  98. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  99. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  100. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  101. package/lib/retail/api/checkCode.d.ts +0 -1
  102. package/lib/retail/api/checkCode.js +1 -1
  103. package/lib/retail/api/checkCode.js.map +1 -1
  104. package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  105. package/lib/retail/api/updateProfileEsia.js +3 -0
  106. package/lib/retail/api/updateProfileEsia.js.map +1 -0
  107. package/lib/retail/api/updateUserTask.d.ts +0 -1
  108. package/lib/retail/api/updateUserTask.js.map +1 -1
  109. package/lib/retail/api/uploadFile.d.ts +1 -1
  110. package/lib/retail/api/uploadFile.js +3 -2
  111. package/lib/retail/api/uploadFile.js.map +1 -1
  112. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  113. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  114. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  115. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
  116. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  117. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  118. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  119. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  120. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  121. package/lib/retail/components/Fields/BeginDateField.js +1 -2
  122. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  123. package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  124. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  125. package/lib/retail/components/Fields/DaDataInnField.js +1 -2
  126. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  127. package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  128. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  129. package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  130. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  131. package/lib/retail/components/Fields/JobsNumberField.js +1 -2
  132. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  133. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  134. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  135. package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  136. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  137. package/lib/retail/components/Fields/WagesField.js +1 -2
  138. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  139. package/lib/retail/content.js +5 -11
  140. package/lib/retail/content.js.map +1 -1
  141. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  142. package/lib/retail/utils/mainFormStateMap.js +0 -1
  143. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  144. package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  145. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  146. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  147. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  148. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  149. package/mobile/bundle/bundle.umd.js +184 -222
  150. package/mobile/bundle/bundle.umd.min.js +1 -1
  151. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  152. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  153. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  154. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  155. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  156. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  157. package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
  158. package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  159. package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
  160. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  161. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  162. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  163. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  164. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  165. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  166. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  167. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  168. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  169. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  170. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  171. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  172. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  173. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  174. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  175. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  176. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  177. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  178. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  179. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  180. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  181. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  182. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  183. package/mobile/dist/retail/api/checkCode.d.ts +0 -1
  184. package/mobile/dist/retail/api/checkCode.js +2 -3
  185. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  186. package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
  187. package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
  188. package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
  189. package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
  190. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  191. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  192. package/mobile/dist/retail/api/uploadFile.js +3 -2
  193. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  194. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  195. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  196. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  197. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  198. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  199. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  200. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  201. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  202. package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
  203. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  204. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  205. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  206. package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
  207. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  208. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  209. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  210. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  211. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  212. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
  213. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  214. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  215. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  216. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  217. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  218. package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
  219. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  220. package/mobile/dist/retail/content.js +5 -11
  221. package/mobile/dist/retail/content.js.map +1 -1
  222. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  223. package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
  224. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  225. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  226. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  227. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  228. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  229. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  230. package/mobile/lib/common.css +1 -1
  231. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  232. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  233. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  234. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  235. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  236. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  237. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  238. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  239. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  240. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  241. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +50 -80
  242. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  243. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  244. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +10 -7
  245. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  246. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  247. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  248. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  249. package/mobile/lib/retail/api/checkCode.d.ts +0 -1
  250. package/mobile/lib/retail/api/checkCode.js +1 -1
  251. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  252. package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
  253. package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
  254. package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
  255. package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
  256. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  257. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  258. package/mobile/lib/retail/api/uploadFile.js +3 -2
  259. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  260. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  261. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  262. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  263. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  264. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  265. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  266. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  267. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  268. package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
  269. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  270. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  271. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  272. package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
  273. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  274. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  275. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  276. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  277. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  278. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
  279. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  280. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  281. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  282. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  283. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  284. package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
  285. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  286. package/mobile/lib/retail/content.js +5 -11
  287. package/mobile/lib/retail/content.js.map +1 -1
  288. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  289. package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
  290. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  291. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  292. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  293. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  294. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  295. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  296. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  297. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  298. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  299. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  300. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  301. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  302. package/mobile/src/retail/api/checkCode.ts +1 -1
  303. package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  304. package/mobile/src/retail/api/updateUserTask.ts +0 -1
  305. package/mobile/src/retail/api/uploadFile.ts +3 -2
  306. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  307. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  308. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  309. package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
  310. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  311. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  312. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  313. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  314. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  315. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  316. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  317. package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
  318. package/mobile/src/retail/content.tsx +5 -11
  319. package/mobile/src/retail/model/NameFieldDef.ts +0 -1
  320. package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
  321. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  322. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  323. package/package.json +1 -1
  324. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  325. package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  326. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  327. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  328. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +65 -57
  329. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  330. package/src/retail/api/checkCode.ts +1 -1
  331. package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  332. package/src/retail/api/updateUserTask.ts +0 -1
  333. package/src/retail/api/uploadFile.ts +3 -2
  334. package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  335. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
  336. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  337. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  338. package/src/retail/components/Fields/BeginDateField.tsx +0 -2
  339. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  340. package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  341. package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  342. package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  343. package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  344. package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  345. package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  346. package/src/retail/components/Fields/WagesField.tsx +0 -2
  347. package/src/retail/content.tsx +5 -11
  348. package/src/retail/model/NameFieldDef.ts +0 -1
  349. package/src/retail/utils/mainFormStateMap.ts +0 -1
  350. package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  351. package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  352. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  353. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  354. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  355. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  356. package/dist/retail/api/esiaRequestProfile.js +0 -10
  357. package/dist/retail/api/esiaRequestProfile.js.map +0 -1
  358. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  359. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  360. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  361. package/lib/retail/api/esiaRequestProfile.js +0 -7
  362. package/lib/retail/api/esiaRequestProfile.js.map +0 -1
  363. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  364. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  365. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  366. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  367. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
  368. package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
  369. package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
  370. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  371. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  372. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  373. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
  374. package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
  375. package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
  376. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
  377. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
@@ -1,23 +1,33 @@
1
1
  /* eslint-disable max-lines */
2
- /* eslint-disable max-lines-per-function */
3
- import { type EsiaRequestProfileResponse } from '../../retail/api/esiaRequestProfile';
2
+ import { type UpdateProfileEsiaResponse } from '../../retail/api/updateProfileEsia';
4
3
  import { uploadFile, type DocumentCategory } from '../../retail/api/uploadFile';
5
4
  import { type Address, type File, type LeadFormState } from '../../retail/model/LeadFormState';
6
5
  import { normalizePhone } from '../../ui-kit/PhoneInput/normalizePhone';
7
6
 
8
7
  export const parseEsiaProfile = async (
9
- esiaProfile: EsiaRequestProfileResponse,
8
+ esiaProfile: UpdateProfileEsiaResponse,
9
+ taskId: string,
10
10
  isDebit: boolean,
11
11
  ): Promise<LeadFormState> => {
12
- checkEsiaData(esiaProfile);
13
- const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
12
+ isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
14
13
 
15
14
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } =
16
15
  esiaProfile;
17
- let files: File[] = [];
16
+ const files: File[] = [];
18
17
 
19
- if (isFullEsiaData) {
20
- files = await saveDocuments(esiaAdditionalDocument);
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
+ });
21
31
  }
22
32
 
23
33
  const mainData = {
@@ -35,12 +45,12 @@ export const parseEsiaProfile = async (
35
45
  birthPlace: addInfo.birthPlace,
36
46
  addressRegistration: buildAddress(addressRegistration),
37
47
  addressFact: buildAddress(addressFact),
38
- esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
48
+ esiaAccountTypeCd: profile.esiaAccountType,
39
49
  };
40
50
 
41
51
  return {
42
52
  ...mainData,
43
- ...(isFullEsiaData && {
53
+ ...(!isDebit && {
44
54
  snils: addInfo.snils,
45
55
  inn: esiaAdditionalDocument.inn,
46
56
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -49,9 +59,6 @@ export const parseEsiaProfile = async (
49
59
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
50
60
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
51
61
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
52
- esiaAccountTypeCd: profile.esiaAccountType,
53
- confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
54
- employment: { key: 'WORK', text: 'Работаю' },
55
62
  files,
56
63
  }),
57
64
  };
@@ -67,7 +74,7 @@ const concatFullAddress = (address: Array<string | undefined>): string => {
67
74
  }, '');
68
75
  };
69
76
 
70
- const buildAddress = (fields: EsiaRequestProfileResponse['addressRegistration']): Address => {
77
+ const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']): Address => {
71
78
  const {
72
79
  postcode,
73
80
  region,
@@ -103,67 +110,25 @@ const buildAddress = (fields: EsiaRequestProfileResponse['addressRegistration'])
103
110
 
104
111
  const getYearFromMonth = (month: number) => Math.floor(month / 12);
105
112
 
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;
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));
163
128
  };
164
129
 
165
- const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
166
- const { profile, document, addressRegistration } = esiaProfile;
130
+ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
131
+ const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
167
132
 
168
133
  const data = [
169
134
  profile.name,
@@ -171,6 +136,7 @@ const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
171
136
  profile.midname,
172
137
  profile.birthDate,
173
138
  profile.phone,
139
+ profile.email,
174
140
  document.dulIssueDate,
175
141
  document.dulIssuedBy,
176
142
  document.dulNumber,
@@ -178,17 +144,6 @@ const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
178
144
  document.dulSubdivisionCode,
179
145
  addressRegistration,
180
146
  profile.esiaAccountType,
181
- ];
182
-
183
- if (!data.every((_) => Boolean(_))) {
184
- throw new Error();
185
- }
186
- };
187
-
188
- const checkEsiaAdditionalDocument = (esiaProfile: EsiaRequestProfileResponse) => {
189
- const { esiaAdditionalDocument } = esiaProfile;
190
-
191
- const data = [
192
147
  esiaAdditionalDocument.inn,
193
148
  esiaAdditionalDocument.averageMonthlyIncome.toString(),
194
149
  esiaAdditionalDocument.startWorkDate,
@@ -198,13 +153,33 @@ const checkEsiaAdditionalDocument = (esiaProfile: EsiaRequestProfileResponse) =>
198
153
  esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
199
154
  esiaAdditionalDocument.pdfFilePayout,
200
155
  esiaAdditionalDocument.pdfFileWorkbook,
201
- esiaAdditionalDocument.pdfFileSigPayout,
202
- esiaAdditionalDocument.xmlFilePayout,
203
- esiaAdditionalDocument.xmlFileSigPayout,
204
- esiaAdditionalDocument.xmlFileWorkbook,
205
- esiaAdditionalDocument.pdfFileSigWorkbook,
206
- esiaAdditionalDocument.xmlFileSigWorkbook,
207
156
  ];
208
157
 
209
- return data.every((_) => Boolean(_));
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
+ }
210
185
  };
@@ -12,6 +12,7 @@ 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';
15
16
  import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
16
17
  import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
17
18
  import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
@@ -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,6 +36,7 @@ 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);
@@ -42,72 +45,77 @@ export const useApplicationLeadApi = ({
42
45
  const sendAspects = useSendLeadFormAspects({ data });
43
46
  const navigator = locationNavigator();
44
47
 
45
- const goToNextStep = useCallback(() => {
46
- navigator.assign(nextStepLink);
47
- }, []);
48
-
49
- const consentBkiDialog = useConsentBkiDialog(goToNextStep);
48
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
49
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
50
50
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
51
51
  const draftDialog = useDraftDialog();
52
52
 
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
- });
53
+ const handleSubmit = useCallback(
54
+ async (formData: LeadFormState) => {
55
+ if (esiaError) {
56
+ navigator.assign(nextStepLink);
59
57
 
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
- });
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();
90
79
  } else {
91
- await sendCurrentTask();
80
+ consentBkiDialog.open(formData.phone, profileId);
81
+ }
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);
92
101
  }
93
- } catch {
94
- setOK(false);
95
- }
96
- };
102
+ };
97
103
 
98
- const acceptedConsents = getAcceptedConsents(formData, productType);
104
+ const acceptedConsents = getAcceptedConsents(formData, productType);
99
105
 
100
- verifyPhoneDialog.open({
101
- phone: formData?.phone,
102
- consents: acceptedConsents,
103
- onSuccess: handleSuccessVerify,
104
- });
105
- endSending();
106
+ verifyPhoneDialog.open({
107
+ phone: formData?.phone,
108
+ consents: acceptedConsents,
109
+ onSuccess: handleSuccessVerify,
110
+ });
111
+ endSending();
112
+ }
113
+ } catch {
114
+ setOK(false);
106
115
  }
107
- } catch {
108
- setOK(false);
109
- }
110
- }, []);
116
+ },
117
+ [esiaError],
118
+ );
111
119
 
112
120
  return { isSending, ok, handleSubmit };
113
121
  };
@@ -1,9 +1,11 @@
1
1
  import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
3
+ import { locationNavigator } from '../../external/locationNavigator';
2
4
  import { useSetter } from '../../hooks/useSetter';
3
- import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
5
+ import { updateProfileEsia } from '../../retail/api/updateProfileEsia';
4
6
  import { type LeadFormState } from '../../retail/model/LeadFormState';
5
7
  import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
6
- import { EsiaStatuses } from './ApplicationLeadForm';
8
+ import { safeJsonParse } from '../../utils/safeJsonParse';
7
9
  import { type ProductType } from './ApplicationLeadFormContent';
8
10
  import { getInitialFormState } from './getInitialFormState';
9
11
  import { parseEsiaProfile } from './parseEsiaProfile';
@@ -13,62 +15,76 @@ type InitApplicationLeadProps = {
13
15
  inputs: FieldRetailDef[];
14
16
  nextStepLink: string;
15
17
  productType: ProductType;
16
- setEsiaStatus: (status: EsiaStatuses) => void;
17
- esiaAuthSuccess: boolean;
18
+ setEsiaError: () => void;
18
19
  };
19
20
 
20
21
  export const useInitApplicationLead = ({
21
22
  inputs,
23
+ nextStepLink,
22
24
  productType,
23
- setEsiaStatus,
24
- esiaAuthSuccess,
25
- }: InitApplicationLeadProps): LeadFormState => {
25
+ setEsiaError,
26
+ }: InitApplicationLeadProps): [LeadFormState, { isLoading: boolean }] => {
27
+ const navigator = locationNavigator();
28
+ const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
29
+
26
30
  const leadFormStore = useLeadFormStore();
27
31
  const saveForm = useSetter(leadFormStore, 'leadForm');
28
32
 
29
33
  const initialFormState = useMemo(
30
- () => getInitialFormState(inputs, leadFormStore.leadForm, esiaAuthSuccess),
34
+ () => getInitialFormState(inputs, leadFormStore.leadForm),
31
35
  [inputs, leadFormStore.leadForm],
32
36
  );
33
37
 
34
- const requestEsiaProfile = useCallback(async (code: string, state: string) => {
35
- setEsiaStatus(EsiaStatuses.Pending);
36
- try {
37
- const data = await esiaRequestProfile({
38
- code,
39
- state,
40
- redirectUri: globalThis.location?.href,
41
- authorize: true,
42
- });
38
+ const updateEsiaProfile = useCallback(
39
+ async (profileId: string, code: string, state: string) => {
40
+ startLoading();
41
+ try {
42
+ const data = await updateProfileEsia({
43
+ profileId,
44
+ code,
45
+ state,
46
+ redirectUri: globalThis.location?.href,
47
+ });
48
+
49
+ if (data && leadFormStore?.taskId) {
50
+ const parsedData = await parseEsiaProfile(
51
+ data,
52
+ leadFormStore.taskId.toString(),
53
+ productType === 'debitCard',
54
+ );
43
55
 
44
- if (data) {
45
- const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
56
+ saveForm((_) => ({
57
+ ..._,
58
+ ...parsedData,
59
+ }));
60
+ }
46
61
 
47
- saveForm((_) => ({
48
- ..._,
49
- ...parsedData,
50
- }));
51
- setEsiaStatus(EsiaStatuses.Success);
62
+ navigator.assign(nextStepLink);
63
+ } catch {
64
+ setEsiaError();
65
+ } finally {
66
+ endLoading();
52
67
  }
53
- } catch {
54
- setEsiaStatus(EsiaStatuses.Error);
55
- }
56
- }, []);
68
+ },
69
+ [nextStepLink],
70
+ );
57
71
 
58
72
  useEffect(() => {
59
73
  leadFormStore.productType = productType;
60
-
74
+ const profileId: string = <string>(
75
+ safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? '')
76
+ );
61
77
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
62
78
  const code = params.get('code');
63
79
  const state = params.get('state');
64
80
 
65
- if (code && state) {
66
- requestEsiaProfile(code, state);
81
+ if (profileId && code && state) {
82
+ updateEsiaProfile(profileId, code, state);
67
83
  } else {
68
84
  sessionStorage.removeItem('accessToken');
69
85
  sessionStorage.removeItem('refreshToken');
70
86
  }
71
87
  }, []);
72
88
 
73
- return initialFormState;
89
+ return [initialFormState, { isLoading }];
74
90
  };
@@ -16,7 +16,7 @@ export type CheckCodeResponse = {
16
16
  export const checkCode = async (body: CheckCodeBody) =>
17
17
  fetchRetailJSON<CheckCodeResponse>('/sms/checkCode', 'POST', body).then(saveToken);
18
18
 
19
- export const saveToken = (data: CheckCodeResponse | null) => {
19
+ const saveToken = (data: CheckCodeResponse | null) => {
20
20
  if (data) {
21
21
  globalThis.sessionStorage.setItem('accessToken', data.access_token);
22
22
  globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
@@ -1,14 +1,13 @@
1
- import { saveToken, type CheckCodeResponse } from './checkCode';
2
1
  import { fetchRetailJSON } from './doRequest';
3
2
 
4
- export type EsiaRequestProfileBody = {
3
+ export type UpdateProfileEsiaBody = {
5
4
  code: string;
6
- authorize: boolean;
5
+ profileId: string;
7
6
  state: string;
8
7
  redirectUri: string;
9
8
  };
10
9
 
11
- export type EsiaRequestProfileResponse = CheckCodeResponse & {
10
+ export type UpdateProfileEsiaResponse = {
12
11
  profile: {
13
12
  id: number;
14
13
  esiaId: string;
@@ -76,18 +75,8 @@ export type EsiaRequestProfileResponse = CheckCodeResponse & {
76
75
  workLengthLastJob: number;
77
76
  pdfFileWorkbook: string;
78
77
  pdfFilePayout: string;
79
- pdfFileSigPayout: string;
80
- pdfFileSigWorkbook: string;
81
- xmlFilePayout: string;
82
- xmlFileSigPayout: string;
83
- xmlFileSigWorkbook: string;
84
- xmlFileWorkbook: string;
85
78
  };
86
79
  };
87
80
 
88
- export const esiaRequestProfile = (body: EsiaRequestProfileBody) =>
89
- fetchRetailJSON<EsiaRequestProfileResponse>('/esia/requestProfile', 'POST', body).then((res) => {
90
- saveToken(res);
91
-
92
- return res;
93
- });
81
+ export const updateProfileEsia = (body: UpdateProfileEsiaBody) =>
82
+ fetchRetailJSON<UpdateProfileEsiaResponse>('/esia/updateProfileEsia', 'POST', body);
@@ -52,7 +52,6 @@ export type Participant = {
52
52
  surname?: string;
53
53
  profile?: {
54
54
  id: number;
55
- esiaAccountTypeCd?: Option;
56
55
  };
57
56
  armyIdFlg?: boolean;
58
57
  birthPlace?: string;
@@ -5,12 +5,13 @@ export type DocumentCategory = 'CONFIRMING_EMPLOYMENT_DOC' | 'CONFIRMING_INCOME_
5
5
 
6
6
  export const uploadFile = async (
7
7
  file: Blob,
8
+ taskId: string,
8
9
  documentCategory: DocumentCategory,
9
- isPDF = false,
10
10
  ): Promise<File> => {
11
11
  const fd = new FormData();
12
+ fd.append('taskId', taskId);
12
13
  fd.append('documentCategory', documentCategory);
13
- fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
14
+ fd.append('file', file, 'file.pdf');
14
15
 
15
16
  const res = await globalThis
16
17
  ?.fetch?.(`/light-api-cash/v1/file`, {
@@ -68,7 +68,6 @@ export const parseDraftTask = (task: Task): LeadFormState => {
68
68
  payrollCardRshbFlg: isInsurance,
69
69
  consentInsuranceFlg: isSalaryClient,
70
70
  incomeCertificateCd,
71
- profile,
72
71
  } = participant;
73
72
 
74
73
  return {
@@ -122,7 +121,6 @@ export const parseDraftTask = (task: Task): LeadFormState => {
122
121
  monthsValue,
123
122
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
124
123
  },
125
- esiaAccountTypeCd: profile?.esiaAccountTypeCd,
126
124
  ...getParticipantIncomes(participantIncomes),
127
125
  ...getParticipantAddresses(participantAddresses),
128
126
  ...getParticipantContacts(participantContacts),
@@ -0,0 +1,7 @@
1
+ import '../../../setup-fixture';
2
+
3
+ import { EsiaLoginDialog } from './EsiaLoginDialog';
4
+
5
+ export default {
6
+ default: <EsiaLoginDialog />,
7
+ };
@@ -0,0 +1,65 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { locationNavigator } from '../../../external/locationNavigator';
4
+ import { Button } from '../../../ui-kit/Button/Button';
5
+ import { Dialog } from '../../../ui-kit/DialogManager/Dialog';
6
+ import { Img } from '../../../ui-kit/Img/Img';
7
+ import { getLink } from '../../api/getLink';
8
+ import { useRetailFormStore } from '../../hooks/useRetailFormStore';
9
+
10
+ export interface EsiaLoginDialogProps {
11
+ onClose?: () => void;
12
+ }
13
+
14
+ export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
15
+ const navigator = locationNavigator();
16
+ const retailFormStore = useRetailFormStore();
17
+
18
+ const handleAuth = useCallback(async () => {
19
+ const resp = await getLink({
20
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
21
+ });
22
+
23
+ if (resp?.link) {
24
+ navigator.assign(resp.link);
25
+ globalThis.location.href = resp.link;
26
+ }
27
+ }, []);
28
+
29
+ const handleClose = useCallback(() => {
30
+ if (retailFormStore.leadForm) {
31
+ const leadForm = { ...retailFormStore.leadForm };
32
+ delete leadForm.esiaAccountTypeCd;
33
+ retailFormStore.leadForm = leadForm;
34
+ }
35
+ onClose?.();
36
+ }, []);
37
+
38
+ return (
39
+ <Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg" onClose={handleClose}>
40
+ <div className="flex flex-col gap-lg items-center rounded-md">
41
+ <div className="flex items-center justify-around w-full px-m">
42
+ <ul className="list-disc">
43
+ <li>Вероятность одобрения выше</li>
44
+ <li>Без справок о доходах и трудоустройстве</li>
45
+ <li>С защитой Ваших данных</li>
46
+ </ul>
47
+ <Img image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }} height="70" />
48
+ </div>
49
+ <div className="@container flex flex-wrap gap-lg w-full">
50
+ <Button type="button" onClick={handleAuth} className="w-full md:w-auto">
51
+ Заполнить через Госуслуги
52
+ </Button>
53
+ <Button
54
+ type="button"
55
+ version="secondary"
56
+ onClick={handleClose}
57
+ className="w-full md:w-auto"
58
+ >
59
+ Пропустить
60
+ </Button>
61
+ </div>
62
+ </div>
63
+ </Dialog>
64
+ );
65
+ });