@tap-payments/auth-jsconnect 2.3.3-test → 2.3.3

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 (492) hide show
  1. package/build/@types/app.d.ts +309 -7
  2. package/build/@types/app.js +17 -0
  3. package/build/@types/form.d.ts +29 -26
  4. package/build/@types/redux.d.ts +4 -0
  5. package/build/@types/theme.d.ts +1 -1
  6. package/build/@types/user.d.ts +39 -3
  7. package/build/api/account.d.ts +2 -2
  8. package/build/api/auth.d.ts +11 -11
  9. package/build/api/availabilityServices.d.ts +3 -3
  10. package/build/api/axios.js +1 -1
  11. package/build/api/board.d.ts +3 -3
  12. package/build/api/brand.d.ts +7 -0
  13. package/build/api/brand.js +10 -1
  14. package/build/api/country.d.ts +1 -1
  15. package/build/api/data.d.ts +18 -10
  16. package/build/api/data.js +34 -2
  17. package/build/api/document.d.ts +2 -2
  18. package/build/api/entity.d.ts +26 -11
  19. package/build/api/entity.js +26 -1
  20. package/build/api/file.d.ts +2 -2
  21. package/build/api/file.js +1 -0
  22. package/build/api/index.d.ts +30 -6
  23. package/build/api/index.js +3 -1
  24. package/build/api/individual.d.ts +29 -11
  25. package/build/api/individual.js +9 -1
  26. package/build/api/init.d.ts +17 -0
  27. package/build/api/init.js +13 -0
  28. package/build/api/lead.d.ts +18 -11
  29. package/build/api/lead.js +9 -1
  30. package/build/api/operator.d.ts +1 -1
  31. package/build/api/operator.js +1 -1
  32. package/build/api/user.d.ts +2 -2
  33. package/build/app/settings.d.ts +21 -9
  34. package/build/app/settings.js +74 -35
  35. package/build/app/store.d.ts +4 -4
  36. package/build/assets/locales/ar.json +28 -1
  37. package/build/assets/locales/en.json +28 -1
  38. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -2
  39. package/build/components/AnimationFlow/AnimationFlow.js +4 -4
  40. package/build/components/AnimationFlow/BottomSheet.d.ts +4 -1
  41. package/build/components/AnimationFlow/BottomSheet.js +43 -19
  42. package/build/components/AnimationFlow/Dialog.d.ts +4 -2
  43. package/build/components/AnimationFlow/Dialog.js +30 -7
  44. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +5 -2
  45. package/build/components/ArabicDatePicker/ArabicDatePicker.js +45 -23
  46. package/build/components/ArabicDatePicker/arabicAr.d.ts +8 -0
  47. package/build/components/ArabicDatePicker/arabicAr.js +32 -0
  48. package/build/components/ArabicDatePicker/arabicEn.d.ts +8 -0
  49. package/build/components/ArabicDatePicker/arabicEn.js +32 -0
  50. package/build/components/ArabicDatePicker/style.css +45 -5
  51. package/build/components/DatePicker/DatePicker.d.ts +4 -1
  52. package/build/components/DatePicker/DatePicker.js +27 -17
  53. package/build/components/LogoBadge/LogoBadge.js +3 -0
  54. package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
  55. package/build/components/RadioGroup/RadioGroup.js +5 -9
  56. package/build/components/RadioGroup/index.d.ts +1 -1
  57. package/build/components/SimpleList/SimpleList.d.ts +5 -2
  58. package/build/components/SimpleList/SimpleList.js +31 -11
  59. package/build/components/Slide/Slide.d.ts +1 -1
  60. package/build/constants/api.d.ts +7 -0
  61. package/build/constants/api.js +14 -1
  62. package/build/constants/app.d.ts +45 -0
  63. package/build/constants/app.js +101 -52
  64. package/build/constants/assets.d.ts +9 -0
  65. package/build/constants/assets.js +9 -0
  66. package/build/constants/validation.d.ts +3 -2
  67. package/build/constants/validation.js +3 -2
  68. package/build/features/app/bank/bankStore.d.ts +88 -12
  69. package/build/features/app/bank/bankStore.js +157 -103
  70. package/build/features/app/brand/brandStore.d.ts +158 -21
  71. package/build/features/app/brand/brandStore.js +408 -214
  72. package/build/features/app/business/businessStore.d.ts +176 -29
  73. package/build/features/app/business/businessStore.js +365 -296
  74. package/build/features/app/connect/connectStore.d.ts +163 -14
  75. package/build/features/app/connect/connectStore.js +293 -96
  76. package/build/features/app/connectExpress/connectExpressStore.d.ts +223 -20
  77. package/build/features/app/connectExpress/connectExpressStore.js +233 -101
  78. package/build/features/app/entity/entityStore.d.ts +93 -23
  79. package/build/features/app/entity/entityStore.js +280 -249
  80. package/build/features/app/individual/individualStore.d.ts +192 -27
  81. package/build/features/app/individual/individualStore.js +533 -399
  82. package/build/features/app/password/passwordStore.d.ts +106 -12
  83. package/build/features/app/password/passwordStore.js +100 -44
  84. package/build/features/app/signIn/signInStore.d.ts +61 -7
  85. package/build/features/app/signIn/signInStore.js +1 -1
  86. package/build/features/app/tax/taxStore.d.ts +76 -9
  87. package/build/features/app/tax/taxStore.js +144 -102
  88. package/build/features/bank/Bank.js +10 -6
  89. package/build/features/bank/screens/BankDetails/BankDetails.js +43 -17
  90. package/build/features/bank/screens/BankDetails/BankName.d.ts +5 -1
  91. package/build/features/bank/screens/BankDetails/BankName.js +9 -9
  92. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +6 -2
  93. package/build/features/bank/screens/BankDetails/BankStatement.js +7 -10
  94. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +3 -1
  95. package/build/features/bank/screens/BankDetails/Beneficiary.js +6 -7
  96. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
  97. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +12 -13
  98. package/build/features/bank/screens/BankDetails/IBAN.d.ts +3 -1
  99. package/build/features/bank/screens/BankDetails/IBAN.js +4 -6
  100. package/build/features/bank/screens/BankDetails/validation.d.ts +8 -8
  101. package/build/features/bank/screens/BankDetails/validation.js +6 -17
  102. package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  103. package/build/features/bank/screens/Verify/OTPInput.js +5 -3
  104. package/build/features/bank/screens/Verify/Verify.js +1 -5
  105. package/build/features/brand/Brand.js +10 -6
  106. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +13 -30
  107. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +45 -28
  108. package/build/features/brand/screens/BrandActivities/BrandActivities.js +41 -9
  109. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +14 -41
  110. package/build/features/brand/screens/BrandActivities/CustomerBase.js +22 -31
  111. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +3 -1
  112. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +24 -20
  113. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +3 -1
  114. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +31 -19
  115. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +15 -8
  116. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
  117. package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -2
  118. package/build/features/brand/screens/BrandActivities/TAC.js +21 -12
  119. package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
  120. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +18 -4
  121. package/build/features/brand/screens/BrandActivities/validation.d.ts +43 -43
  122. package/build/features/brand/screens/BrandActivities/validation.js +11 -25
  123. package/build/features/brand/screens/BrandInfo/BrandInfo.js +40 -33
  124. package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
  125. package/build/features/brand/screens/BrandInfo/BrandLogo.js +41 -0
  126. package/build/features/brand/screens/BrandInfo/BrandName.d.ts +3 -2
  127. package/build/features/brand/screens/BrandInfo/BrandName.js +5 -8
  128. package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
  129. package/build/features/brand/screens/BrandInfo/SalesChannels.js +19 -25
  130. package/build/features/brand/screens/BrandInfo/validation.d.ts +7 -13
  131. package/build/features/brand/screens/BrandInfo/validation.js +43 -53
  132. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.d.ts +5 -0
  133. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +102 -0
  134. package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.d.ts +10 -0
  135. package/build/features/brand/screens/BrandSegmentInfo/SegmentLocations.js +69 -0
  136. package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.d.ts +10 -0
  137. package/build/features/brand/screens/BrandSegmentInfo/SegmentProfits.js +69 -0
  138. package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.d.ts +10 -0
  139. package/build/features/brand/screens/BrandSegmentInfo/SegmentTechs.js +69 -0
  140. package/build/features/{connect/screens/Merchant → brand/screens/BrandSegmentInfo}/TeamSize.d.ts +3 -1
  141. package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/TeamSize.js +20 -25
  142. package/build/features/brand/screens/BrandSegmentInfo/index.d.ts +2 -0
  143. package/build/features/brand/screens/BrandSegmentInfo/index.js +2 -0
  144. package/build/features/brand/screens/BrandSegmentInfo/validation.d.ts +17 -0
  145. package/build/features/brand/screens/BrandSegmentInfo/validation.js +9 -0
  146. package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  147. package/build/features/brand/screens/Verify/OTPInput.js +5 -3
  148. package/build/features/brand/screens/Verify/Verify.js +7 -20
  149. package/build/features/business/Business.js +7 -5
  150. package/build/features/business/screens/Activities/ActivitiesList.d.ts +17 -70
  151. package/build/features/business/screens/Activities/ActivitiesList.js +226 -98
  152. package/build/features/business/screens/Activities/OperationStartDate.d.ts +3 -3
  153. package/build/features/business/screens/Activities/OperationStartDate.js +3 -3
  154. package/build/features/business/screens/Activities/validation.d.ts +165 -30
  155. package/build/features/business/screens/Activities/validation.js +5 -2
  156. package/build/features/business/screens/BrandDetails/BrandDetails.d.ts +5 -0
  157. package/build/features/business/screens/BrandDetails/BrandDetails.js +39 -0
  158. package/build/features/business/screens/BrandDetails/BrandName.d.ts +5 -0
  159. package/build/features/business/screens/BrandDetails/BrandName.js +36 -0
  160. package/build/features/business/screens/BrandDetails/Header.d.ts +5 -0
  161. package/build/features/business/screens/BrandDetails/Header.js +49 -0
  162. package/build/features/business/screens/BrandDetails/LicenseInfo.d.ts +5 -0
  163. package/build/features/business/screens/BrandDetails/LicenseInfo.js +38 -0
  164. package/build/features/{brand/screens/BrandActivities/OperationStartDate.d.ts → business/screens/BrandDetails/SalesChannel.d.ts} +6 -8
  165. package/build/features/business/screens/BrandDetails/SalesChannel.js +48 -0
  166. package/build/features/business/screens/BrandDetails/index.d.ts +3 -0
  167. package/build/features/business/screens/BrandDetails/index.js +2 -0
  168. package/build/features/business/screens/BusinessType/Article.d.ts +4 -2
  169. package/build/features/business/screens/BusinessType/Article.js +19 -54
  170. package/build/features/business/screens/BusinessType/BusinessType.js +35 -11
  171. package/build/features/business/screens/BusinessType/EntityLicenseList.d.ts +9 -0
  172. package/build/features/business/screens/BusinessType/EntityLicenseList.js +129 -0
  173. package/build/features/business/screens/BusinessType/EntityName.js +6 -7
  174. package/build/features/business/screens/BusinessType/LicenseCertificate.js +2 -1
  175. package/build/features/business/screens/BusinessType/LicenseList.d.ts +1 -0
  176. package/build/features/business/screens/BusinessType/LicenseList.js +7 -22
  177. package/build/features/business/screens/BusinessType/LicenseNumber.d.ts +1 -2
  178. package/build/features/business/screens/BusinessType/LicenseNumber.js +7 -5
  179. package/build/features/business/screens/BusinessType/LicenseType.d.ts +3 -3
  180. package/build/features/business/screens/BusinessType/validation.js +2 -2
  181. package/build/features/business/screens/CivilID/IDNumber.js +2 -3
  182. package/build/features/business/screens/Customers/CustomerLocations.d.ts +47 -40
  183. package/build/features/business/screens/Customers/CustomerLocations.js +35 -19
  184. package/build/features/business/screens/Customers/Customers.js +27 -16
  185. package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -4
  186. package/build/features/business/screens/Customers/ExpectedSalesRange.js +14 -6
  187. package/build/features/business/screens/Customers/RefundPolicy.d.ts +7 -7
  188. package/build/features/business/screens/Customers/RefundPolicy.js +15 -4
  189. package/build/features/business/screens/Customers/TransactionPolicy.js +19 -9
  190. package/build/features/business/screens/IDBOD/DOB.js +3 -3
  191. package/build/features/business/screens/IDBOD/ID.js +2 -3
  192. package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  193. package/build/features/business/screens/Verify/OTPInput.js +5 -3
  194. package/build/features/connect/Connect.d.ts +2 -0
  195. package/build/features/connect/Connect.js +86 -11
  196. package/build/features/connect/screens/BrandSegment/BrandSegment.d.ts +5 -0
  197. package/build/features/connect/screens/BrandSegment/BrandSegment.js +84 -0
  198. package/build/features/connect/screens/BrandSegment/SegmentLocations.d.ts +8 -0
  199. package/build/features/connect/screens/{Merchant/Segments.js → BrandSegment/SegmentLocations.js} +17 -25
  200. package/build/features/connect/screens/BrandSegment/SegmentProfits.d.ts +8 -0
  201. package/build/features/{brand/screens/BrandInfo/Segments.js → connect/screens/BrandSegment/SegmentProfits.js} +18 -26
  202. package/build/features/connect/screens/BrandSegment/SegmentTechs.d.ts +8 -0
  203. package/build/features/connect/screens/BrandSegment/SegmentTechs.js +66 -0
  204. package/build/features/connect/screens/{Merchant → BrandSegment}/TeamSize.js +12 -20
  205. package/build/features/connect/screens/BrandSegment/index.d.ts +3 -0
  206. package/build/features/connect/screens/BrandSegment/index.js +2 -0
  207. package/build/features/connect/screens/BrandSegment/validation.d.ts +17 -0
  208. package/build/features/connect/screens/BrandSegment/validation.js +9 -0
  209. package/build/features/connect/screens/CivilID/CivilID.js +5 -13
  210. package/build/features/connect/screens/CivilID/IDNumber.js +5 -6
  211. package/build/features/connect/screens/Individual/Email.js +18 -28
  212. package/build/features/connect/screens/Individual/Individual.js +8 -1
  213. package/build/features/connect/screens/Individual/MobileNumber.js +16 -15
  214. package/build/features/connect/screens/Individual/Name.js +11 -15
  215. package/build/features/connect/screens/Merchant/BrandList.js +4 -22
  216. package/build/features/connect/screens/Merchant/BrandName.js +5 -8
  217. package/build/features/connect/screens/Merchant/Merchant.js +13 -15
  218. package/build/features/connect/screens/Merchant/SalesChannels.js +6 -6
  219. package/build/features/connect/screens/Merchant/validation.d.ts +3 -6
  220. package/build/features/connect/screens/Merchant/validation.js +14 -17
  221. package/build/features/connect/screens/Mobile/Mobile.js +13 -16
  222. package/build/features/connect/screens/Mobile/MobileNumber.js +14 -10
  223. package/build/features/connect/screens/NID/DOB.js +3 -3
  224. package/build/features/connect/screens/NID/IDNumber.js +6 -7
  225. package/build/features/connect/screens/NID/NID.js +6 -0
  226. package/build/features/connect/screens/OTP/OTP.js +13 -15
  227. package/build/features/connect/screens/OTP/OTPInput.js +10 -0
  228. package/build/features/connect/screens/ThankYou/ThankYou.js +17 -2
  229. package/build/features/connectExpress/ConnectExpress.d.ts +1 -0
  230. package/build/features/connectExpress/ConnectExpress.js +72 -12
  231. package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
  232. package/build/features/connectExpress/screens/CivilID/IDNumber.js +6 -7
  233. package/build/features/connectExpress/screens/CivilIDMissed/IDNumber.js +6 -7
  234. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
  235. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +6 -8
  236. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +7 -4
  237. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
  238. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +9 -14
  239. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +1 -1
  240. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +4 -4
  241. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +5 -4
  242. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +4 -2
  243. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +14 -1
  244. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +9 -10
  245. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +4 -4
  246. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +11 -6
  247. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
  248. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +7 -15
  249. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +1 -0
  250. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +6 -2
  251. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +2 -1
  252. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +3 -4
  253. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +2 -2
  254. package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -3
  255. package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +1 -0
  256. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -2
  257. package/build/features/connectExpress/screens/Mobile/TAC.d.ts +2 -1
  258. package/build/features/connectExpress/screens/Mobile/TAC.js +3 -1
  259. package/build/features/connectExpress/screens/NID/DOB.d.ts +2 -1
  260. package/build/features/connectExpress/screens/NID/DOB.js +3 -3
  261. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  262. package/build/features/connectExpress/screens/NID/IDNumber.js +3 -4
  263. package/build/features/connectExpress/screens/NID/NID.js +4 -2
  264. package/build/features/connectExpress/screens/NID/TAC.d.ts +14 -1
  265. package/build/features/connectExpress/screens/NID/TAC.js +9 -10
  266. package/build/features/connectExpress/screens/NIDMissed/DOB.js +2 -2
  267. package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +2 -3
  268. package/build/features/connectExpress/screens/OTP/OTPInput.js +3 -3
  269. package/build/features/entity/Entity.js +10 -6
  270. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +18 -70
  271. package/build/features/entity/screens/EntityCapital/ActivityList.js +221 -106
  272. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +3 -1
  273. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +14 -15
  274. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +3 -1
  275. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +10 -11
  276. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +3 -1
  277. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +15 -16
  278. package/build/features/entity/screens/EntityCapital/EntityCapital.js +31 -20
  279. package/build/features/entity/screens/EntityCapital/validation.d.ts +175 -40
  280. package/build/features/entity/screens/EntityCapital/validation.js +9 -12
  281. package/build/features/entity/screens/EntityName/Article.d.ts +6 -2
  282. package/build/features/entity/screens/EntityName/Article.js +20 -54
  283. package/build/features/entity/screens/EntityName/EntityName.js +60 -16
  284. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +14 -30
  285. package/build/features/entity/screens/EntityName/EntityTypeList.js +32 -43
  286. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +6 -4
  287. package/build/features/entity/screens/EntityName/ExpiryDate.js +5 -5
  288. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +6 -4
  289. package/build/features/entity/screens/EntityName/IssuingDate.js +4 -5
  290. package/build/features/entity/screens/EntityName/LegalName.d.ts +3 -1
  291. package/build/features/entity/screens/EntityName/LegalName.js +9 -6
  292. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
  293. package/build/features/entity/screens/EntityName/LicenseCertificate.js +13 -7
  294. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +3 -1
  295. package/build/features/entity/screens/EntityName/LicenseNumber.js +13 -11
  296. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +3 -1
  297. package/build/features/entity/screens/EntityName/UnifiedNumber.js +9 -7
  298. package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
  299. package/build/features/entity/screens/EntityName/validation.js +68 -93
  300. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  301. package/build/features/entity/screens/Verify/OTPInput.js +5 -3
  302. package/build/features/entity/screens/Verify/Verify.js +7 -20
  303. package/build/features/featuresScreens.js +13 -1
  304. package/build/features/individual/Individual.js +10 -6
  305. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +3 -3
  306. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -23
  307. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
  308. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +29 -10
  309. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +3 -1
  310. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +17 -12
  311. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
  312. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +30 -41
  313. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +3 -3
  314. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +94 -55
  315. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +5 -3
  316. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +17 -12
  317. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
  318. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +9 -2
  319. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
  320. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +13 -7
  321. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
  322. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +14 -8
  323. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
  324. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +32 -42
  325. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +8 -8
  326. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +8 -12
  327. package/build/features/individual/screens/IndividualList/CollectPhoneEmail.js +1 -1
  328. package/build/features/individual/screens/IndividualList/Email.js +1 -1
  329. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +6 -6
  330. package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
  331. package/build/features/individual/screens/IndividualList/UserList.js +15 -6
  332. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +2 -0
  333. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +14 -20
  334. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +2 -0
  335. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +8 -14
  336. package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +3 -1
  337. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +4 -4
  338. package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +3 -1
  339. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +3 -10
  340. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +3 -1
  341. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +5 -7
  342. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +6 -4
  343. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +5 -2
  344. package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +3 -1
  345. package/build/features/individual/screens/IndividualPersonalInfo/ID.js +3 -10
  346. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +3 -3
  347. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +79 -36
  348. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +2 -0
  349. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +10 -21
  350. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +2 -0
  351. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +14 -16
  352. package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +3 -1
  353. package/build/features/individual/screens/IndividualPersonalInfo/Name.js +3 -10
  354. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +2 -0
  355. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +10 -21
  356. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
  357. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
  358. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +6 -3
  359. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  360. package/build/features/individual/screens/Verify/OTPInput.js +5 -3
  361. package/build/features/individual/screens/Verify/Verify.js +1 -5
  362. package/build/features/password/Password.js +7 -5
  363. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
  364. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  365. package/build/features/password/screens/Verify/OTPInput.js +5 -3
  366. package/build/features/password/screens/Verify/Verify.js +7 -20
  367. package/build/features/shared/Address/CountryList.d.ts +10 -10
  368. package/build/features/shared/Address/CountryList.js +1 -1
  369. package/build/features/shared/Address/InputSelect.d.ts +10 -10
  370. package/build/features/shared/Address/InputSelect.js +2 -2
  371. package/build/features/shared/Button/Button.d.ts +3 -1
  372. package/build/features/shared/Button/Button.js +2 -2
  373. package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
  374. package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
  375. package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
  376. package/build/features/shared/Button/FlowsButtons.js +23 -21
  377. package/build/features/shared/Button/IndividualActionButtons.d.ts +21 -0
  378. package/build/features/shared/Button/IndividualActionButtons.js +156 -0
  379. package/build/features/shared/Button/index.d.ts +1 -1
  380. package/build/features/shared/Button/index.js +1 -1
  381. package/build/features/shared/Calender/Calender.d.ts +13 -0
  382. package/build/features/shared/Calender/Calender.js +56 -0
  383. package/build/features/shared/Calender/index.d.ts +2 -0
  384. package/build/features/shared/Calender/index.js +2 -0
  385. package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
  386. package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
  387. package/build/features/shared/Chip/Chip.d.ts +3 -0
  388. package/build/features/shared/Chip/Chip.js +21 -0
  389. package/build/features/shared/Chip/index.d.ts +2 -0
  390. package/build/features/shared/Chip/index.js +2 -0
  391. package/build/features/shared/Containers/FeatureContainer.d.ts +4 -1
  392. package/build/features/shared/Containers/FeatureContainer.js +5 -4
  393. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  394. package/build/features/shared/Dot/Dot.d.ts +8 -0
  395. package/build/features/shared/Dot/Dot.js +29 -0
  396. package/build/features/shared/Dot/index.d.ts +2 -0
  397. package/build/features/shared/Dot/index.js +2 -0
  398. package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
  399. package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
  400. package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
  401. package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
  402. package/build/features/shared/EndAdornment/index.d.ts +3 -0
  403. package/build/features/shared/EndAdornment/index.js +3 -0
  404. package/build/features/shared/Footer/Footer.js +8 -0
  405. package/build/features/shared/Footer/PoweredByFooter.d.ts +9 -0
  406. package/build/features/shared/Footer/PoweredByFooter.js +36 -0
  407. package/build/features/shared/Footer/index.d.ts +3 -2
  408. package/build/features/shared/Footer/index.js +3 -2
  409. package/build/features/shared/GenericError/GenericError.js +1 -1
  410. package/build/features/shared/Input/Input.d.ts +6 -7
  411. package/build/features/shared/Input/Input.js +2 -3
  412. package/build/features/shared/Input/index.d.ts +2 -1
  413. package/build/features/shared/InputSelect/InputSelect.d.ts +4 -0
  414. package/build/features/shared/InputSelect/InputSelect.js +33 -0
  415. package/build/features/shared/InputSelect/index.d.ts +2 -0
  416. package/build/features/shared/InputSelect/index.js +2 -0
  417. package/build/features/shared/OTP/OTP.d.ts +2 -1
  418. package/build/features/shared/OTP/OTP.js +2 -2
  419. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +3 -1
  420. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +8 -6
  421. package/build/features/shared/SalesChannels/SalesChannel.d.ts +3 -1
  422. package/build/features/shared/SalesChannels/SalesChannel.js +9 -4
  423. package/build/features/shared/Search/Search.d.ts +2 -1
  424. package/build/features/shared/Search/Search.js +2 -2
  425. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +18 -7
  426. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  427. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  428. package/build/features/shared/UploadFile/FileUpload.d.ts +32 -0
  429. package/build/features/shared/UploadFile/FileUpload.js +267 -0
  430. package/build/features/shared/UploadFile/UploadFile.d.ts +2 -2
  431. package/build/features/shared/UploadFile/UploadFile.js +7 -7
  432. package/build/features/shared/UploadFile/UploadWrapper.d.ts +36 -0
  433. package/build/features/shared/UploadFile/UploadWrapper.js +115 -0
  434. package/build/features/shared/UploadFile/index.d.ts +2 -1
  435. package/build/features/shared/UploadFile/index.js +2 -1
  436. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +10 -29
  437. package/build/features/shared/UploadMultipleFile/UploadFile.js +76 -60
  438. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +8 -4
  439. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +11 -17
  440. package/build/features/signIn/SignIn.js +3 -4
  441. package/build/features/tax/Tax.js +10 -6
  442. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  443. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
  444. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +12 -12
  445. package/build/features/tax/screens/TaxDetails/TaxDetails.js +23 -10
  446. package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
  447. package/build/features/tax/screens/TaxDetails/TaxDocument.js +7 -5
  448. package/build/features/tax/screens/TaxDetails/VATId.d.ts +5 -1
  449. package/build/features/tax/screens/TaxDetails/VATId.js +6 -10
  450. package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
  451. package/build/features/tax/screens/TaxDetails/validation.js +2 -5
  452. package/build/features/tax/screens/Verify/OTPInput.js +5 -3
  453. package/build/features/tax/screens/Verify/Verify.js +6 -22
  454. package/build/hooks/index.d.ts +5 -0
  455. package/build/hooks/index.js +5 -0
  456. package/build/hooks/useAppConfig.d.ts +4 -2
  457. package/build/hooks/useAppConfig.js +17 -5
  458. package/build/hooks/useDataNoneEditable.d.ts +2 -0
  459. package/build/hooks/useDataNoneEditable.js +19 -0
  460. package/build/hooks/useDataVerified.d.ts +6 -0
  461. package/build/hooks/useDataVerified.js +19 -0
  462. package/build/hooks/useErrorListener.d.ts +2 -1
  463. package/build/hooks/useErrorListener.js +16 -1
  464. package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
  465. package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
  466. package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
  467. package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
  468. package/build/hooks/useFormReadOnly.d.ts +6 -0
  469. package/build/hooks/useFormReadOnly.js +40 -0
  470. package/build/hooks/useVerifyToken.js +1 -1
  471. package/build/theme/shadows.js +1 -1
  472. package/build/utils/array.d.ts +14 -2
  473. package/build/utils/array.js +196 -4
  474. package/build/utils/date.d.ts +1 -0
  475. package/build/utils/date.js +6 -0
  476. package/build/utils/error.d.ts +1 -0
  477. package/build/utils/error.js +3 -0
  478. package/build/utils/gtm.d.ts +6 -0
  479. package/build/utils/gtm.js +29 -0
  480. package/build/utils/index.d.ts +1 -0
  481. package/build/utils/index.js +1 -0
  482. package/build/utils/object.d.ts +4 -0
  483. package/build/utils/object.js +17 -0
  484. package/build/utils/string.d.ts +5 -2
  485. package/build/utils/string.js +28 -7
  486. package/package.json +4 -2
  487. package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
  488. package/build/features/brand/screens/BrandInfo/Segments.d.ts +0 -8
  489. package/build/features/connect/screens/Merchant/Segments.d.ts +0 -8
  490. package/build/features/shared/Button/ListButton.d.ts +0 -18
  491. package/build/features/shared/Button/ListButton.js +0 -125
  492. /package/build/features/{brand/screens/BrandInfo → connect/screens/BrandSegment}/TeamSize.d.ts +0 -0
