@tap-payments/auth-jsconnect 2.1.100-test → 2.2.0

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