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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/bundle/bundle.umd.js +229 -198
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  4. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  5. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  6. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  7. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  8. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  9. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  10. package/bundle/retail/api/checkCode.d.ts +1 -0
  11. package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
  12. package/bundle/retail/api/updateUserTask.d.ts +1 -0
  13. package/bundle/retail/api/uploadFile.d.ts +1 -1
  14. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  15. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  16. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  17. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  19. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  20. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
  21. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  22. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  23. package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  24. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  25. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  26. package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  27. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  29. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  30. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  32. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  33. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  35. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  36. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  37. package/dist/retail/api/checkCode.d.ts +1 -0
  38. package/dist/retail/api/checkCode.js +3 -2
  39. package/dist/retail/api/checkCode.js.map +1 -1
  40. package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
  41. package/dist/retail/api/esiaRequestProfile.js +10 -0
  42. package/dist/retail/api/esiaRequestProfile.js.map +1 -0
  43. package/dist/retail/api/updateUserTask.d.ts +1 -0
  44. package/dist/retail/api/updateUserTask.js.map +1 -1
  45. package/dist/retail/api/uploadFile.d.ts +1 -1
  46. package/dist/retail/api/uploadFile.js +2 -3
  47. package/dist/retail/api/uploadFile.js.map +1 -1
  48. package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  49. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  50. package/dist/retail/components/Fields/BeginDateField.js +2 -1
  51. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  52. package/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  53. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  54. package/dist/retail/components/Fields/DaDataInnField.js +2 -1
  55. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  56. package/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  57. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  58. package/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  59. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  60. package/dist/retail/components/Fields/JobsNumberField.js +2 -1
  61. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  62. package/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  63. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  64. package/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  65. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  66. package/dist/retail/components/Fields/WagesField.js +2 -1
  67. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  68. package/dist/retail/content.js +11 -5
  69. package/dist/retail/content.js.map +1 -1
  70. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  71. package/dist/retail/utils/mainFormStateMap.js +1 -0
  72. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  73. package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  74. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  75. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  76. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  77. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  78. package/lib/common.css +1 -1
  79. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  80. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  81. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  82. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  83. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
  84. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  85. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  86. package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  87. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  88. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  89. package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  90. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  91. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  92. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  93. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  94. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  95. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  96. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  97. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  98. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  99. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  100. package/lib/retail/api/checkCode.d.ts +1 -0
  101. package/lib/retail/api/checkCode.js +1 -1
  102. package/lib/retail/api/checkCode.js.map +1 -1
  103. package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
  104. package/lib/retail/api/esiaRequestProfile.js +7 -0
  105. package/lib/retail/api/esiaRequestProfile.js.map +1 -0
  106. package/lib/retail/api/updateUserTask.d.ts +1 -0
  107. package/lib/retail/api/updateUserTask.js.map +1 -1
  108. package/lib/retail/api/uploadFile.d.ts +1 -1
  109. package/lib/retail/api/uploadFile.js +2 -3
  110. package/lib/retail/api/uploadFile.js.map +1 -1
  111. package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  112. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  113. package/lib/retail/components/Fields/BeginDateField.js +2 -1
  114. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  115. package/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  116. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  117. package/lib/retail/components/Fields/DaDataInnField.js +2 -1
  118. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  119. package/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  120. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  121. package/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  122. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  123. package/lib/retail/components/Fields/JobsNumberField.js +2 -1
  124. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  125. package/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  126. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  127. package/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  128. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  129. package/lib/retail/components/Fields/WagesField.js +2 -1
  130. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  131. package/lib/retail/content.js +11 -5
  132. package/lib/retail/content.js.map +1 -1
  133. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  134. package/lib/retail/utils/mainFormStateMap.js +1 -0
  135. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  136. package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  137. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  138. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  139. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  140. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  141. package/mobile/bundle/bundle.umd.js +229 -198
  142. package/mobile/bundle/bundle.umd.min.js +1 -1
  143. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  144. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  145. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  146. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  147. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  148. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  149. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  150. package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
  151. package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
  152. package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
  153. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  154. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  155. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  156. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  157. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  158. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  159. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  160. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
  161. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  162. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  163. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  164. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  165. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  166. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  167. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  168. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  169. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  170. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  171. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  172. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  173. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  174. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  175. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  176. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  177. package/mobile/dist/retail/api/checkCode.d.ts +1 -0
  178. package/mobile/dist/retail/api/checkCode.js +3 -2
  179. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  180. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
  181. package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
  182. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
  183. package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
  184. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  185. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  186. package/mobile/dist/retail/api/uploadFile.js +2 -3
  187. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  188. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  189. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  190. package/mobile/dist/retail/components/Fields/BeginDateField.js +2 -1
  191. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  192. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  193. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  194. package/mobile/dist/retail/components/Fields/DaDataInnField.js +2 -1
  195. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  196. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  197. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  198. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  199. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  200. package/mobile/dist/retail/components/Fields/JobsNumberField.js +2 -1
  201. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  202. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  203. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  204. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  205. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  206. package/mobile/dist/retail/components/Fields/WagesField.js +2 -1
  207. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  208. package/mobile/dist/retail/content.js +11 -5
  209. package/mobile/dist/retail/content.js.map +1 -1
  210. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  211. package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
  212. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  213. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  214. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  215. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  216. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  217. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  218. package/mobile/lib/common.css +1 -1
  219. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  220. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  221. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  222. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  223. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
  224. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  225. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  226. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  227. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  228. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  229. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  230. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  231. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  232. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  233. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  234. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  235. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  236. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  237. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  238. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  239. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  240. package/mobile/lib/retail/api/checkCode.d.ts +1 -0
  241. package/mobile/lib/retail/api/checkCode.js +1 -1
  242. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  243. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
  244. package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
  245. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
  246. package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
  247. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  248. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  249. package/mobile/lib/retail/api/uploadFile.js +2 -3
  250. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  251. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  252. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  253. package/mobile/lib/retail/components/Fields/BeginDateField.js +2 -1
  254. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  255. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  256. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  257. package/mobile/lib/retail/components/Fields/DaDataInnField.js +2 -1
  258. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  259. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  260. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  261. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  262. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  263. package/mobile/lib/retail/components/Fields/JobsNumberField.js +2 -1
  264. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  265. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  266. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  267. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  268. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  269. package/mobile/lib/retail/components/Fields/WagesField.js +2 -1
  270. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  271. package/mobile/lib/retail/content.js +11 -5
  272. package/mobile/lib/retail/content.js.map +1 -1
  273. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  274. package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
  275. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  276. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  277. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  278. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  279. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  280. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  281. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
  282. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
  283. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  284. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  285. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
  286. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
  287. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
  288. package/mobile/src/retail/api/checkCode.ts +1 -1
  289. package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  290. package/mobile/src/retail/api/updateUserTask.ts +1 -0
  291. package/mobile/src/retail/api/uploadFile.ts +2 -3
  292. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  293. package/mobile/src/retail/components/Fields/BeginDateField.tsx +2 -0
  294. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  295. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  296. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  297. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  298. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  299. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  300. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  301. package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
  302. package/mobile/src/retail/content.tsx +11 -5
  303. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  304. package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
  305. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  306. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  307. package/package.json +1 -1
  308. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
  309. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
  310. package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  311. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  312. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
  313. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
  314. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
  315. package/src/retail/api/checkCode.ts +1 -1
  316. package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  317. package/src/retail/api/updateUserTask.ts +1 -0
  318. package/src/retail/api/uploadFile.ts +2 -3
  319. package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  320. package/src/retail/components/Fields/BeginDateField.tsx +2 -0
  321. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  322. package/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  323. package/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  324. package/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  325. package/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  326. package/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  327. package/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  328. package/src/retail/components/Fields/WagesField.tsx +2 -0
  329. package/src/retail/content.tsx +11 -5
  330. package/src/retail/model/NameFieldDef.ts +1 -0
  331. package/src/retail/utils/mainFormStateMap.ts +1 -0
  332. package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  333. package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  334. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  335. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  336. package/dist/retail/api/updateProfileEsia.js +0 -6
  337. package/dist/retail/api/updateProfileEsia.js.map +0 -1
  338. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  339. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  340. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  341. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  342. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  343. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  344. package/lib/retail/api/updateProfileEsia.js +0 -3
  345. package/lib/retail/api/updateProfileEsia.js.map +0 -1
  346. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  347. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
  348. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  349. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  350. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  351. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  352. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  353. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  354. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  355. package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
  356. package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
  357. package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
  358. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  359. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  360. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  361. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  362. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  363. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  364. package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
  365. package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
  366. package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
  367. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  368. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  369. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  370. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  371. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  372. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  373. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  374. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
  375. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
  376. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  377. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