@@ -24,7 +24,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
24
24
  function verb(n) { return function (v) { return step([n, v]); }; }
25
25
  function step(op) {
26
26
  if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
28
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
29
  if (y = 0, t) op = [op[0] & 2, t.value];
30
30
  switch (op[0]) {
@@ -68,17 +68,17 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
68
68
  var _a;
69
69
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
70
70
  import API from '../../../api';
71
- import { FlowsTypes, IndividualGender, IndividualType } from '../../../@types';
72
- import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
71
+ import { FlowsTypes, IndividualGender, DocumentPurpose } from '../../../@types';
72
+ import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
73
73
  import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
74
- import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, getEighteenYearsAgo, getUserNameObject, getUserName, sleep, isValidEmail } from '../../../utils';
74
+ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType } from '../../../utils';
75
75
  export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
77
77
  return __awaiter(void 0, void 0, void 0, function () {
78
- var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type, payload_1, info, hasIndividualCompleted, birthCountry;
79
- var _c, _d, _e, _f, _g, _h, _j, _k;
80
- return __generator(this, function (_l) {
81
- switch (_l.label) {
78
+ var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, publicKey, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry, individuals, _c, is_authorized, data_state;
79
+ var _d, _e, _f, _g, _h, _j, _k, _l;
80
+ return __generator(this, function (_m) {
81
+ switch (_m.label) {
82
82
  case 0:
83
83
  payload = {
84
84
  service_name: 'tap_email',
@@ -87,10 +87,10 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
87
87
  settings = thunkApi.getState().settings;
88
88
  return [4, API.leadService.verifyLeadToken(payload)];
89
89
  case 1:
90
- data = (_l.sent()).data;
90
+ data = (_m.sent()).data;
91
91
  boardInfoStatus = undefined;
92
92
  countries = settings.data.countries;
93
- if (((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
93
+ if (((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
94
94
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
95
95
  if (isInternally)
96
96
  data.step_name = INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO;
@@ -98,89 +98,90 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
98
98
  countryCode = data === null || data === void 0 ? void 0 : data.country_code;
99
99
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
100
100
  }
101
+ publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
102
+ if (publicKey) {
103
+ thunkApi.dispatch(handlePublicKey(publicKey));
104
+ }
101
105
  if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
102
106
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
103
- return [3, 17];
107
+ return [3, 16];
104
108
  case 2:
105
- if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 16];
109
+ if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 15];
106
110
  board_id = data === null || data === void 0 ? void 0 : data.id;
107
111
  board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
108
112
  if (!(board_id && board_info_id)) return [3, 5];
109
113
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
110
114
  case 3:
111
- boardInfoData = _l.sent();
115
+ boardInfoData = _m.sent();
112
116
  notification = (boardInfoData || {}).notification;
113
117
  _b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
114
118
  if (!(id && type)) return [3, 5];
115
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
119
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
116
120
  case 4:
117
- payload_1 = (_l.sent()).payload;
118
- individualData = payload_1.data || {};
119
- _l.label = 5;
121
+ data_1 = (_m.sent()).data;
122
+ individualData = data_1 || {};
123
+ _m.label = 5;
120
124
  case 5:
121
- if (!board_id) return [3, 8];
125
+ if (!board_id) return [3, 7];
122
126
  return [4, API.boardService.retrieveBoardDetails(board_id)];
123
127
  case 6:
124
- boardData = _l.sent();
125
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
128
+ boardData = _m.sent();
129
+ _m.label = 7;
126
130
  case 7:
127
- boardInfoStatus = _l.sent();
128
- _l.label = 8;
129
- case 8:
130
131
  if (!countryCode) {
131
- countryCode = (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.country;
132
+ countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
132
133
  if (countryCode)
133
134
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
134
135
  }
135
- info = (boardInfoStatus || {}).info;
136
- hasIndividualCompleted = ((_e = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _e === void 0 ? void 0 : _e.status) === 'completed';
137
- if (!hasIndividualCompleted) return [3, 9];
138
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
139
- return [3, 15];
140
- case 9:
141
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 12];
142
- if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 11];
143
- return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
136
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
137
+ if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 9];
138
+ return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id))];
139
+ case 8:
140
+ _m.sent();
141
+ _m.label = 9;
142
+ case 9: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
144
143
  case 10:
145
- _l.sent();
146
- _l.label = 11;
147
- case 11:
144
+ boardInfoStatus = _m.sent();
148
145
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
149
- return [3, 15];
150
- case 12:
151
- birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
152
- if (!birthCountry) return [3, 14];
146
+ return [3, 14];
147
+ case 11:
148
+ birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
149
+ if (!birthCountry) return [3, 13];
153
150
  return [4, thunkApi.dispatch(getCityList(birthCountry))];
151
+ case 12:
152
+ _m.sent();
153
+ _m.label = 13;
154
154
  case 13:
155
- _l.sent();
156
- _l.label = 14;
157
- case 14:
158
155
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
159
- _l.label = 15;
160
- case 15: return [3, 17];
161
- case 16:
156
+ _m.label = 14;
157
+ case 14: return [3, 16];
158
+ case 15:
162
159
  if (isUpdatePhoneInfo) {
163
160
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
164
161
  }
165
- _l.label = 17;
166
- case 17: return [2, {
167
- data: data,
168
- boardResponse: {
169
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
170
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
171
- entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
172
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
173
- merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
174
- name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
175
- contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
176
- individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
177
- countries: countries,
178
- countryCode: countryCode,
179
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
180
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
181
- },
182
- token: token
183
- }];
162
+ _m.label = 16;
163
+ case 16:
164
+ individuals = (boardData || {}).individuals;
165
+ _c = individualData || {}, is_authorized = _c.is_authorized, data_state = _c.data_state;
166
+ return [2, {
167
+ data: data,
168
+ boardResponse: {
169
+ brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
170
+ bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
171
+ entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
172
+ merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
173
+ merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
174
+ name: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.names,
175
+ contact: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.contact,
176
+ individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
177
+ countries: countries,
178
+ countryCode: countryCode,
179
+ notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
180
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
181
+ flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
182
+ },
183
+ token: token
184
+ }];
184
185
  }
185
186
  });
186
187
  });
@@ -190,7 +191,12 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
190
191
  return __awaiter(void 0, void 0, void 0, function () {
191
192
  return __generator(this, function (_b) {
192
193
  switch (_b.label) {
193
- case 0: return [4, thunkApi.dispatch(verifyToken({ token: token, isInternally: isInternally }))];
194
+ case 0: return [4, thunkApi
195
+ .dispatch(verifyToken({ token: token, isInternally: isInternally }))
196
+ .unwrap()
197
+ .catch(function (err) {
198
+ throw new Error(err.message);
199
+ })];
194
200
  case 1:
195
201
  _b.sent();
196
202
  return [2];
@@ -216,29 +222,27 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
216
222
  });
217
223
  }); });
218
224
  export var addDetailsAsync = createAsyncThunk('individual/addDetailsAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
219
- var settings, user, userList, id, type, birth, countryCode;
225
+ var settings, user, userList, birth, individual_id, countryCode;
220
226
  return __generator(this, function (_a) {
221
227
  switch (_a.label) {
222
228
  case 0:
223
229
  settings = thunkApi.getState().settings;
224
230
  user = params.user, userList = params.userList;
225
- id = user.id, type = user.type, birth = user.birth;
231
+ birth = user.birth, individual_id = user.individual_id;
226
232
  countryCode = (birth === null || birth === void 0 ? void 0 : birth.country) || settings.data.businessCountry.iso2;
227
233
  if (!countryCode) return [3, 2];
228
234
  return [4, thunkApi.dispatch(getCityList(countryCode))];
229
235
  case 1:
230
236
  _a.sent();
231
237
  _a.label = 2;
232
- case 2: return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type }))];
233
- case 3:
234
- _a.sent();
238
+ case 2:
235
239
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
236
- return [2, { userList: userList }];
240
+ return [2, { userList: userList, individualId: individual_id, countryCode: settings.data.businessCountry.iso2, countries: settings.data.countries }];
237
241
  }
238
242
  });
