@redneckz/wildless-cms-uni-blocks 0.14.812 → 0.14.814

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 (301) hide show
  1. package/bundle/bundle.umd.js +173 -132
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  4. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  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 -2
  8. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  9. package/bundle/retail/api/checkCode.d.ts +1 -0
  10. package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
  11. package/bundle/retail/api/updateUserTask.d.ts +1 -0
  12. package/bundle/retail/api/uploadFile.d.ts +1 -1
  13. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  14. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  15. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  16. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  17. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  18. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
  19. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  20. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  21. package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  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 +8 -2
  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 +54 -19
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  29. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  30. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  32. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  33. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  35. package/dist/components/CreditForm/SuccessStatusContent.js +1 -1
  36. package/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
  37. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  38. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  39. package/dist/retail/api/checkCode.d.ts +1 -0
  40. package/dist/retail/api/checkCode.js +3 -2
  41. package/dist/retail/api/checkCode.js.map +1 -1
  42. package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
  43. package/dist/retail/api/esiaRequestProfile.js +10 -0
  44. package/dist/retail/api/esiaRequestProfile.js.map +1 -0
  45. package/dist/retail/api/updateUserTask.d.ts +1 -0
  46. package/dist/retail/api/updateUserTask.js.map +1 -1
  47. package/dist/retail/api/uploadFile.d.ts +1 -1
  48. package/dist/retail/api/uploadFile.js +2 -3
  49. package/dist/retail/api/uploadFile.js.map +1 -1
  50. package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  51. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  52. package/dist/retail/content.js +10 -1
  53. package/dist/retail/content.js.map +1 -1
  54. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  55. package/dist/retail/utils/mainFormStateMap.js +1 -0
  56. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  57. package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  58. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  59. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  60. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  61. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  62. package/lib/common.css +1 -1
  63. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  64. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  65. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  66. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
  67. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  68. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  69. package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  70. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  71. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  72. package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  73. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  74. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  75. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  76. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  77. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  78. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  79. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  80. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  81. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  82. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  83. package/lib/components/CreditForm/SuccessStatusContent.js +1 -1
  84. package/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
  85. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  86. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  87. package/lib/retail/api/checkCode.d.ts +1 -0
  88. package/lib/retail/api/checkCode.js +1 -1
  89. package/lib/retail/api/checkCode.js.map +1 -1
  90. package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
  91. package/lib/retail/api/esiaRequestProfile.js +7 -0
  92. package/lib/retail/api/esiaRequestProfile.js.map +1 -0
  93. package/lib/retail/api/updateUserTask.d.ts +1 -0
  94. package/lib/retail/api/updateUserTask.js.map +1 -1
  95. package/lib/retail/api/uploadFile.d.ts +1 -1
  96. package/lib/retail/api/uploadFile.js +2 -3
  97. package/lib/retail/api/uploadFile.js.map +1 -1
  98. package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  99. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  100. package/lib/retail/content.js +10 -1
  101. package/lib/retail/content.js.map +1 -1
  102. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  103. package/lib/retail/utils/mainFormStateMap.js +1 -0
  104. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  105. package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  106. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  107. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  108. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  109. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  110. package/mobile/bundle/bundle.umd.js +173 -132
  111. package/mobile/bundle/bundle.umd.min.js +1 -1
  112. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  113. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  114. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  115. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  116. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  117. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  118. package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
  119. package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
  120. package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
  121. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  122. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  123. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  124. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  125. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  126. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  127. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
  128. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  129. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  130. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  131. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  132. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  133. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  134. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  135. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  136. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  137. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  138. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  139. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  140. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  141. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  142. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  143. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  144. package/mobile/dist/components/CreditForm/SuccessStatusContent.js +1 -1
  145. package/mobile/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
  146. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  147. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  148. package/mobile/dist/retail/api/checkCode.d.ts +1 -0
  149. package/mobile/dist/retail/api/checkCode.js +3 -2
  150. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  151. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
  152. package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
  153. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
  154. package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
  155. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  156. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  157. package/mobile/dist/retail/api/uploadFile.js +2 -3
  158. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  159. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  160. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  161. package/mobile/dist/retail/content.js +10 -1
  162. package/mobile/dist/retail/content.js.map +1 -1
  163. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  164. package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
  165. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  166. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  167. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  168. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  169. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  170. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  171. package/mobile/lib/common.css +1 -1
  172. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
  173. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  174. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  175. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
  176. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  177. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  178. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  179. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  180. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  181. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  182. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  183. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  184. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
  185. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  186. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
  187. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
  188. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  189. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
  190. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
  191. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  192. package/mobile/lib/components/CreditForm/SuccessStatusContent.js +1 -1
  193. package/mobile/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
  194. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  195. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  196. package/mobile/lib/retail/api/checkCode.d.ts +1 -0
  197. package/mobile/lib/retail/api/checkCode.js +1 -1
  198. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  199. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
  200. package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
  201. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
  202. package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
  203. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  204. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  205. package/mobile/lib/retail/api/uploadFile.js +2 -3
  206. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  207. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  208. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  209. package/mobile/lib/retail/content.js +10 -1
  210. package/mobile/lib/retail/content.js.map +1 -1
  211. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  212. package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
  213. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  214. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  215. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  216. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  217. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  218. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  219. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
  220. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
  221. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  222. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  223. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
  224. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
  225. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
  226. package/mobile/src/components/CreditForm/SuccessStatusContent.tsx +3 -1
  227. package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
  228. package/mobile/src/retail/api/checkCode.ts +1 -1
  229. package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  230. package/mobile/src/retail/api/updateUserTask.ts +1 -0
  231. package/mobile/src/retail/api/uploadFile.ts +2 -3
  232. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  233. package/mobile/src/retail/content.tsx +10 -1
  234. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  235. package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
  236. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  237. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  238. package/package.json +1 -1
  239. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
  240. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
  241. package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  242. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  243. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
  244. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
  245. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
  246. package/src/components/CreditForm/SuccessStatusContent.tsx +3 -1
  247. package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
  248. package/src/retail/api/checkCode.ts +1 -1
  249. package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  250. package/src/retail/api/updateUserTask.ts +1 -0
  251. package/src/retail/api/uploadFile.ts +2 -3
  252. package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  253. package/src/retail/content.tsx +10 -1
  254. package/src/retail/model/NameFieldDef.ts +1 -0
  255. package/src/retail/utils/mainFormStateMap.ts +1 -0
  256. package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  257. package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  258. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  259. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  260. package/dist/retail/api/updateProfileEsia.js +0 -6
  261. package/dist/retail/api/updateProfileEsia.js.map +0 -1
  262. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  263. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  264. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  265. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  266. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  267. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  268. package/lib/retail/api/updateProfileEsia.js +0 -3
  269. package/lib/retail/api/updateProfileEsia.js.map +0 -1
  270. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  271. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
  272. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  273. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  274. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  275. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  276. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  277. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  278. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  279. package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
  280. package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
  281. package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
  282. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  283. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  284. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  285. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  286. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  287. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  288. package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
  289. package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
  290. package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
  291. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  292. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  293. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  294. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  295. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  296. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  297. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  298. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
  299. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
  300. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  301. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