@@ -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,23 @@
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
 
7
8
  export const parseEsiaProfile = async (
8
- esiaProfile: UpdateProfileEsiaResponse,
9
- taskId: string,
9
+ esiaProfile: EsiaRequestProfileResponse,
10
10
  isDebit: boolean,
11
11
  ): Promise<LeadFormState> => {
12
- isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
12
+ checkEsiaData(esiaProfile);
13
+ const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
13
14
 
14
15
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } =
15
16
  esiaProfile;
16
- const files: File[] = [];
17
+ let files: File[] = [];
17
18
 
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
- });
19
+ if (isFullEsiaData) {
20
+ files = await saveDocuments(esiaAdditionalDocument);
31
21
  }
32
22
 
33
23
  const mainData = {
@@ -45,12 +35,12 @@ export const parseEsiaProfile = async (
45
35
  birthPlace: addInfo.birthPlace,
46
36
  addressRegistration: buildAddress(addressRegistration),
47
37
  addressFact: buildAddress(addressFact),
48
- esiaAccountTypeCd: profile.esiaAccountType,
38
+ esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
49
39
  };
50
40
 
51
41
  return {
52
42
  ...mainData,
53
- ...(!isDebit && {
43
+ ...(isFullEsiaData && {
54
44
  snils: addInfo.snils,
55
45
  inn: esiaAdditionalDocument.inn,
56
46
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -59,6 +49,9 @@ export const parseEsiaProfile = async (
59
49
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
60
50
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
61
51
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
52
+ esiaAccountTypeCd: profile.esiaAccountType,
53
+ confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
54
+ employment: { key: 'WORK', text: 'Работаю' },
62
55
  files,
63
56
  }),
64
57
  };
@@ -74,7 +67,7 @@ const concatFullAddress = (address: Array<string | undefined>): string => {
74
67
  }, '');
75
68
  };
76
69
 
77
- const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']): Address => {
70
+ const buildAddress = (fields: EsiaRequestProfileResponse['addressRegistration']): Address => {
78
71
  const {
79
72
  postcode,
80
73
  region,
@@ -110,25 +103,67 @@ const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']):
110
103
 
111
104
  const getYearFromMonth = (month: number) => Math.floor(month / 12);
112
105
 
113
- const 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));
106
+ const saveDocuments = async (
107
+ esiaAdditionalDocument: EsiaRequestProfileResponse['esiaAdditionalDocument'],
108
+ ): Promise<File[]> => {
109
+ const files: File[] = [];
110
+ const documents = [
111
+ {
112
+ file: esiaAdditionalDocument.pdfFileWorkbook,
113
+ category: 'CONFIRMING_INCOME_DOC',
114
+ isPDF: true,
115
+ },
116
+ {
117
+ file: esiaAdditionalDocument.pdfFilePayout,
118
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
119
+ isPDF: true,
120
+ },
121
+ {
122
+ file: esiaAdditionalDocument.pdfFileSigPayout,
123
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
124
+ isPDF: true,
125
+ },
126
+ {
127
+ file: esiaAdditionalDocument.xmlFilePayout,
128
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
129
+ isPDF: false,
130
+ },
131
+ {
132
+ file: esiaAdditionalDocument.xmlFileSigPayout,
133
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
134
+ isPDF: false,
135
+ },
136
+ {
137
+ file: esiaAdditionalDocument.xmlFileWorkbook,
138
+ category: 'CONFIRMING_INCOME_DOC',
139
+ isPDF: false,
140
+ },
141
+ {
142
+ file: esiaAdditionalDocument.pdfFileSigWorkbook,
143
+ category: 'CONFIRMING_INCOME_DOC',
144
+ isPDF: true,
145
+ },
146
+ {
147
+ file: esiaAdditionalDocument.xmlFileSigWorkbook,
148
+ category: 'CONFIRMING_INCOME_DOC',
149
+ isPDF: false,
150
+ },
151
+ ];
152
+
153
+ for (const doc of documents) {
154
+ const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
155
+
156
+ await fetch(`${contentType},${doc.file}`)
157
+ .then((res) => res.blob())
158
+ .then((value) => uploadFile(value, doc.category as DocumentCategory, doc.isPDF))
159
+ .then((file) => files.push(file));
160
+ }
161
+
162
+ return files;
128
163
  };
129
164
 
130
- const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
131
- const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
165
+ const checkEsiaData = (esiaProfile: EsiaRequestProfileResponse) => {
166
+ const { profile, document, addressRegistration } = esiaProfile;
132
167
 
133
168
  const data = [
134
169
  profile.name,
@@ -136,7 +171,6 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
136
171
  profile.midname,
137
172
  profile.birthDate,
138
173
  profile.phone,
139
- profile.email,
140
174
  document.dulIssueDate,
141
175
  document.dulIssuedBy,
142
176
  document.dulNumber,
@@ -144,15 +178,6 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
144
178
  document.dulSubdivisionCode,
145
179
  addressRegistration,
146
180
  profile.esiaAccountType,
147
- esiaAdditionalDocument.inn,
148
- esiaAdditionalDocument.averageMonthlyIncome.toString(),
149
- esiaAdditionalDocument.startWorkDate,
150
- esiaAdditionalDocument.workLengthInFiveYears.toString(),
151
- esiaAdditionalDocument.workLength.toString(),
152
- esiaAdditionalDocument.workLengthLastJob.toString(),
153
- esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
154
- esiaAdditionalDocument.pdfFilePayout,
155
- esiaAdditionalDocument.pdfFileWorkbook,
156
181
  ];
157
182
 
158
183
  if (!data.every((_) => Boolean(_))) {
@@ -160,26 +185,26 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
160
185
  }
161
186
  };
162
187
 
163
- const checkEsiaDataForDebit = (esiaProfile: UpdateProfileEsiaResponse) => {
164
- const { profile, document, addressRegistration } = esiaProfile;
188
+ const checkEsiaAdditionalDocument = (esiaProfile: EsiaRequestProfileResponse) => {
189
+ const { esiaAdditionalDocument } = esiaProfile;
165
190
 
166
191
  const data = [
167
- profile.name,
168
- profile.surname,
169
- profile.midname,
170
- profile.birthDate,
171
- profile.phone,
172
- profile.email,
173
- document.dulIssueDate,
174
- document.dulIssuedBy,
175
- document.dulNumber,
176
- document.dulSerie,
177
- document.dulSubdivisionCode,
178
- addressRegistration,
179
- profile.esiaAccountType,
192
+ esiaAdditionalDocument?.inn,
193
+ esiaAdditionalDocument?.averageMonthlyIncome?.toString(),
194
+ esiaAdditionalDocument?.startWorkDate,
195
+ esiaAdditionalDocument?.workLengthInFiveYears?.toString(),
196
+ esiaAdditionalDocument?.workLength?.toString(),
197
+ esiaAdditionalDocument?.workLengthLastJob?.toString(),
198
+ esiaAdditionalDocument?.jobsNumberInFiveYears?.toString(),
199
+ esiaAdditionalDocument?.pdfFilePayout,
200
+ esiaAdditionalDocument?.pdfFileWorkbook,
201
+ esiaAdditionalDocument?.pdfFileSigPayout,
202
+ esiaAdditionalDocument?.xmlFilePayout,
203
+ esiaAdditionalDocument?.xmlFileSigPayout,
204
+ esiaAdditionalDocument?.xmlFileWorkbook,
205
+ esiaAdditionalDocument?.pdfFileSigWorkbook,
206
+ esiaAdditionalDocument?.xmlFileSigWorkbook,
180
207
  ];
181
208
 
182
- if (!data.every((_) => Boolean(_))) {
183
- throw new Error();
184
- }
209
+ return data.every((_) => Boolean(_));
185
210
  };
@@ -12,7 +12,6 @@ import { updateUserProfile } from '../../retail/api/updateUserProfile';
12
12
  import { updateUserTask } from '../../retail/api/updateUserTask';
13
13
  import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
14
14
  import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
15
- import { useEsiaLoginDialog } from '../../retail/components/EsiaLoginDialog/useEsiaLoginDialog';
16
15
  import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
17
16
  import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
18
17
  import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
@@ -28,7 +27,6 @@ interface ApplicationLeadApiProps extends AspectsProps {
28
27
  programId: string;
29
28
  nextStepLink: string;
30
29
  productType: ProductType;
31
- esiaError: boolean;
32
30
  }
33
31
 
34
32
  // eslint-disable-next-line max-lines-per-function
@@ -36,7 +34,6 @@ export const useApplicationLeadApi = ({
36
34
  programId,
37
35
  nextStepLink,
38
36
  productType,
39
- esiaError,
40
37
  data,
41
38
  }: ApplicationLeadApiProps) => {
42
39
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
@@ -45,78 +42,72 @@ export const useApplicationLeadApi = ({
45
42
  const sendAspects = useSendLeadFormAspects({ data });
46
43
  const navigator = locationNavigator();
47
44
 
48
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
49
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
45
+ const goToNextStep = useCallback(() => {
46
+ navigator.assign(nextStepLink);
47
+ }, []);
48
+
49
+ const consentBkiDialog = useConsentBkiDialog(goToNextStep);
50
50
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
51
51
  const draftDialog = useDraftDialog();
52
52
 
53
- const handleSubmit = useCallback(
54
- async (formData: LeadFormState) => {
55
- if (esiaError) {
56
- navigator.assign(nextStepLink);
57
-
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
- });
53
+ const handleSubmit = useCallback(async (formData: LeadFormState) => {
54
+ try {
55
+ startSending();
56
+ const profileId = await createUserProfile({
57
+ profile: { phone: formatPhone(formData.phone as string) },
58
+ });
66
59
 
67
- 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();
60
+ if (profileId && formData?.phone) {
61
+ const sendCurrentTask = async () => {
62
+ await updateUserData({
63
+ programId,
64
+ profileId,
65
+ formData,
66
+ productType,
67
+ saveUserData,
68
+ sendAspects,
69
+ });
70
+ verifyPhoneDialog.close();
71
+ if (productType === 'debitCard') {
72
+ goToNextStep();
73
+ } else {
74
+ consentBkiDialog.open(formData.phone, profileId);
75
+ }
76
+ };
77
+ const handleSuccessVerify = async () => {
78
+ try {
79
+ const lastTaskId = await getLastTaskStatus({ profileId, programId });
80
+
81
+ if (lastTaskId) {
82
+ const task = await getTaskById({ taskId: lastTaskId });
83
+ verifyPhoneDialog.close();
84
+ draftDialog.open({
85
+ task,
86
+ isFromLead: true,
87
+ sendAspects,
88
+ onClose: sendCurrentTask,
89
+ });
80
90
  } else {
81
- consentBkiDialog.open(transformedFormData.phone, profileId);
91
+ await sendCurrentTask();
82
92
  }
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
- };
93
+ } catch {
94
+ setOK(false);
95
+ }
96
+ };
104
97
 
105
- const acceptedConsents = getAcceptedConsents(formData, productType);
98
+ const acceptedConsents = getAcceptedConsents(formData, productType);
106
99
 
107
- verifyPhoneDialog.open({
108
- phone: transformedFormData?.phone,
109
- consents: acceptedConsents,
110
- onSuccess: handleSuccessVerify,
111
- });
112
- endSending();
113
- }
114
- } catch {
115
- setOK(false);
100
+ verifyPhoneDialog.open({
101
+ phone: formData?.phone,
102
+ consents: acceptedConsents,
103
+ onSuccess: handleSuccessVerify,
104
+ });
105
+ endSending();
116
106
  }
117
- },
118
- [esiaError],
119
- );
107
+ } catch {
108
+ setOK(false);
109
+ }
110
+ }, []);
120
111
 
121
112
  return { isSending, ok, handleSubmit };
122
113
  };
@@ -225,10 +216,3 @@ const transformConsentsFields = (
225
216
  consentAssignmentClaimsFlg: consentOthersFlg,
226
217
  };
227
218
  };
228
-
229
- const transformFormData = (formData: LeadFormState): LeadFormState => ({
230
- ...formData,
231
- surname: formData.surname?.trim(),
232
- name: formData.name?.trim(),
233
- middleName: formData.middleName?.trim(),
234
- });
@@ -1,11 +1,9 @@
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';
4
2
  import { useSetter } from '../../hooks/useSetter';
5
- import { updateProfileEsia } from '../../retail/api/updateProfileEsia';
3
+ import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
6
4
  import { type LeadFormState } from '../../retail/model/LeadFormState';
7
5
  import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
8
- import { safeJsonParse } from '../../utils/safeJsonParse';
6
+ import { EsiaStatuses } from './ApplicationLeadForm';
9
7
  import { type ProductType } from './ApplicationLeadFormContent';
10
8
  import { getInitialFormState } from './getInitialFormState';
11
9
  import { parseEsiaProfile } from './parseEsiaProfile';
@@ -15,76 +13,62 @@ type InitApplicationLeadProps = {
15
13
  inputs: FieldRetailDef[];
16
14
  nextStepLink: string;
17
15
  productType: ProductType;
18
- setEsiaError: () => void;
16
+ setEsiaStatus: (status: EsiaStatuses) => void;
17
+ esiaAuthSuccess: boolean;
19
18
  };
20
19
 
21
20
  export const useInitApplicationLead = ({
22
21
  inputs,
23
- nextStepLink,
24
22
  productType,
25
- setEsiaError,
26
- }: InitApplicationLeadProps): [LeadFormState, { isLoading: boolean }] => {
27
- const navigator = locationNavigator();
28
- const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
29
-
23
+ setEsiaStatus,
24
+ esiaAuthSuccess,
25
+ }: InitApplicationLeadProps): LeadFormState => {
30
26
  const leadFormStore = useLeadFormStore();
31
27
  const saveForm = useSetter(leadFormStore, 'leadForm');
32
28
 
33
29
  const initialFormState = useMemo(
34
- () => getInitialFormState(inputs, leadFormStore.leadForm),
30
+ () => getInitialFormState(inputs, leadFormStore.leadForm, esiaAuthSuccess),
35
31
  [inputs, leadFormStore.leadForm],
36
32
  );
37
33
 
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
- );
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
+ });
55
43
 