239
243
  }); });
240
244
  export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsByEmail', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
241
- var individual, _a, merchant_id, board_id, user, collectInfo, id, type, _b, resEmail, resPhone, isPhoneAndEmailAvailable, email, mobile, countryCode, hasContact, individualData, hasPhone, requestBody, data_1, payload, data;
245
+ var individual, _a, merchant_id, board_id, user, collectInfo, id, objects, ids, _b, resEmail, resPhone, isPhoneAndEmailAvailable, email, mobile, countryCode, hasContact, individualData, hasPhone, requestBody, data_2, user_1, payload, data;
242
246
  var _c;
243
247
  return __generator(this, function (_d) {
244
248
  switch (_d.label) {
@@ -246,7 +250,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
246
250
  individual = thunkApi.getState().individual;
247
251
  _a = individual.data.verify.responseBody || {}, merchant_id = _a.merchant_id, board_id = _a.board_id;
248
252
  user = params.user, collectInfo = params.collectInfo;
249
- id = user.id, type = user.type;
253
+ id = user.id, objects = user.objects, ids = user.ids;
250
254
  _b = (user === null || user === void 0 ? void 0 : user.contact) || {}, resEmail = _b.email, resPhone = _b.phone;
251
255
  isPhoneAndEmailAvailable = isValidEmail(resEmail) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.country_code) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.number);
252
256
  email = collectInfo.email, mobile = collectInfo.mobile, countryCode = collectInfo.countryCode;
@@ -255,8 +259,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
255
259
  if (!(!isPhoneAndEmailAvailable && hasContact)) return [3, 2];
256
260
  hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
257
261
  requestBody = {
258
- id: id,
259
- type: type,
262
+ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id],
260
263
  contact: {
261
264
  email: email,
262
265
  phone: hasPhone
@@ -267,18 +270,11 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
267
270
  : undefined
268
271
  }
269
272
  };
