@redneckz/wildless-cms-uni-blocks 0.14.824 → 0.14.825

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 (378) hide show
  1. package/bundle/bundle.umd.js +198 -229
  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 +53 -83
  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 +22 -12
  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 +53 -83
  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 +22 -12
  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/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  102. package/lib/retail/api/checkCode.d.ts +0 -1
  103. package/lib/retail/api/checkCode.js +1 -1
  104. package/lib/retail/api/checkCode.js.map +1 -1
  105. package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  106. package/lib/retail/api/updateProfileEsia.js +3 -0
  107. package/lib/retail/api/updateProfileEsia.js.map +1 -0
  108. package/lib/retail/api/updateUserTask.d.ts +0 -1
  109. package/lib/retail/api/updateUserTask.js.map +1 -1
  110. package/lib/retail/api/uploadFile.d.ts +1 -1
  111. package/lib/retail/api/uploadFile.js +3 -2
  112. package/lib/retail/api/uploadFile.js.map +1 -1
  113. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  114. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  115. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  116. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
  117. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  118. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  119. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  120. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  121. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  122. package/lib/retail/components/Fields/BeginDateField.js +1 -2
  123. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  124. package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  125. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  126. package/lib/retail/components/Fields/DaDataInnField.js +1 -2
  127. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  128. package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  129. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  130. package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  131. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  132. package/lib/retail/components/Fields/JobsNumberField.js +1 -2
  133. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  134. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  135. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  136. package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  137. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  138. package/lib/retail/components/Fields/WagesField.js +1 -2
  139. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  140. package/lib/retail/content.js +5 -11
  141. package/lib/retail/content.js.map +1 -1
  142. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  143. package/lib/retail/utils/mainFormStateMap.js +0 -1
  144. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  145. package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  146. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  147. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  148. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  149. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  150. package/mobile/bundle/bundle.umd.js +198 -229
  151. package/mobile/bundle/bundle.umd.min.js +1 -1
  152. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  153. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  154. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  155. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  156. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  157. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  158. package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
  159. package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  160. package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
  161. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  162. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  163. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  164. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  165. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  166. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  167. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  168. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  169. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  170. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  171. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  172. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  173. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  174. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  175. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  176. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  177. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  178. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  179. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  180. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  181. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  182. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  183. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  184. package/mobile/dist/retail/api/checkCode.d.ts +0 -1
  185. package/mobile/dist/retail/api/checkCode.js +2 -3
  186. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  187. package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
  188. package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
  189. package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
  190. package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
  191. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  192. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  193. package/mobile/dist/retail/api/uploadFile.js +3 -2
  194. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  195. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  196. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  197. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  198. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  199. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  200. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  201. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  202. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  203. package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
  204. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  205. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  206. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  207. package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
  208. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  209. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  210. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  211. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  212. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  213. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
  214. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  215. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  216. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  217. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  218. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  219. package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
  220. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  221. package/mobile/dist/retail/content.js +5 -11
  222. package/mobile/dist/retail/content.js.map +1 -1
  223. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  224. package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
  225. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  226. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  227. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  228. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  229. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  230. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  231. package/mobile/lib/common.css +1 -1
  232. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  233. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  234. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  235. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  236. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  237. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  238. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  239. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  240. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  241. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  242. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  243. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  244. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  245. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  246. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  247. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  248. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  249. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  250. package/mobile/lib/retail/api/checkCode.d.ts +0 -1
  251. package/mobile/lib/retail/api/checkCode.js +1 -1
  252. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  253. package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
  254. package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
  255. package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
  256. package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
  257. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  258. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  259. package/mobile/lib/retail/api/uploadFile.js +3 -2
  260. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  261. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  262. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  263. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  264. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  265. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  266. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  267. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  268. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  269. package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
  270. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  271. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  272. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  273. package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
  274. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  275. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  276. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  277. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  278. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  279. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
  280. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  281. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  282. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  283. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  284. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  285. package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
  286. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  287. package/mobile/lib/retail/content.js +5 -11
  288. package/mobile/lib/retail/content.js.map +1 -1
  289. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  290. package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
  291. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  292. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  293. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  294. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  295. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  296. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  297. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  298. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  299. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  300. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  301. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
  302. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  303. package/mobile/src/retail/api/checkCode.ts +1 -1
  304. package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  305. package/mobile/src/retail/api/updateUserTask.ts +0 -1
  306. package/mobile/src/retail/api/uploadFile.ts +3 -2
  307. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  308. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  309. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  310. package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
  311. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  312. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  313. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  314. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  315. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  316. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  317. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  318. package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
  319. package/mobile/src/retail/content.tsx +5 -11
  320. package/mobile/src/retail/model/NameFieldDef.ts +0 -1
  321. package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
  322. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  323. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  324. package/package.json +1 -1
  325. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  326. package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  327. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  328. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  329. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
  330. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  331. package/src/retail/api/checkCode.ts +1 -1
  332. package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  333. package/src/retail/api/updateUserTask.ts +0 -1
  334. package/src/retail/api/uploadFile.ts +3 -2
  335. package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  336. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
  337. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  338. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  339. package/src/retail/components/Fields/BeginDateField.tsx +0 -2
  340. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  341. package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  342. package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  343. package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  344. package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  345. package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  346. package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  347. package/src/retail/components/Fields/WagesField.tsx +0 -2
  348. package/src/retail/content.tsx +5 -11
  349. package/src/retail/model/NameFieldDef.ts +0 -1
  350. package/src/retail/utils/mainFormStateMap.ts +0 -1
  351. package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  352. package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  353. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  354. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  355. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  356. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  357. package/dist/retail/api/esiaRequestProfile.js +0 -10
  358. package/dist/retail/api/esiaRequestProfile.js.map +0 -1
  359. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  360. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  361. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  362. package/lib/retail/api/esiaRequestProfile.js +0 -7
  363. package/lib/retail/api/esiaRequestProfile.js.map +0 -1
  364. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  365. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  366. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  367. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  368. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
  369. package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
  370. package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
  371. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  372. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  373. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  374. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
  375. package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
  376. package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
  377. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
  378. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