@@ -1,13 +1,14 @@
1
+ import { saveToken, type CheckCodeResponse } from './checkCode';
1
2
  import { fetchRetailJSON } from './doRequest';
2
3
 
3
- export type UpdateProfileEsiaBody = {
4
+ export type EsiaRequestProfileBody = {
4
5
  code: string;
5
- profileId: string;
6
+ authorize: boolean;
6
7
  state: string;
7
8
  redirectUri: string;
8
9
  };
9
10
 
10
- export type UpdateProfileEsiaResponse = {
11
+ export type EsiaRequestProfileResponse = CheckCodeResponse & {
11
12
  profile: {
12
13
  id: number;
13
14
  esiaId: string;
@@ -75,8 +76,18 @@ export type UpdateProfileEsiaResponse = {
75
76
  workLengthLastJob: number;
76
77
  pdfFileWorkbook: string;
77
78
  pdfFilePayout: string;
79
+ pdfFileSigPayout: string;
80
+ pdfFileSigWorkbook: string;
81
+ xmlFilePayout: string;
82
+ xmlFileSigPayout: string;
83
+ xmlFileSigWorkbook: string;
84
+ xmlFileWorkbook: string;
78
85
  };
79
86
  };
80
87
 
81
- export const updateProfileEsia = (body: UpdateProfileEsiaBody) =>
82
- fetchRetailJSON<UpdateProfileEsiaResponse>('/esia/updateProfileEsia', 'POST', body);
88
+ export const esiaRequestProfile = (body: EsiaRequestProfileBody) =>
89
+ fetchRetailJSON<EsiaRequestProfileResponse>('/esia/requestProfile', 'POST', body).then((res) => {
90
+ saveToken(res);
91
+
92
+ return res;
93
+ });
@@ -52,6 +52,7 @@ export type Participant = {
52
52
  surname?: string;
53
53
  profile?: {
54
54
  id: number;
55
+ esiaAccountTypeCd?: Option;
55
56
  };
56
57
  armyIdFlg?: boolean;
57
58
  birthPlace?: string;
@@ -5,13 +5,12 @@ export type DocumentCategory = 'CONFIRMING_EMPLOYMENT_DOC' | 'CONFIRMING_INCOME_
5
5
 
6
6
  export const uploadFile = async (
7
7
  file: Blob,
8
- taskId: string,
9
8
  documentCategory: DocumentCategory,
9
+ isPDF = false,
10
10
  ): Promise<File> => {
11
11
  const fd = new FormData();
12
- fd.append('taskId', taskId);
13
12
  fd.append('documentCategory', documentCategory);
14
- fd.append('file', file, 'file.pdf');
13
+ fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
15
14
 
16
15
  const res = await globalThis
17
16
  ?.fetch?.(`/light-api-cash/v1/file`, {
@@ -68,6 +68,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
68
68
  payrollCardRshbFlg: isInsurance,
69
69
  consentInsuranceFlg: isSalaryClient,
70
70
  incomeCertificateCd,
71
+ profile,
71
72
  } = participant;
72
73
 
73
74
  return {
@@ -121,6 +122,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
121
122
  monthsValue,
122
123
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
123
124
  },
125
+ esiaAccountTypeCd: profile?.esiaAccountTypeCd,
124
126
  ...getParticipantIncomes(participantIncomes),
125
127
  ...getParticipantAddresses(participantAddresses),
126
128
  ...getParticipantContacts(participantContacts),
@@ -190,7 +190,16 @@ const FAMILY_STATUS_AND_INCOME_CONTENT: CreditCardSectionsProps[] = [
190
190
  },
191
191
  {
192
192
  columns: 1,
193
- inputs: [{ name: 'confirmationIncome', required: true }],
193
+ inputs: [
194
+ {
195
+ name: 'confirmationIncome',
196
+ required: true,
197
+ condition: {
198
+ name: 'esiaAccountTypeCd',
199
+ values: [''],
200
+ },
201
+ },
202
+ ],
194
203
  },
195
204
  {
196
205
  columns: 1,
@@ -86,6 +86,7 @@ type NameFieldRetailDef =
86
86
  | 'calculator'
87
87
  | 'infoCard'
88
88
  | 'deliveryTime'
89
+ | 'esiaAccountTypeCd'
89
90
  | 'comment';
90
91
 
91
92
  export type NameFieldDef =
@@ -56,6 +56,7 @@ export const mainFormStateMap: Partial<LeadFormState>[] = [
56
56
  mandatoryPayments: undefined,
57
57
  snils: '',
58
58
  armyIdFlg: false,
59
+ esiaAccountTypeCd: { key: '', text: '' },
59
60
  },
60
61
  {
61
62
  bankruptcyFlg: false,
@@ -1,9 +1,17 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { isEsiaAuthorize } from '../../../retail/utils/isEsiaAuthorize';
2
3
  import { InputPhoneControl } from '../../Input/InputPhoneControl';
3
4
  import { type CustomFieldProps } from '../CustomFieldProps';
4
5
 
5
6
  export const PhoneField = JSX<CustomFieldProps>(({ field, input }) => {
6
7
  const fieldName = input?.name || 'phone';
7
8
 
8
- return <InputPhoneControl label="Телефон" {...field(fieldName)} {...input} />;
9
+ return (
10
+ <InputPhoneControl
11
+ label="Телефон"
12
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input.name ?? '')}
13
+ {...field(fieldName)}
14
+ {...input}
15
+ />
16
+ );
9
17
  });
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
1
2
  import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
2
3
  import { type BaseFieldDef } from './BaseFieldDef';
3
4
 
@@ -11,5 +12,5 @@ export function shouldRenderField<F extends BaseFieldDef>({
11
12
  const { condition } = input;
12
13
  const { value } = field(condition?.name || '');
13
14
 
14
- return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
15
+ return !condition || condition?.values?.includes(value?.key ?? value);
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.812",
3
+ "version": "0.14.814",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-lines-per-function */
1
2
  import { JSX } from '@redneckz/uni-jsx';
2
3
  import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
4
  import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
@@ -16,6 +17,7 @@ import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
16
17
  import { style } from '../../utils/style';
17
18
  import { getApplicationFormData } from './applicationFormData';
18
19
  import { type ApplicationLeadFormContent } from './ApplicationLeadFormContent';
20
+ import { EsiaLoginBanner } from './EsiaLoginBanner';
19
21
  import { renderInputs } from './renderInputs';
20
22
  import { renderSubmitButton } from './renderSubmitButton';
21
23
  import { useApplicationLeadApi } from './useApplicationLeadApi';
@@ -35,6 +37,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
35
37
  ...rest
36
38
  }) => {
37
39
  const [esiaError, { setTrue: setEsiaError }] = useBool(false);
40
+ const [esiaAuthSuccess, { setTrue: setEsiaAuthSuccess }] = useBool(false);
38
41
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
39
42
  const inputs = useMemo(
40
43
  () => (applicationFormData?.flatMap((_) => _?.inputs) || []) as FieldRetailDef[],
@@ -48,16 +51,18 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
48
51
  nextStepLink,
49
52
  productType,
50
53
  setEsiaError,
54
+ setEsiaAuthSuccess,
55
+ esiaAuthSuccess,
51
56
  });
52
57
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
53
58
  programId,
54
59
  nextStepLink,
55
60
  productType,
56
- esiaError,
61
+ esiaAuthSuccess,
57
62
  data,
58
63
  });
59
64
 
60
- const [, { field, onSubmit }] = useForm(initialFormState, {
65
+ const [, { field, onSubmit, reset }] = useForm(initialFormState, {
61
66
  formValidator,
62
67
  onSubmit: handleSubmit,
63
68
  });
@@ -69,12 +74,19 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
69
74
  }
70
75
  }, [ok]);
71
76
 
77
+ useEffect(() => {
78
+ if (initialFormState?.esiaAccountTypeCd) {
79
+ reset();
80
+ }
81
+ }, [initialFormState]);
82
+
72
83
  return (
73
84
  <ApplicationFormLayout
74
85
  className={style('container space-y-m', className)}
75
86
  title={title}
76
87
  {...rest}
77
88
  >
89
+ {!esiaAuthSuccess && !esiaError ? <EsiaLoginBanner /> : null}
78
90
  <form onSubmit={onSubmit} className="space-y-m relative">
79
91
  {isLoading ? <Loader blur={false} /> : null}
80
92
  {applicationFormData.map((_, i) => (
@@ -0,0 +1,52 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { locationNavigator } from '../../external/locationNavigator';
4
+ import { getLink } from '../../retail/api/getLink';
5
+ import { Button } from '../../ui-kit/Button/Button';
6
+ import { Img } from '../../ui-kit/Img/Img';
7
+
8
+ export interface EsiaLoginBannerProps {
9
+ onClose?: () => void;
10
+ }
11
+
12
+ export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(() => {
13
+ const navigator = locationNavigator();
14
+
15
+ const handleAuth = useCallback(async () => {
16
+ const resp = await getLink({
17
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
18
+ });
19
+
20
+ if (resp?.link) {
21
+ navigator.assign(resp.link);
22
+ globalThis.location.href = resp.link;
23
+ }
24
+ }, []);
25
+
26
+ return (
27
+ <div className="flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9">
28
+ <div className="flex flex-col justify-around w-full">
29
+ <p className="mb-4 text-xl @md:text-2xl @md:mb-6">Заполните данные через Госуслуги</p>
30
+ <ul className="list-disc list-inside mb-9">
31
+ <li>Вероятность одобрения выше</li>
32
+ <li>Без справок о доходах и трудоустройстве</li>
33
+ <li>С защитой Ваших данных</li>
34
+ </ul>
35
+ <Img
36
+ className="block mb-6 self-center @md:hidden"
37
+ image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
38
+ height="80"
39
+ width="80"
40
+ />
41
+ <Button type="button" onClick={handleAuth} className="w-full @md:w-fit">
42
+ Заполнить
43
+ </Button>
44
+ </div>
45
+ <Img
46
+ className="hidden @md:block"
47
+ image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
48
+ height="164"
49
+ />
50
+ </div>
51
+ );
52
+ });
@@ -3,32 +3,6 @@ import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
3
3
  import { type ProductType } from './ApplicationLeadFormContent';
4
4
  import { productTypeToConsentsMap } from './consents';
5
5
 
6
- export const applicationFormData: SectionsRetailProps[] = [
7
- {
8
- columns: 2,
9
- inputs: [
10
- { name: 'surname', required: true, dadata: true },
11
- { name: 'name', required: true, dadata: true },
12
- { name: 'middleName', dadata: true },
13
- { name: 'limitedBirthday', required: true },
14
- { name: 'phone', required: true },
15
- { name: 'email', required: true, dadata: true },
16
- ],
17
- },
18
- {
19
- inputs: [
20
- { name: 'processPersonalDataFlg', required: true },
21
- { name: 'consentProviderFlg', required: true },
22
- { name: 'consentOthersFlg', required: true },
23
- { name: 'consentInformFlg' },
24
- { name: 'consentPfrFlg' },
25
- { name: 'consentInformMaterialsFlg' },
26
- { name: 'consentPhotoFlg' },
27
- { name: 'consentFATCA' },
28
- ],
29
- },
30
- ];
31
-
32
6
  export const getApplicationFormData = (productType: ProductType): SectionsRetailProps[] => {
33
7
  const currentProductConsents = productTypeToConsentsMap[productType];
34
8
  const allConsents: FieldRetailDef[] = [
@@ -46,11 +20,11 @@ export const getApplicationFormData = (productType: ProductType): SectionsRetail
46
20
  {
47
21
  columns: 2,
48
22
  inputs: [
49
- { name: 'surname', required: true, dadata: true },
50
- { name: 'name', required: true, dadata: true },
51
- { name: 'middleName', dadata: true },
52
- { name: 'limitedBirthday', required: true },
53
- { name: 'phone', required: true },
23
+ { name: 'surname', required: true, dadata: true, filledByEsia: true },
24
+ { name: 'name', required: true, dadata: true, filledByEsia: true },
25
+ { name: 'middleName', dadata: true, filledByEsia: true },
26
+ { name: 'limitedBirthday', required: true, filledByEsia: true },
27
+ { name: 'phone', required: true, filledByEsia: true },
54
28
  { name: 'email', required: true, dadata: true },
55
29
  ],
56
30
  },
@@ -21,9 +21,16 @@ const initialFormState = {
21
21
  export const getInitialFormState = (
22
22
  inputs: FieldRetailDef[],
23
23
  savedForm: LeadFormState | null,
24
+ esiaAuthSuccess: boolean,
24
25
  ): LeadFormState => {
25
26
  if (savedForm) {
26
- return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
27
+ return {
28
+ ...savedForm,
29
+ limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
30
+ ...(!esiaAuthSuccess && {
31
+ esiaAccountTypeCd: { key: '' },
32
+ }),
33
+ };
27
34
  }
28
35
 
29
36
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
@@ -1,33 +1,62 @@
1
1
  /* eslint-disable max-lines */
2
- import { type UpdateProfileEsiaResponse } from '../../retail/api/updateProfileEsia';
2
+ /* eslint-disable max-lines-per-function */
3
+ import { type EsiaRequestProfileResponse } from '../../retail/api/esiaRequestProfile';
3
4
  import { uploadFile, type DocumentCategory } from '../../retail/api/uploadFile';
4
5
  import { type Address, type File, type LeadFormState } from '../../retail/model/LeadFormState';
5
6
  import { normalizePhone } from '../../ui-kit/PhoneInput/normalizePhone';
6
7
 
8
+ type Document = {
9
+ file: string;
10
+ category: DocumentCategory;
11
+ isPDF: boolean;
12
+ };
13
+
7
14
  export const parseEsiaProfile = async (
8
- esiaProfile: UpdateProfileEsiaResponse,
9
- taskId: string,
15
+ esiaProfile: EsiaRequestProfileResponse,
10
16
  isDebit: boolean,
11
17
  ): Promise<LeadFormState> => {
12
18
  isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
13
19
 
14
20
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } =
15
21
  esiaProfile;
16
- const files: File[] = [];
22
+ let files: File[] = [];
17
23
 
18
24
  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
- });
25
+ files = await saveDocuments([
26
+ {
27
+ file: esiaAdditionalDocument.pdfFileWorkbook,
28
+ category: 'CONFIRMING_INCOME_DOC',
29
+ isPDF: true,
30
+ },
31
+ {
32
+ file: esiaAdditionalDocument.pdfFilePayout,
33
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
34
+ isPDF: true,
35
+ },
36
+ {
37
+ file: esiaAdditionalDocument.pdfFileSigPayout,
38
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
39
+ isPDF: true,
40
+ },
41
+ {
42
+ file: esiaAdditionalDocument.xmlFilePayout,
43
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
44
+ isPDF: false,
45
+ },
46
+ {
47
+ file: esiaAdditionalDocument.xmlFileSigPayout,
48
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
49
+ isPDF: false,
50
+ },
51
+ {
52
+ file: esiaAdditionalDocument.xmlFileWorkbook,
53
+ category: 'CONFIRMING_INCOME_DOC',
54
+ isPDF: false,
55
+ },
56
+ //TODO: После тестирования добавить документы снизу
57
+ // {file: esiaAdditionalDocument.pdfFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: true},
58
+ // {file: esiaAdditionalDocument.xmlFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: false},
59
+ ]);
31
60
  }
32
61
 
33
62
  const mainData = {
@@ -74,7 +103,7 @@ const concatFullAddress = (address: Array<string | undefined>): string => {
74
103
  }, '');
75
104
  };
76
105
 
77
- const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']): Address => {
106
+ const buildAddress = (fields: EsiaRequestProfileResponse['addressRegistration']): Address => {
78
107
  const {
79
108
  postcode,
80
109
  region,
@@ -110,24 +139,22 @@ const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']):
110
139
 
111
140
  const getYearFromMonth = (month: number) => Math.floor(month / 12);
112
141
 
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));
142
+ const saveDocuments = async (documents: Document[]): Promise<File[]> => {
143
+ const files: File[] = [];
144
+
145
+ for (const doc of documents) {
146
+ const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
147
+
148
+ await fetch(`${contentType},${doc.file}`)
149
+ .then((res) => res.blob())
150
+ .then((value) => uploadFile(value, doc.category, doc.isPDF))
151
+ .then((file) => files.push(file));
152
+ }
153
+
154
+ return files;
128
155
  };
129
156
 
130
- const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
157
+ const checkEsiaDataForCredit = (esiaProfile: EsiaRequestProfileResponse) => {
131
158
  const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
132
159
 
133
160
  const data = [
@@ -153,6 +180,13 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
153
180
  esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
154
181
  esiaAdditionalDocument.pdfFilePayout,
155
182
  esiaAdditionalDocument.pdfFileWorkbook,
183
+ esiaAdditionalDocument.pdfFileSigPayout,
184
+ esiaAdditionalDocument.xmlFilePayout,
185
+ esiaAdditionalDocument.xmlFileSigPayout,
186
+ esiaAdditionalDocument.xmlFileWorkbook,
187
+ //TODO: После тестирования добавить документы снизу
188
+ // esiaAdditionalDocument.pdfFileSigWorkbook,
189
+ // esiaAdditionalDocument.xmlFileSigWorkbook
156
190
  ];
157
191
 
158
192
  if (!data.every((_) => Boolean(_))) {
@@ -160,7 +194,7 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
160
194
  }
161
195
  };
162
196
 
163
- const checkEsiaDataForDebit = (esiaProfile: UpdateProfileEsiaResponse) => {
197
+ const checkEsiaDataForDebit = (esiaProfile: EsiaRequestProfileResponse) => {
164
198
  const { profile, document, addressRegistration } = esiaProfile;
165
199
 
166
200
  const data = [
@@ -12,7 +12,6 @@ import { updateUserProfile } from '../../retail/api/updateUserProfile';
12
12
  import { updateUserTask } from '../../retail/api/updateUserTask';
13
13
  import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
14
14
  import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
15
- import { useEsiaLoginDialog } from '../../retail/components/EsiaLoginDialog/useEsiaLoginDialog';
16
15
  import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
17
16
  import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
18
17
  import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
@@ -28,7 +27,7 @@ interface ApplicationLeadApiProps extends AspectsProps {
28
27
  programId: string;
29
28
  nextStepLink: string;
30
29
  productType: ProductType;
31
- esiaError: boolean;
30
+ esiaAuthSuccess: boolean;
32
31
  }
33
32
 
34
33
  // eslint-disable-next-line max-lines-per-function
@@ -36,7 +35,6 @@ export const useApplicationLeadApi = ({
36
35
  programId,
37
36
  nextStepLink,
38
37
  productType,
39
- esiaError,
40
38
  data,
41
39
  }: ApplicationLeadApiProps) => {
42
40
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
@@ -45,77 +43,72 @@ export const useApplicationLeadApi = ({
45
43
  const sendAspects = useSendLeadFormAspects({ data });
46
44
  const navigator = locationNavigator();
47
45
 
48
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
49
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
46
+ const goToNextStep = useCallback(() => {
47
+ navigator.assign(nextStepLink);
48
+ }, []);
49
+
50
+ const consentBkiDialog = useConsentBkiDialog(goToNextStep);
50
51
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
51
52
  const draftDialog = useDraftDialog();
52
53
 
53
- const handleSubmit = useCallback(
54
- async (formData: LeadFormState) => {
55
- if (esiaError) {
56
- navigator.assign(nextStepLink);
57
-
58
- return;
59
- }
60
- try {
61
- startSending();
62
- const profileId = await createUserProfile({
63
- profile: { phone: formatPhone(formData.phone as string) },
64
- });
54
+ const handleSubmit = useCallback(async (formData: LeadFormState) => {
55
+ try {
56
+ startSending();
57
+ const profileId = await createUserProfile({
58
+ profile: { phone: formatPhone(formData.phone as string) },
59
+ });
65
60
 
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();
61
+ if (profileId && formData?.phone) {
62
+ const sendCurrentTask = async () => {
63
+ await updateUserData({
64
+ programId,
65
+ profileId,
66
+ formData,
67
+ productType,
68
+ saveUserData,
69
+ sendAspects,
70
+ });
71
+ verifyPhoneDialog.close();
72
+ if (productType === 'debitCard') {
73
+ goToNextStep();
74
+ } else {
75
+ consentBkiDialog.open(formData.phone, profileId);
76
+ }
77
+ };
78
+ const handleSuccessVerify = async () => {
79
+ try {
80
+ const lastTaskId = await getLastTaskStatus({ profileId, programId });
81
+
82
+ if (lastTaskId) {
83
+ const task = await getTaskById({ taskId: lastTaskId });
84
+ verifyPhoneDialog.close();
85
+ draftDialog.open({
86
+ task,
87
+ isFromLead: true,
88
+ sendAspects,
89
+ onClose: sendCurrentTask,
90
+ });
79
91
  } else {
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
+ await sendCurrentTask();
101
93
  }
102
- };
94
+ } catch {
95
+ setOK(false);
96
+ }
97
+ };
103
98
 
104
- const acceptedConsents = getAcceptedConsents(formData, productType);
99
+ const acceptedConsents = getAcceptedConsents(formData, productType);
105
100
 
106
- verifyPhoneDialog.open({
107
- phone: formData?.phone,
108
- consents: acceptedConsents,
109
- onSuccess: handleSuccessVerify,
110
- });
111
- endSending();
112
- }
113
- } catch {
114
- setOK(false);
101
+ verifyPhoneDialog.open({
102
+ phone: formData?.phone,
103
+ consents: acceptedConsents,
104
+ onSuccess: handleSuccessVerify,
105
+ });
106
+ endSending();
115
107
  }
116
- },
117
- [esiaError],
118
- );
108
+ } catch {
109
+ setOK(false);
110
+ }
111
+ }, []);
119
112
 
120
113
  return { isSending, ok, handleSubmit };
121
114
  };