270
- return [4, API.individualService.updateIndividual(requestBody)];
273
+ return [4, API.individualService.updateMultipleIndividual(requestBody)];
271
274
  case 1:
272
- data_1 = _d.sent();
273
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.user;
274
- if (type === IndividualType.SHARE_HOLDER)
275
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.shareholder;
276
- else if (type === IndividualType.BOARD_MEMBER)
277
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.board_member;
278
- else if (type === IndividualType.BUYER)
279
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.buyer;
280
- else if (type === IndividualType.CUSTOMER)
281
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.customer;
275
+ data_2 = _d.sent();
276
+ user_1 = (sortUserList(mapUserList(data_2 === null || data_2 === void 0 ? void 0 : data_2.individuals)) || [])[0];
277
+ individualData = user_1;
282
278
  _d.label = 2;
283
279
  case 2:
284
280
  payload = {
@@ -292,7 +288,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
292
288
  notification: {
293
289
  recipient: {
294
290
  id: id,
295
- type: type
291
+ type: (objects === null || objects === void 0 ? void 0 : objects[0]) || ''
296
292
  },
297
293
  channel: ['email']
298
294
  }
@@ -300,14 +296,14 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
300
296
  return [4, API.boardService.requestDetailsByEmail(payload)];
301
297
  case 3:
302
298
  data = _d.sent();
303
- return [2, { data: data, userData: __assign(__assign({}, individualData), { type: type }) }];
299
+ return [2, { data: data, individualData: individualData }];
304
300
  }
305
301
  });
306
302
  }); });
307
303
  export var getIndividualList = createAsyncThunk('individual/getIndividualList', function (businessId) { return __awaiter(void 0, void 0, void 0, function () {
308
- var payload, _a, users, shareholders, board_members, userList, shareHolderList, boardMemberList, individualList;
309
- return __generator(this, function (_b) {
310
- switch (_b.label) {
304
+ var payload, individuals, list;
305
+ return __generator(this, function (_a) {
306
+ switch (_a.label) {
311
307
  case 0:
312
308
  payload = {
313
309
  page: 1,
@@ -316,12 +312,9 @@ export var getIndividualList = createAsyncThunk('individual/getIndividualList',
316
312
  };
317
313
  return [4, API.individualService.getIndividualList(payload)];
318
314
  case 1:
319
- _a = _b.sent(), users = _a.users, shareholders = _a.shareholders, board_members = _a.board_members;
320
- userList = (users || []).map(function (user) { return (__assign(__assign({}, user), { type: IndividualType.USER })); });
321
- shareHolderList = (shareholders || []).map(function (shareholder) { return (__assign(__assign({}, shareholder), { type: IndividualType.SHARE_HOLDER })); });
322
- boardMemberList = (board_members || []).map(function (board_member) { return (__assign(__assign({}, board_member), { type: IndividualType.BOARD_MEMBER })); });
323
- individualList = __spreadArray(__spreadArray(__spreadArray([], userList, true), shareHolderList, true), boardMemberList, true);
324
- return [2, individualList];
315
+ individuals = (_a.sent()).individuals;
316
+ list = sortUserList(mapUserList(individuals)) || [];
317
+ return [2, __spreadArray([], list, true)];
325
318
  }
326
319
  });
327
320
  }); });
@@ -341,30 +334,35 @@ export var getCityList = createAsyncThunk('individual/getCityList', function (co
341
334
  });
342
335
  }); });
343
336
  export var retrieveIndividualInfo = createAsyncThunk('individual/retrieveIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
344
- var id, type, countryCode, settings, data, individualData;
345
- return __generator(this, function (_a) {
346
- switch (_a.label) {
337
+ var id, type, countryCode, settings, data, _a, isShareholder, isBoardMember, isBuyer, isCustomer, individualData;
338
+ return __generator(this, function (_b) {
339
+ switch (_b.label) {
347
340
  case 0:
348
341
  id = params.id, type = params.type, countryCode = params.countryCode;
349
342
  settings = thunkApi.getState().settings;
350
343
  return [4, API.individualService.retrieveIndividual(id, type)];
351
344
  case 1:
352
- data = _a.sent();
345
+ data = _b.sent();
346
+ _a = getIndividualType([type]), isShareholder = _a.isShareholder, isBoardMember = _a.isBoardMember, isBuyer = _a.isBuyer, isCustomer = _a.isCustomer;
353
347
  individualData = data === null || data === void 0 ? void 0 : data.user;
354
- if (type === IndividualType.SHARE_HOLDER)
348
+ if (isShareholder)
355
349
  individualData = data === null || data === void 0 ? void 0 : data.shareholder;
356
- else if (type === IndividualType.BOARD_MEMBER)
350
+ else if (isBoardMember)
357
351
  individualData = data === null || data === void 0 ? void 0 : data.board_member;
358
- else if (type === IndividualType.BUYER)
352
+ else if (isBuyer)
359
353
  individualData = data === null || data === void 0 ? void 0 : data.buyer;
360
- else if (type === IndividualType.CUSTOMER)
354
+ else if (isCustomer)
361
355
  individualData = data === null || data === void 0 ? void 0 : data.customer;
362
- return [2, { data: __assign(__assign({}, (individualData || {})), { type: type }), countryCode: countryCode, countries: settings.data.countries }];
356
+ return [2, {
357
+ data: __assign(__assign({}, (individualData || {})), { objects: [type], individual_data_state: individualData === null || individualData === void 0 ? void 0 : individualData.data_state, object: type }),
358
+ countryCode: countryCode,
359
+ countries: settings.data.countries
360
+ }];
363
361
  }
364
362
  });
365
363
  }); });