56
- saveForm((_) => ({
57
- ..._,
58
- ...parsedData,
59
- }));
60
- }
44
+ if (data) {
45
+ const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
61
46
 
62
- navigator.assign(nextStepLink);
63
- } catch {
64
- setEsiaError();
65
- } finally {
66
- endLoading();
47
+ saveForm((_) => ({
48
+ ..._,
49
+ ...parsedData,
50
+ }));
51
+ setEsiaStatus(EsiaStatuses.Success);
67
52
  }
68
- },
69
- [nextStepLink],
70
- );
53
+ } catch {
54
+ setEsiaStatus(EsiaStatuses.Error);
55
+ }
56
+ }, []);
71
57
 
72
58
  useEffect(() => {
73
59
  leadFormStore.productType = productType;
74
- const profileId: string = <string>(
75
- safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? '')
76
- );
60
+
77
61
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
78
62
  const code = params.get('code');
79
63
  const state = params.get('state');
80
64
 
81
- if (profileId && code && state) {
82
- updateEsiaProfile(profileId, code, state);
65
+ if (code && state) {
66
+ requestEsiaProfile(code, state);
83
67
  } else {
84
68
  sessionStorage.removeItem('accessToken');
85
69
  sessionStorage.removeItem('refreshToken');
86
70
  }
87
71
  }, []);
88
72
 
89
- return [initialFormState, { isLoading }];
73
+ return initialFormState;
90
74
  };
@@ -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
- const saveToken = (data: CheckCodeResponse | null) => {
19
+ export 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,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`, {