@@ -3,6 +3,32 @@ 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
+
6
32
  export const getApplicationFormData = (productType: ProductType): SectionsRetailProps[] => {
7
33
  const currentProductConsents = productTypeToConsentsMap[productType];
8
34
  const allConsents: FieldRetailDef[] = [
@@ -20,11 +46,11 @@ export const getApplicationFormData = (productType: ProductType): SectionsRetail
20
46
  {
21
47
  columns: 2,
22
48
  inputs: [
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 },
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 },
28
54
  { name: 'email', required: true, dadata: true },
29
55
  ],
30
56
  },
@@ -21,16 +21,9 @@ const initialFormState = {
21
21
  export const getInitialFormState = (
22
22
  inputs: FieldRetailDef[],
23
23
  savedForm: LeadFormState | null,
24
- esiaAuthSuccess: boolean,
25
24
  ): LeadFormState => {
26
25
  if (savedForm) {
27
- return {
28
- ...savedForm,
29
- limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
30
- ...(!esiaAuthSuccess && {
31
- esiaAccountTypeCd: { key: '' },
32
- }),
33
- };
26
+ return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
34
27
  }
35
28
 
36
29
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
@@ -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,6 +144,15 @@ const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
178
144
  document.dulSubdivisionCode,
179
145
  addressRegistration,
180
146
  profile.esiaAccountType,
147
+ esiaAdditionalDocument.inn,
148
+ esiaAdditionalDocument.averageMonthlyIncome.toString(),
149
+ esiaAdditionalDocument.startWorkDate,
150
+ esiaAdditionalDocument.workLengthInFiveYears.toString(),
151
+ esiaAdditionalDocument.workLength.toString(),
152
+ esiaAdditionalDocument.workLengthLastJob.toString(),
153
+ esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
154
+ esiaAdditionalDocument.pdfFilePayout,
155
+ esiaAdditionalDocument.pdfFileWorkbook,
181
156
  ];
182
157
 
183
158
  if (!data.every((_) => Boolean(_))) {
@@ -185,26 +160,26 @@ const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
185
160
  }
186
161
  };
187
162
 
188
- const checkEsiaAdditionalDocument = (esiaProfile: EsiaRequestProfileResponse) => {
189
- const { esiaAdditionalDocument } = esiaProfile;
163
+ const checkEsiaDataForDebit = (esiaProfile: UpdateProfileEsiaResponse) => {
164
+ const { profile, document, addressRegistration } = esiaProfile;
190
165
 
191
166
  const data = [
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,
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,
207
180
  ];
208
181
 
209
- return data.every((_) => Boolean(_));
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,78 @@ 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 transformedFormData = transformFormData(formData);
63
+ const profileId = await createUserProfile({
64
+ profile: { phone: formatPhone(transformedFormData.phone as string) },
65
+ });
66
+
67
+ if (profileId && transformedFormData?.phone) {
68
+ const sendCurrentTask = async () => {
69
+ await updateUserData({
70
+ programId,
71
+ profileId,
72
+ formData: transformedFormData,
73
+ productType,
74
+ saveUserData,
75
+ sendAspects,
76
+ });
77
+ verifyPhoneDialog.close();
78
+ if (productType === 'debitCard') {
79
+ openEsiaLoginDialog();
90
80
  } else {
91
- await sendCurrentTask();
81
+ consentBkiDialog.open(transformedFormData.phone, profileId);
92
82
  }
93
- } catch {
94
- setOK(false);
95
- }
96
- };
83
+ };
84
+ const handleSuccessVerify = async () => {
85
+ try {
86
+ const lastTaskId = await getLastTaskStatus({ profileId, programId });
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
+ };
97
104
 
98
- const acceptedConsents = getAcceptedConsents(formData, productType);
105
+ const acceptedConsents = getAcceptedConsents(formData, productType);
99
106
 
100
- verifyPhoneDialog.open({
101
- phone: formData?.phone,
102
- consents: acceptedConsents,
103
- onSuccess: handleSuccessVerify,
104
- });
105
- endSending();
107
+ verifyPhoneDialog.open({
108
+ phone: transformedFormData?.phone,
109
+ consents: acceptedConsents,
110
+ onSuccess: handleSuccessVerify,
111
+ });
112
+ endSending();
113
+ }
114
+ } catch {
115
+ setOK(false);
106
116
  }
107
- } catch {
108
- setOK(false);
109
- }
110
- }, []);
117
+ },
118
+ [esiaError],
119
+ );
111
120
 
112
121
  return { isSending, ok, handleSubmit };
113
122
  };
@@ -216,3 +225,10 @@ const transformConsentsFields = (
216
225
  consentAssignmentClaimsFlg: consentOthersFlg,
217
226
  };
218
227
  };
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
+ });
@@ -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`, {