366
364
  export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', function (countryCode) { return __awaiter(void 0, void 0, void 0, function () {
367
- var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupation;
365
+ var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupationData, occupation, mappedOccupation;
368
366
  return __generator(this, function (_b) {
369
367
  switch (_b.label) {
370
368
  case 0:
@@ -381,15 +379,35 @@ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', fun
381
379
  API.dataService.getOccupation(dataBody)
382
380
  ])];
383
381
  case 1:
384
- _a = _b.sent(), sourceIncome = _a[0], monthlyIncome = _a[1], occupation = _a[2];
382
+ _a = _b.sent(), sourceIncome = _a[0], monthlyIncome = _a[1], occupationData = _a[2];
383
+ occupation = (occupationData === null || occupationData === void 0 ? void 0 : occupationData.occupation) || {};
384
+ mappedOccupation = (occupation.section || []).map(function (section) {
385
+ var sub = (occupation.chapter || []).filter(function (chapter) { return chapter.section_code === section.code; });
386
+ return __assign(__assign({}, section), { sub: sub });
387
+ });
385
388
  return [2, {
386
389
  sourceIncome: sourceIncome,
387
390
  monthlyIncome: monthlyIncome,
388
- occupation: occupation
391
+ occupation: { list: mappedOccupation || [] }
389
392
  }];
390
393
  }
391
394
  });
392
395
  }); });
396
+ export var retrieveBoardStatus = createAsyncThunk('individual/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
397
+ var individual, board_id, data;
398
+ return __generator(this, function (_a) {
399
+ switch (_a.label) {
400
+ case 0:
401
+ individual = thunkApi.getState().individual;
402
+ board_id = (individual.data.verify.responseBody || {}).board_id;
403
+ return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
404
+ case 1:
405
+ data = _a.sent();
406
+ thunkApi.dispatch(handlePrevScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
407
+ return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
408
+ }
409
+ });
410
+ }); });
393
411
  export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
394
412
  var _a, user, data;
395
413
  var _b, _c;
@@ -405,10 +423,10 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
405
423
  });
406
424
  }); });
407
425
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
408
- var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type, payload_2, info, hasIndividualCompleted, birthCountry;
409
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
410
- return __generator(this, function (_q) {
411
- switch (_q.label) {
426
+ var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, publicKey, countryCode, notification, _c, id, type, data_3, birthCountry, individuals, _d, is_authorized, data_state;
427
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
428
+ return __generator(this, function (_r) {
429
+ switch (_r.label) {
412
430
  case 0:
413
431
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
414
432
  responseBody = individual.data.verify.responseBody;
@@ -416,69 +434,68 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
416
434
  countries = settings.data.countries;
417
435
  payload = {
418
436
  data: params.otp,
419
- service_name: (_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name,
437
+ service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
420
438
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
421
439
  step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
422
440
  encryption_contract: ['data']
423
441
  };
424
442
  return [4, API.leadService.verifyLeadOTP(payload)];
425
443
  case 1:
426
- data = (_q.sent()).data;
444
+ data = (_r.sent()).data;
427
445
  boardInfoStatus = undefined;
428
- if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
446
+ if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
429
447
  throw new Error(data.errors[0].description);
430
- if (!board_id) return [3, 4];
448
+ publicKey = (_g = data === null || data === void 0 ? void 0 : data.config) === null || _g === void 0 ? void 0 : _g.public_key;
449
+ if (publicKey) {
450
+ thunkApi.dispatch(handlePublicKey(publicKey));
451
+ }
452
+ if (!board_id) return [3, 3];
431
453
  return [4, API.boardService.retrieveBoardDetails(board_id)];
432
454
  case 2:
433
- boardData = _q.sent();
434
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
455
+ boardData = _r.sent();
456
+ _r.label = 3;
435
457
  case 3:
436
- boardInfoStatus = _q.sent();
437
- _q.label = 4;
438
- case 4:
439
- countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
440
- if (!(board_id && board_info_id)) return [3, 7];
458
+ countryCode = (_h = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _h === void 0 ? void 0 : _h.country;
459
+ if (!(board_id && board_info_id)) return [3, 6];
441
460
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
442
- case 5:
443
- boardInfoData = _q.sent();
461
+ case 4:
462
+ boardInfoData = _r.sent();
444
463
  notification = (boardInfoData || {}).notification;
445
464
  _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
446
- if (!(id && type)) return [3, 7];
447
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
465
+ if (!(id && type)) return [3, 6];
466
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
467
+ case 5:
468
+ data_3 = (_r.sent()).data;
469
+ individualData = data_3 || {};
470
+ _r.label = 6;
448
471
  case 6:
449
- payload_2 = (_q.sent()).payload;
450
- individualData = payload_2.data || {};
451
- _q.label = 7;
452
- case 7:
453
472
  if (countryCode)
454
473
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
455
- info = (boardInfoStatus || {}).info;
456
- hasIndividualCompleted = ((_g = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _g === void 0 ? void 0 : _g.status) === 'completed';
457
- if (!hasIndividualCompleted) return [3, 8];
458
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
459
- return [3, 14];
460
- case 8:
461
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
462
- if (!((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)) return [3, 10];
463
- return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
474
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
475
+ if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 8];
476
+ return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id))];
477
+ case 7:
478
+ _r.sent();
479
+ _r.label = 8;
480
+ case 8: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
464
481
  case 9:
465
- _q.sent();
466
- _q.label = 10;
467
- case 10:
482
+ boardInfoStatus = _r.sent();
468
483
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
469
- return [3, 14];
470
- case 11:
471
- birthCountry = ((_k = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _k === void 0 ? void 0 : _k.country) || countryCode;
472
- if (!birthCountry) return [3, 13];
484
+ return [3, 13];
485
+ case 10:
486
+ birthCountry = ((_l = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _l === void 0 ? void 0 : _l.country) || countryCode;
487
+ if (!birthCountry) return [3, 12];
473
488
  return [4, thunkApi.dispatch(getCityList(birthCountry))];
489
+ case 11:
490
+ _r.sent();
491
+ _r.label = 12;
474
492
  case 12:
475
- _q.sent();
476
- _q.label = 13;
493
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
494
+ _r.label = 13;
477
495
  case 13:
478
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
479
- _q.label = 14;
480
- case 14:
481
- (_m = (_l = settings.data.appConfig).onStepCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, settings.data.activeScreen.name, { otp: params.otp });
496
+ (_o = (_m = settings.data.appConfig).onStepCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, settings.data.activeScreen.name, { otp: params.otp });
497
+ individuals = (boardData || {}).individuals;
498
+ _d = individualData || {}, is_authorized = _d.is_authorized, data_state = _d.data_state;
482
499
  return [2, {
483
500
  data: data,
484
501
  boardResponse: {
@@ -487,12 +504,13 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
487
504
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
488
505
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
489
506
  merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
490
- name: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.names,
491
- contact: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.contact,
492
- individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
507
+ name: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.names,
508
+ contact: (_q = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _q === void 0 ? void 0 : _q.contact,
509
+ individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
493
510
  countries: countries,
494
511
  countryCode: countryCode,
495
512
  notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
513
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
496
514
  flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
497
515
  },
498
516
  formData: __assign({}, params)
@@ -500,213 +518,245 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
500
518
  }
501
519
  });
502
520
  }); });
503
- export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
504
- var individual, _a, token, responseBody, _b, id, type, mobile, countryCode, requestBody, data;
505
- var _c;
506
- return __generator(this, function (_d) {
507
- switch (_d.label) {
508
- case 0:
509
- individual = thunkApi.getState().individual;
510
- _a = individual.data.verify, token = _a.token, responseBody = _a.responseBody;
511
- _b = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.source) || {}, id = _b.id, type = _b.type;
512
- mobile = params.mobile, countryCode = params.countryCode;
513
- requestBody = {
514
- id: id,
515
- type: type,
516
- contact: {
517
- phone: {
518
- country_code: (_c = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _c === void 0 ? void 0 : _c.toString(),
519
- number: mobile || ''
521
+ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', function (_a, thunkApi) {
522
+ var formData = _a.formData, originalFormData = _a.originalFormData;
523
+ return __awaiter(void 0, void 0, void 0, function () {
524
+ var individual, _b, token, responseBody, id, mobile, countryCode, requestBody, data;
525
+ var _c;
526
+ return __generator(this, function (_d) {
527
+ switch (_d.label) {
528
+ case 0:
529
+ individual = thunkApi.getState().individual;
530
+ _b = individual.data.verify, token = _b.token, responseBody = _b.responseBody;
531
+ id = ((responseBody === null || responseBody === void 0 ? void 0 : responseBody.source) || {}).id;
532
+ mobile = formData.mobile, countryCode = formData.countryCode;
533
+ requestBody = {
534
+ ids: [id],
535
+ contact: {
536
+ phone: {
537
+ country_code: (_c = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _c === void 0 ? void 0 : _c.toString(),
538
+ number: mobile || ''
539
+ }
520
540
  }
521
- }
522
- };
523
- return [4, API.individualService.updateIndividual(requestBody)];
524
- case 1:
525
- data = _d.sent();
526
- return [4, thunkApi.dispatch(verifyToken({ token: token, isUpdatePhoneInfo: true }))];
527
- case 2:
528
- _d.sent();
529
- return [2, { data: data, formData: params }];
530
- }
541
+ };
542
+ return [4, API.individualService.updateMultipleIndividual(requestBody)];
543
+ case 1:
544
+ data = _d.sent();
545
+ return [4, thunkApi.dispatch(verifyToken({ token: token, isUpdatePhoneInfo: true }))];
546
+ case 2:
547
+ _d.sent();
548
+ return [2, { data: data, formData: originalFormData }];
549
+ }
550
+ });
531
551
  });
532
- }); });
533
- export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
534
- var _a, settings, individual, _b, notification, user, entity, _c, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isNameEditable, isEmailEditable, isMobileNumberEditable, isMobileCountryEditable, isNidEditable, isIssuedCountryEditable, isExpiryEditable, isIdTypeEditable, isNationalityEditable, hasContact, hasPhone, hasIdentification, hasBirth, names, contact, requestBody, data;
535
- var _d, _e, _f, _g;
536
- return __generator(this, function (_h) {
537
- switch (_h.label) {
538
- case 0:
539
- _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
540
- _b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user, entity = _b.entity;
541
- _c = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
542
- name = params.name, email = params.email, mobile = params.mobile, countryCode = params.countryCode, gender = params.gender, nid = params.nid, issuedCountry = params.issuedCountry, expiryDate = params.expiryDate, dob = params.dob, placeOfBirthCountry = params.placeOfBirthCountry, placeOfBirthCity = params.placeOfBirthCity, nationality = params.nationality;
543
- code = entity === null || entity === void 0 ? void 0 : entity.country;
544
- data_status = (user || {}).data_status;
545
- userName = getUserNameObject(name);
546
- identification_id_type = nid && (nid === null || nid === void 0 ? void 0 : nid.startsWith('1')) ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
547
- isNameEditable = true;
548
- isEmailEditable = true;
549
- isMobileNumberEditable = true;
550
- isMobileCountryEditable = true;
551
- isNidEditable = true;
552
- isIssuedCountryEditable = true;
553
- isExpiryEditable = true;
554
- isIdTypeEditable = true;
555
- isNationalityEditable = true;
556
- hasContact = email || mobile || countryCode;
557
- hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
558
- hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
559
- hasBirth = placeOfBirthCity || placeOfBirthCountry;
560
- names = isNameEditable
561
- ? {
562
- en: userName,
563
- ar: userName
564
- }
565
- : undefined;
566
- contact = hasContact
567
- ? {
568
- email: isEmailEditable ? email : undefined,
569
- phone: hasPhone
552
+ });
553
+ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
554
+ var formData = _a.formData, originalFormData = _a.originalFormData;
555
+ return __awaiter(void 0, void 0, void 0, function () {
556
+ var _b, settings, individual, _c, notification, user, entity, id, _d, objects, ids, countryCode, name, email, mobile, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, data, _e, isUser, isBuyer, isUserORBuyerType;
557
+ var _f, _g, _h, _j, _k;
558
+ return __generator(this, function (_l) {
559
+ switch (_l.label) {
560
+ case 0:
561
+ _b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
562
+ _c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, entity = _c.entity;
563
+ id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
564
+ _d = user || {}, objects = _d.objects, ids = _d.ids;
565
+ countryCode = (originalFormData || {}).countryCode;
566
+ name = formData.name, email = formData.email, mobile = formData.mobile, gender = formData.gender, nid = formData.nid, issuedCountry = formData.issuedCountry, expiryDate = formData.expiryDate, dob = formData.dob, placeOfBirthCountry = formData.placeOfBirthCountry, placeOfBirthCity = formData.placeOfBirthCity, nationality = formData.nationality;
567
+ code = entity === null || entity === void 0 ? void 0 : entity.country;
568
+ data_status = (user || {}).data_status;
569
+ userName = getUserNameObject(name);
570
+ identification_id_type = nid ? (nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA) : undefined;
571
+ isGenderNonEditable = hasNoneEditableValue(data_status, 'gender');
572
+ isNameENNonEditable = hasNoneEditableValue(data_status, 'name.en');
573
+ isNameARNonEditable = hasNoneEditableValue(data_status, 'name.ar');
574
+ isEmailNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.contact, 'email');
575
+ isMobileNumberNonEditable = hasNoneEditableValue((_f = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _f === void 0 ? void 0 : _f.phone, 'number');
576
+ isMobileCountryNonEditable = hasNoneEditableValue((_g = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _g === void 0 ? void 0 : _g.phone, 'country_code');
577
+ isNidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'id');
578
+ isIssuedCountryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'issuer_country');
579
+ isExpiryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'expiry');
580
+ isIdTypeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'type');
581
+ isNationalityNonEditable = hasNoneEditableValue(data_status, 'nationality');
582
+ isDOBNonEditable = hasNoneEditableValue(data_status, 'birth.date');
583
+ isBirthCityNonEditable = hasNoneEditableValue(data_status, 'birth.city');
584
+ isBirthCountryNonEditable = hasNoneEditableValue(data_status, 'birth.country');
585
+ hasContact = email || mobile;
586
+ hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
587
+ hasIdentification = nid && (issuedCountry || identification_id_type || expiryDate);
588
+ hasBirth = placeOfBirthCity || placeOfBirthCountry;
589
+ nameIsEditable = userName.first && !(isNameENNonEditable && isNameARNonEditable);
590
+ contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
591
+ ? __assign({ email: isEmailNonEditable ? undefined : email }, (!(isMobileCountryNonEditable && isMobileNumberNonEditable) &&
592
+ hasPhone && {
593
+ phone: {
594
+ country_code: isMobileCountryNonEditable ? undefined : (_h = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _h === void 0 ? void 0 : _h.toString(),
595
+ number: isMobileNumberNonEditable || !mobile ? undefined : mobile
596
+ }
597
+ })) : undefined;
598
+ requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id], gender: isGenderNonEditable || !gender ? undefined : gender }, (nameIsEditable && {
599
+ names: {
600
+ en: isNameENNonEditable ? undefined : userName,
601
+ ar: isNameARNonEditable ? undefined : userName
602
+ }
603
+ })), { contact: contact }), (hasIdentification &&
604
+ !(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
605
+ identification: {
606
+ id: isNidNonEditable || !nid ? undefined : nid,
607
+ issued_country_code: isIssuedCountryNonEditable ? undefined : issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2,
608
+ expiry: isExpiryNonEditable || !expiryDate ? undefined : new Date(expiryDate).getTime(),
609
+ type: isIdTypeNonEditable || !identification_id_type ? undefined : identification_id_type
610
+ }
611
+ })), (!isDOBNonEditable && {
612
+ date_of_birth: dob
613
+ })), (hasBirth &&
614
+ !(isBirthCityNonEditable && isBirthCountryNonEditable) && {
615
+ birth: {
616
+ city: isBirthCityNonEditable ? undefined : placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.id,
617
+ country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
618
+ }
619
+ })), (!isNationalityNonEditable && {
620
+ nationality: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
621
+ })), { encryption_contract: [
622
+ 'gender',
623
+ 'contact.email',
624
+ 'contact.phone.country_code',
625
+ 'contact.phone.number',
626
+ 'identification.id',
627
+ 'identification.issued_country_code',
628
+ 'identification.expiry',
629
+ 'identification.type',
630
+ 'birth.country',
631
+ 'date_of_birth',
632
+ 'nationality'
633
+ ], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
634
+ return [4, API.individualService.updateMultipleIndividual(requestBody)];
635
+ case 1:
636
+ data = _l.sent();
637
+ _e = getIndividualType(objects), isUser = _e.isUser, isBuyer = _e.isBuyer;
638
+ isUserORBuyerType = isUser || isBuyer;
639
+ if (!isUserORBuyerType) return [3, 3];
640
+ return [4, thunkApi.dispatch(retrieveDataList(code))];
641
+ case 2:
642
+ _l.sent();
643
+ _l.label = 3;
644
+ case 3:
645
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
646
+ (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
647
+ return [2, { data: data, formData: originalFormData }];
648
+ }
649
+ });
650
+ });
651
+ });
652
+ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (_a, thunkApi) {
653
+ var formData = _a.formData, originalFormData = _a.originalFormData;
654
+ return __awaiter(void 0, void 0, void 0, function () {
655
+ var _b, settings, individual, _c, notification, user, id, _d, objects, ids, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, _e, isUser, isShareholder, isBoardMember, isBuyer, isCustomer, isUserORBuyerType, payload, requestBody, data, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, individualData;
656
+ var _f, _g;
657
+ return __generator(this, function (_h) {
658
+ switch (_h.label) {
659
+ case 0:
660
+ _b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
661
+ _c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user;
662
+ id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
663
+ _d = user || {}, objects = _d.objects, ids = _d.ids;
664
+ occupation = formData.occupation, sourceIncome = formData.sourceIncome, monthlyIncome = formData.monthlyIncome, isPEP = formData.isPEP, isInfluencer = formData.isInfluencer, shareCount = formData.shareCount, shareValue = formData.shareValue, civilID = formData.civilID, signatureFileId = formData.signatureFileId;
665
+ isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
666
+ isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
667
+ isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
668
+ isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
669
+ isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
670
+ isSharesAvailable = shareCount || shareValue;
671
+ pepInfo = isPEPNonEditable ? undefined : isPEP;
672
+ influencerInfo = isInfluencerNonEditable ? undefined : isInfluencer;
673
+ occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { chapter: { id: occupation.id } };
674
+ sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
675
+ monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
676
+ userPayload = {
677
+ occupation: occupationInfo,
678
+ source_income: sourceIncomeInfo,
679
+ monthly_income: monthlyIncomeInfo,
680
+ is_relative_PEP: pepInfo,
681
+ is_influencer: influencerInfo
682
+ };
683
+ shareHolderPayload = {
684
+ shares: isSharesAvailable
570
685
  ? {
571
- country_code: isMobileCountryEditable ? (_d = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _d === void 0 ? void 0 : _d.toString() : undefined,
572
- number: isMobileNumberEditable ? mobile : undefined
686
+ count: shareCount && Number(shareCount),
687
+ value: shareValue && Number(removeAllCharsFromNumber(shareValue))
573
688
  }
574
689
  : undefined
690
+ };
691
+ boardMemberPayload = {
692
+ is_relative_PEP: pepInfo,
693
+ is_influencer: influencerInfo
694
+ };
695
+ buyerMemberPayload = {
696
+ occupation: occupationInfo,
697
+ source_income: sourceIncomeInfo,
698
+ monthly_income: monthlyIncomeInfo
699
+ };
700
+ _e = getIndividualType(objects), isUser = _e.isUser, isShareholder = _e.isShareholder, isBoardMember = _e.isBoardMember, isBuyer = _e.isBuyer, isCustomer = _e.isCustomer;
701
+ isUserORBuyerType = isUser || isBuyer;
702
+ payload = userPayload;
703
+ if (objects === null || objects === void 0 ? void 0 : objects.length) {
704
+ payload = __assign(__assign(__assign(__assign(__assign({}, (isUser && payload)), (isShareholder && shareHolderPayload)), (isBoardMember && boardMemberPayload)), (isBuyer && buyerMemberPayload)), (isCustomer && {}));
575
705
  }
576
- : undefined;
577
- requestBody = {
578
- id: id,
579
- type: type,
580
- names: names,
581
- gender: gender || undefined,
582
- contact: contact,
583
- identification: hasIdentification
584
- ? {
585
- id: isNidEditable ? nid : undefined,
586
- issued_country_code: isIssuedCountryEditable ? issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2 : undefined,
587
- expiry: isExpiryEditable ? new Date(expiryDate).getTime() : undefined,
588
- type: isIdTypeEditable ? identification_id_type : undefined
589
- }
590
- : undefined,
591
- date_of_birth: dob,
592
- birth: hasBirth && {
593
- city: (_e = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _e === void 0 ? void 0 : _e.en,
594
- country: placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
595
- },
596
- nationality: isNationalityEditable ? nationality === null || nationality === void 0 ? void 0 : nationality.iso2 : undefined,
597
- encryption_contract: [
598
- 'gender',
599
- 'contact.email',
600
- 'contact.phone.country_code',
601
- 'contact.phone.number',
602
- 'identification.id',
603
- 'identification.issued_country_code',
604
- 'identification.expiry',
605
- 'identification.type',
606
- 'birth.city',
607
- 'birth.country',
608
- 'date_of_birth',
609
- 'nationality'
610
- ],
611
- step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO
612
- };
613
- return [4, API.individualService.updateIndividual(requestBody)];
614
- case 1:
615
- data = (_h.sent()).data;
616
- if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
617
- return [4, thunkApi.dispatch(retrieveDataList(code))];
618
- case 2:
619
- _h.sent();
620
- _h.label = 3;
621
- case 3:
622
- thunkApi.dispatch(handleNextScreenStep());
623
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
624
- return [2, { data: data, formData: params }];
625
- }
626
- });
627
- }); });
628
- export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
629
- var _a, settings, individual, _b, notification, user, _c, id, type, civilID, signatureFileId, businessCountry, documentsList, isSendSignatureFile, documentBody, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationEditable, isSourceIncomeEditable, isPEPEditable, isInfluencerEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data;
630
- var _d, _e;
631
- return __generator(this, function (_f) {
632
- switch (_f.label) {
633
- case 0:
634
- _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
635
- _b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user;
636
- _c = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
637
- civilID = params.civilID, signatureFileId = params.signatureFileId;
638
- businessCountry = settings.data.businessCountry;
639
- documentsList = [];
640
- isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
641
- if ((civilID || []).length > 0)
642
- documentsList.push({ type: 'Civil ID File', images: civilID });
643
- if (isSendSignatureFile && (signatureFileId || []).length > 0)
644
- documentsList.push({ type: 'Signature File', images: signatureFileId });
645
- documentBody = {
646
- individual_type_id: id || '',
647
- country: businessCountry.iso2,
648
- documents: documentsList
649
- };
650
- if (!(documentsList.length > 0)) return [3, 2];
651
- return [4, API.documentService.updateDocumentInfo(documentBody)];
652
- case 1:
653
- _f.sent();
654
- _f.label = 2;
655
- case 2:
656
- occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
657
- isOccupationEditable = true;
658
- isSourceIncomeEditable = true;
659
- isPEPEditable = true;
660
- isInfluencerEditable = true;
661
- isSharesAvailable = shareCount || shareValue;
662
- pepInfo = isPEPEditable ? isPEP : undefined;
663
- influencerInfo = isInfluencerEditable ? isInfluencer : undefined;
664
- occupationInfo = isOccupationEditable ? { id: occupation.id } : undefined;
665
- sourceIncomeInfo = isSourceIncomeEditable ? [{ id: sourceIncome.id }] : undefined;
666
- monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) && { id: monthlyIncome.id };
667
- userPayload = {
668
- occupation: occupationInfo,
669
- source_income: sourceIncomeInfo,
670
- monthly_income: monthlyIncomeInfo,
671
- is_relative_PEP: pepInfo,
672
- is_influencer: influencerInfo
673
- };
674
- shareHolderPayload = {
675
- shares: isSharesAvailable
676
- ? {
677
- count: shareCount && Number(shareCount),
678
- value: shareValue && Number(shareValue)
679
- }
680
- : undefined
681
- };
682
- boardMemberPayload = {
683
- is_relative_PEP: pepInfo,
684
- is_influencer: influencerInfo
685
- };
686
- buyerMemberPayload = {
687
- occupation: occupationInfo,
688
- source_income: sourceIncomeInfo,
689
- monthly_income: monthlyIncomeInfo
690
- };
691
- payload = userPayload;
692
- if (type === IndividualType.SHARE_HOLDER)
693
- payload = shareHolderPayload;
694
- if (type === IndividualType.BOARD_MEMBER)
695
- payload = boardMemberPayload;
696
- if (type === IndividualType.BUYER)
697
- payload = buyerMemberPayload;
698
- if (type === IndividualType.CUSTOMER)
699
- payload = {};
700
- requestBody = __assign(__assign({ id: id, type: type }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
701
- return [4, API.individualService.updateIndividual(requestBody)];
702
- case 3:
703
- data = (_f.sent()).data;
704
- thunkApi.dispatch(handleNextScreenStep());
705
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
706
- return [2, { data: data, formData: params }];
707
- }
706
+ requestBody = __assign(__assign({ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id] }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
707
+ return [4, API.individualService.updateMultipleIndividual(requestBody)];
708
+ case 1:
709
+ data = _h.sent();
710
+ businessCountry = settings.data.businessCountry;
711
+ hasCivilIdDocument = (civilID || []).length > 0;
712
+ hasSignatureDocument = (signatureFileId || []).length > 0;
713
+ isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && isUserORBuyerType;
714
+ civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
715
+ signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
716
+ if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 3];
717
+ documentBody = {
718
+ id: civilIdDocument.id,
719
+ images: civilID
720
+ };
721
+ return [4, API.documentService.addFilesToExistingDocument(documentBody)];
722
+ case 2:
723
+ _h.sent();
724
+ _h.label = 3;
725
+ case 3:
726
+ if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 5];
727
+ documentBody = {
728
+ id: signatureDocument.id,
729
+ images: signatureFileId
730
+ };
731
+ return [4, API.documentService.addFilesToExistingDocument(documentBody)];
732
+ case 4:
733
+ _h.sent();
734
+ _h.label = 5;
735
+ case 5:
736
+ documentsList = [];
737
+ if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
738
+ documentsList.push({ type: DocumentPurpose.IDENTITY_DOCUMENT, images: civilID });
739
+ if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
740
+ documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
741
+ if (!(documentsList.length > 0)) return [3, 7];
742
+ documentBody = {
743
+ individual_type_id: ((ids === null || ids === void 0 ? void 0 : ids.length) ? ids.find(function (i) { return i.includes('usr_'); }) : id) || '',
744
+ country: businessCountry.iso2,
745
+ documents: documentsList
746
+ };
747
+ return [4, API.documentService.updateDocumentInfo(documentBody)];
748
+ case 6:
749
+ _h.sent();
750
+ _h.label = 7;
751
+ case 7:
752
+ individualData = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
753
+ thunkApi.dispatch(handleNextScreenStep());
754
+ (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
755
+ return [2, { data: data, formData: originalFormData, individualData: individualData }];
756
+ }
757
+ });
708
758
  });
709
- }); });
759
+ });
710
760
  export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', function (_a) {
711
761
  var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
712
762
  return __awaiter(void 0, void 0, void 0, function () {
@@ -730,13 +780,13 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
730
780
  });
731
781
  });
732
782
  export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
733
- var _a, settings, individual, _b, id, infoId, payload, data, boardInfoStatus;
734
- var _c, _d, _e, _f;
735
- return __generator(this, function (_g) {
736
- switch (_g.label) {
783
+ var _a, settings, individual, _b, id, infoId, primaryUser, payload, data, boardInfoStatus, individualDataRes, _c, is_authorized, userId, type;
784
+ var _d, _e, _f, _g;
785
+ return __generator(this, function (_h) {
786
+ switch (_h.label) {
737
787
  case 0:
738
788
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
739
- _b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
789
+ _b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id, primaryUser = _b.primaryUser;
740
790
  if (!id)
741
791
  return [2];
742
792
  payload = {
@@ -746,17 +796,27 @@ export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess',
746
796
  };
747
797
  return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
748
798
  case 1:
749
- data = _g.sent();
799
+ data = _h.sent();
750
800
  return [4, API.boardService.retrieveBoardInfoStatus(id)];
751
801
  case 2:
752
- boardInfoStatus = _g.sent();
802
+ boardInfoStatus = _h.sent();
753
803
  return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
754
804
  case 3:
755
- _g.sent();
756
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
757
- (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
805
+ _h.sent();
806
+ individualDataRes = undefined;
807
+ _c = primaryUser || {}, is_authorized = _c.is_authorized, userId = _c.id, type = _c.object;
808
+ if (!!is_authorized) return [3, 5];
809
+ return [4, thunkApi
810
+ .dispatch(retrieveIndividualInfo({ id: userId, type: type, countryCode: settings.data.businessCountry.iso2 }))
811
+ .unwrap()];
812
+ case 4:
813
+ individualDataRes = _h.sent();
814
+ _h.label = 5;
815
+ case 5:
816
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
817
+ (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
758
818
  thunkApi.dispatch(handleNextScreenStep());
759
- return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params }];
819
+ return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params, individualData: individualDataRes === null || individualDataRes === void 0 ? void 0 : individualDataRes.data }];
760
820
  }
761
821
  });
762
822
  }); });
@@ -790,7 +850,7 @@ var initialState = {
790
850
  nid: '',
791
851
  issuedCountry: undefined,
792
852
  expiryDate: '',
793
- dob: getEighteenYearsAgo(),
853
+ dob: '',
794
854
  placeOfBirthCountry: undefined,
795
855
  placeOfBirthCity: undefined,
796
856
  nationality: undefined
@@ -800,7 +860,6 @@ var initialState = {
800
860
  sourceIncome: undefined,
801
861
  monthlyIncome: undefined,
802
862
  employerName: '',
803
- employerLocation: undefined,
804
863
  isPEP: null,
805
864
  isInfluencer: null,
806
865
  shareCount: '',
@@ -902,10 +961,72 @@ export var individualSlice = createSlice({
902
961
  state.error = null;
903
962
  })
904
963
  .addCase(addDetailsAsync.fulfilled, function (state, action) {
964
+ var _a, _b, _c, _d;
905
965
  state.loading = false;
906
966
  state.error = null;
907
- var userList = action.payload.userList;
967
+ var _e = action.payload, userList = _e.userList, individualId = _e.individualId, countries = _e.countries;
968
+ var primaryUser = (state.data.verify.responseBody || {}).user;
969
+ var user = (userList || []).find(function (user) { return user.individual_id === individualId; });
908
970
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: userList });
971
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: userList, user: __assign(__assign({}, user), { is_authorized: (user === null || user === void 0 ? void 0 : user.is_authorized) !== undefined ? user === null || user === void 0 ? void 0 : user.is_authorized : primaryUser === null || primaryUser === void 0 ? void 0 : primaryUser.is_authorized }) });
972
+ var _f = user || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares;
973
+ var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList;
974
+ var cityList = (state.data.verify.responseBody || {}).cityList;
975
+ if (user)
976
+ state.data.individualPersonalData.name = getUserName(user, false);
977
+ if (contact === null || contact === void 0 ? void 0 : contact.email)
978
+ state.data.individualPersonalData.email = contact === null || contact === void 0 ? void 0 : contact.email;
979
+ if ((_a = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _a === void 0 ? void 0 : _a.number)
980
+ state.data.individualPersonalData.mobile = (_b = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _b === void 0 ? void 0 : _b.number;
981
+ if ((_c = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _c === void 0 ? void 0 : _c.country_code) {
982
+ state.data.individualPersonalData.countryCode = findCountryByIddPrefix(countries, (_d = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _d === void 0 ? void 0 : _d.country_code) || defaultCountry;
983
+ }
984
+ if (gender)
985
+ state.data.individualPersonalData.gender = gender.toLowerCase();
986
+ if (identification === null || identification === void 0 ? void 0 : identification.id)
987
+ state.data.individualPersonalData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
988
+ if (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) {
989
+ state.data.individualPersonalData.issuedCountry = findCountryByIso2(countries, identification === null || identification === void 0 ? void 0 : identification.issued_country_code);
990
+ }
991
+ var expiryDate = new Date((identification === null || identification === void 0 ? void 0 : identification.expiry) || new Date().getTime());
992
+ state.data.individualPersonalData.expiryDate = convertNumbers2English(dateFormat(expiryDate));
993
+ if (birth === null || birth === void 0 ? void 0 : birth.date)
994
+ state.data.individualPersonalData.dob = convertNumbers2English(dateFormat(new Date(birth === null || birth === void 0 ? void 0 : birth.date)));
995
+ if (birth === null || birth === void 0 ? void 0 : birth.country) {
996
+ state.data.individualPersonalData.placeOfBirthCountry = findCountryByIso2(countries, birth === null || birth === void 0 ? void 0 : birth.country);
997
+ }
998
+ if (birth === null || birth === void 0 ? void 0 : birth.city) {
999
+ var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
1000
+ var _a;
1001
+ return city.id === ((_a = birth === null || birth === void 0 ? void 0 : birth.city) === null || _a === void 0 ? void 0 : _a.cityId);
1002
+ });
1003
+ state.data.individualPersonalData.placeOfBirthCity = selectedCity;
1004
+ }
1005
+ if (nationality) {
1006
+ state.data.individualPersonalData.nationality = findCountryByIso2(countries, nationality);
1007
+ }
1008
+ var _h = shares || {}, count = _h.count, value = _h.value;
1009
+ var shareCount = count === null || count === void 0 ? void 0 : count.toString();
1010
+ var shareValue = value === null || value === void 0 ? void 0 : value.toString();
1011
+ if (shareCount) {
1012
+ state.data.individualData.shareCount = shareCount;
1013
+ }
1014
+ if (shareValue) {
1015
+ state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
1016
+ }
1017
+ var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
1018
+ if (!!selectedSourceIncome)
1019
+ state.data.individualData.sourceIncome = selectedSourceIncome;
1020
+ var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
1021
+ return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
1022
+ });
1023
+ var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
1024
+ state.data.individualData.monthlyIncome = selectedMonthlyIncome;
1025
+ state.data.individualData.occupation = selectedOccupation;
1026
+ if (is_relative_PEP !== undefined)
1027
+ state.data.individualData.isPEP = is_relative_PEP;
1028
+ if (is_influencer !== undefined)
1029
+ state.data.individualData.isInfluencer = is_influencer;
909
1030
  })
910
1031
  .addCase(addDetailsAsync.rejected, function (state, action) {
911
1032
  state.loading = false;
@@ -918,12 +1039,12 @@ export var individualSlice = createSlice({
918
1039
  .addCase(requestDetailsByEmail.fulfilled, function (state, action) {
919
1040
  state.loading = false;
920
1041
  state.error = null;
921
- var _a = action.payload, data = _a.data, userData = _a.userData;
1042
+ var _a = action.payload, data = _a.data, individualData = _a.individualData;
922
1043
  var userList = (state.data.verify.responseBody || {}).userList;
923
1044
  var list = userList || [];
924
1045
  list = list.map(function (user) {
925
1046
  var _a, _b;
926
- var userInfo = user.id === (userData === null || userData === void 0 ? void 0 : userData.id) ? userData : user;
1047
+ var userInfo = user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id) ? individualData : user;
927
1048
  return user.id === ((_b = (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient) === null || _b === void 0 ? void 0 : _b.id) ? __assign(__assign({}, userInfo), { isRequestedEmail: true }) : userInfo;
928
1049
  });
929
1050
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { requestEmailData: data, userList: list });
@@ -938,11 +1059,11 @@ export var individualSlice = createSlice({
938
1059
  .addCase(retrieveIndividualInfo.fulfilled, function (state, action) {
939
1060
  var _a, _b, _c, _d;
940
1061
  state.error = null;
941
- var _e = action.payload, data = _e.data, countries = _e.countries, countryCode = _e.countryCode;
1062
+ var _e = action.payload, data = _e.data, countries = _e.countries;
942
1063
  var user = (state.data.verify.responseBody || {}).user;
943
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { user: __assign(__assign({}, data), { is_authorized: data.is_authorized !== undefined ? data.is_authorized : user === null || user === void 0 ? void 0 : user.is_authorized }) });
944
- var _f = data || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, employer_country = _f.employer_country, shares = _f.shares;
945
- var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList, occupationList = _g.occupationList;
1064
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { primaryUser: data, user: __assign(__assign({}, data), { is_authorized: data.is_authorized !== undefined ? data.is_authorized : user === null || user === void 0 ? void 0 : user.is_authorized }) });
1065
+ var _f = data || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares;
1066
+ var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList;
946
1067
  var cityList = (state.data.verify.responseBody || {}).cityList;
947
1068
  if (data)
948
1069
  state.data.individualPersonalData.name = getUserName(data, false);
@@ -957,7 +1078,6 @@ export var individualSlice = createSlice({
957
1078
  state.data.individualPersonalData.gender = gender.toLowerCase();
958
1079
  if (identification === null || identification === void 0 ? void 0 : identification.id)
959
1080
  state.data.individualPersonalData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
960
- state.data.individualPersonalData.issuedCountry = identification === null || identification === void 0 ? void 0 : identification.issued_country_code;
961
1081
  if (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) {
962
1082
  state.data.individualPersonalData.issuedCountry = findCountryByIso2(countries, identification === null || identification === void 0 ? void 0 : identification.issued_country_code);
963
1083
  }
@@ -970,7 +1090,8 @@ export var individualSlice = createSlice({
970
1090
  }
971
1091
  if (birth === null || birth === void 0 ? void 0 : birth.city) {
972
1092
  var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
973
- return city.name.en === (birth === null || birth === void 0 ? void 0 : birth.city);
1093
+ var _a;
1094
+ return city.id === ((_a = birth === null || birth === void 0 ? void 0 : birth.city) === null || _a === void 0 ? void 0 : _a.cityId);
974
1095
  });
975
1096
  state.data.individualPersonalData.placeOfBirthCity = selectedCity;
976
1097
  }
@@ -984,22 +1105,15 @@ export var individualSlice = createSlice({
984
1105
  state.data.individualData.shareCount = shareCount;
985
1106
  }
986
1107
  if (shareValue) {
987
- state.data.individualData.shareValue = shareValue;
1108
+ state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
988
1109
  }
989
1110
  var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
990
1111
  if (!!selectedSourceIncome)
991
1112
  state.data.individualData.sourceIncome = selectedSourceIncome;
992
- var code = employer_country || countryCode;
993
- if (!!code) {
994
- var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
995
- state.data.individualData.employerLocation = employerLocation;
996
- }
997
1113
  var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
998
1114
  return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
999
1115
  });
1000
- var selectedOccupation = occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (occup) {
1001
- return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
1002
- });
1116
+ var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
1003
1117
  state.data.individualData.monthlyIncome = selectedMonthlyIncome;
1004
1118
  state.data.individualData.occupation = selectedOccupation;
1005
1119
  state.data.individualData.isPEP = is_relative_PEP;
@@ -1042,9 +1156,7 @@ export var individualSlice = createSlice({
1042
1156
  var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
1043
1157
  return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
1044
1158
  });
1045
- var selectedOccupation = occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (occup) {
1046
- return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
1047
- });
1159
+ var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
1048
1160
  state.data.individualData.monthlyIncome = selectedMonthlyIncome;
1049
1161
  state.data.individualData.occupation = selectedOccupation;
1050
1162
  })
@@ -1064,10 +1176,10 @@ export var individualSlice = createSlice({
1064
1176
  var cityList = action.payload;
1065
1177
  state.data.verify.responseBody = __assign(__assign({}, data), { cityList: cityList });
1066
1178
  var birth = (((_a = state.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.user) || {}).birth;
1067
- var city = (birth || {}).city;
1068
- if (city) {
1069
- var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (c) {
1070
- return c.name.en === city;
1179
+ if (birth === null || birth === void 0 ? void 0 : birth.city) {
1180
+ var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
1181
+ var _a;
1182
+ return city.id === ((_a = birth === null || birth === void 0 ? void 0 : birth.city) === null || _a === void 0 ? void 0 : _a.cityId);
1071
1183
  });
1072
1184
  state.data.individualPersonalData.placeOfBirthCity = selectedCity;
1073
1185
  }
@@ -1113,9 +1225,16 @@ export var individualSlice = createSlice({
1113
1225
  .addCase(updateIndividualInfo.fulfilled, function (state, action) {
1114
1226
  state.loading = false;
1115
1227
  state.error = null;
1116
- var _a = action.payload, data = _a.data, formData = _a.formData;
1228
+ var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData;
1117
1229
  state.data.individualData = formData;
1118
1230
  state.data.individualData.responseBody = data;
1231
+ var userList = (state.data.verify.responseBody || {}).userList;
1232
+ var list = userList || [];
1233
+ list = list.map(function (user) {
1234
+ var userInfo = user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id) ? individualData : user;
1235
+ return userInfo;
1236
+ });
1237
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { userList: list });
1119
1238
  })
1120
1239
  .addCase(updateIndividualInfo.rejected, function (state, action) {
1121
1240
  state.loading = false;
@@ -1135,6 +1254,20 @@ export var individualSlice = createSlice({
1135
1254
  .addCase(retrieveBoardDetails.rejected, function (state, action) {
1136
1255
  state.error = action.error.message;
1137
1256
  state.loading = false;
1257
+ })
1258
+ .addCase(retrieveBoardStatus.pending, function (state) {
1259
+ state.error = null;
1260
+ state.loading = true;
1261
+ })
1262
+ .addCase(retrieveBoardStatus.fulfilled, function (state, action) {
1263
+ state.error = null;
1264
+ state.loading = false;
1265
+ var flows = action.payload.flows;
1266
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
1267
+ })
1268
+ .addCase(retrieveBoardStatus.rejected, function (state, action) {
1269
+ state.error = action.error.message;
1270
+ state.loading = false;
1138
1271
  })
1139
1272
  .addCase(checkEmailAvailability.fulfilled, function (state, action) {
1140
1273
  var _a;
@@ -1153,14 +1286,15 @@ export var individualSlice = createSlice({
1153
1286
  var _a;
1154
1287
  state.loading = false;
1155
1288
  state.error = null;
1156
- var response = (action.payload || {}).response;
1289
+ var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
1157
1290
  var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1158
1291
  if (description) {
1159
1292
  state.error = description;
1160
1293
  return;
1161
1294
  }
1162
1295
  var flows = response.flows;
1163
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
1296
+ var individuals = (state.data.verify.responseBody || {}).individuals;
1297
+ state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { individuals: __assign(__assign({}, individuals), { data_state: individualData === null || individualData === void 0 ? void 0 : individualData.data_state }) }));
1164
1298
  })
1165
1299
  .addCase(updateBoardSuccess.pending, function (state) {
1166
1300
  state.loading = true;