@tap-payments/auth-jsconnect 2.1.99-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 (485) 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 +33 -28
  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 +46 -0
  57. package/build/constants/app.js +106 -40
  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 +198 -26
  75. package/build/features/app/individual/individualStore.js +547 -348
  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 +18 -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 +13 -0
  347. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +146 -0
  348. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.d.ts +5 -0
  349. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +63 -0
  350. package/build/features/individual/screens/IndividualPhoneInfo/index.d.ts +3 -0
  351. package/build/features/individual/screens/IndividualPhoneInfo/index.js +2 -0
  352. package/build/features/individual/screens/IndividualPhoneInfo/validation.d.ts +8 -0
  353. package/build/features/individual/screens/IndividualPhoneInfo/validation.js +31 -0
  354. package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  355. package/build/features/individual/screens/Verify/OTPInput.js +5 -3
  356. package/build/features/individual/screens/Verify/Verify.js +1 -5
  357. package/build/features/password/Password.js +7 -5
  358. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
  359. package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
  360. package/build/features/password/screens/Verify/OTPInput.js +5 -3
  361. package/build/features/password/screens/Verify/Verify.js +7 -20
  362. package/build/features/shared/Address/CountryList.d.ts +10 -10
  363. package/build/features/shared/Address/CountryList.js +1 -1
  364. package/build/features/shared/Address/InputSelect.d.ts +10 -10
  365. package/build/features/shared/Address/InputSelect.js +2 -2
  366. package/build/features/shared/Button/Button.d.ts +3 -1
  367. package/build/features/shared/Button/Button.js +3 -3
  368. package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
  369. package/build/features/shared/Button/EmailProvidersButtons.js +9 -2
  370. package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
  371. package/build/features/shared/Button/FlowsButtons.js +23 -21
  372. package/build/features/shared/Button/IndividualActionButtons.d.ts +21 -0
  373. package/build/features/shared/Button/IndividualActionButtons.js +156 -0
  374. package/build/features/shared/Button/index.d.ts +1 -1
  375. package/build/features/shared/Button/index.js +1 -1
  376. package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
  377. package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
  378. package/build/features/shared/Chip/Chip.d.ts +3 -0
  379. package/build/features/shared/Chip/Chip.js +21 -0
  380. package/build/features/shared/Chip/index.d.ts +2 -0
  381. package/build/features/shared/Chip/index.js +2 -0
  382. package/build/features/shared/Containers/FeatureContainer.d.ts +4 -1
  383. package/build/features/shared/Containers/FeatureContainer.js +5 -4
  384. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  385. package/build/features/shared/Dot/Dot.d.ts +8 -0
  386. package/build/features/shared/Dot/Dot.js +29 -0
  387. package/build/features/shared/Dot/index.d.ts +2 -0
  388. package/build/features/shared/Dot/index.js +2 -0
  389. package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
  390. package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
  391. package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
  392. package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
  393. package/build/features/shared/EndAdornment/index.d.ts +3 -0
  394. package/build/features/shared/EndAdornment/index.js +3 -0
  395. package/build/features/shared/Footer/Footer.js +8 -0
  396. package/build/features/shared/Footer/PoweredByFooter.d.ts +9 -0
  397. package/build/features/shared/Footer/PoweredByFooter.js +36 -0
  398. package/build/features/shared/Footer/index.d.ts +3 -2
  399. package/build/features/shared/Footer/index.js +3 -2
  400. package/build/features/shared/GenericError/GenericError.js +1 -1
  401. package/build/features/shared/Input/Input.d.ts +6 -7
  402. package/build/features/shared/Input/Input.js +2 -3
  403. package/build/features/shared/Input/index.d.ts +2 -1
  404. package/build/features/shared/InputSelect/InputSelect.d.ts +4 -0
  405. package/build/features/shared/InputSelect/InputSelect.js +33 -0
  406. package/build/features/shared/InputSelect/index.d.ts +2 -0
  407. package/build/features/shared/InputSelect/index.js +2 -0
  408. package/build/features/shared/OTP/OTP.d.ts +2 -1
  409. package/build/features/shared/OTP/OTP.js +2 -2
  410. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +3 -1
  411. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +8 -6
  412. package/build/features/shared/SalesChannels/SalesChannel.d.ts +3 -1
  413. package/build/features/shared/SalesChannels/SalesChannel.js +9 -4
  414. package/build/features/shared/Search/Search.d.ts +2 -1
  415. package/build/features/shared/Search/Search.js +2 -2
  416. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +14 -5
  417. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  418. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  419. package/build/features/shared/UploadFile/FileUpload.d.ts +32 -0
  420. package/build/features/shared/UploadFile/FileUpload.js +267 -0
  421. package/build/features/shared/UploadFile/UploadFile.d.ts +2 -2
  422. package/build/features/shared/UploadFile/UploadFile.js +7 -7
  423. package/build/features/shared/UploadFile/UploadWrapper.d.ts +36 -0
  424. package/build/features/shared/UploadFile/UploadWrapper.js +115 -0
  425. package/build/features/shared/UploadFile/index.d.ts +2 -1
  426. package/build/features/shared/UploadFile/index.js +2 -1
  427. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +11 -20
  428. package/build/features/shared/UploadMultipleFile/UploadFile.js +119 -30
  429. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +8 -4
  430. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +28 -21
  431. package/build/features/signIn/SignIn.js +3 -4
  432. package/build/features/tax/Tax.js +10 -6
  433. package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -4
  434. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
  435. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +12 -12
  436. package/build/features/tax/screens/TaxDetails/TaxDetails.js +23 -10
  437. package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
  438. package/build/features/tax/screens/TaxDetails/TaxDocument.js +7 -5
  439. package/build/features/tax/screens/TaxDetails/VATId.d.ts +5 -1
  440. package/build/features/tax/screens/TaxDetails/VATId.js +5 -10
  441. package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
  442. package/build/features/tax/screens/TaxDetails/validation.js +2 -5
  443. package/build/features/tax/screens/Verify/OTPInput.js +5 -3
  444. package/build/features/tax/screens/Verify/Verify.js +6 -22
  445. package/build/hooks/index.d.ts +5 -0
  446. package/build/hooks/index.js +5 -0
  447. package/build/hooks/useAppConfig.d.ts +4 -2
  448. package/build/hooks/useAppConfig.js +10 -5
  449. package/build/hooks/useDataNoneEditable.d.ts +2 -0
  450. package/build/hooks/useDataNoneEditable.js +19 -0
  451. package/build/hooks/useDataVerified.d.ts +6 -0
  452. package/build/hooks/useDataVerified.js +19 -0
  453. package/build/hooks/useErrorListener.d.ts +2 -1
  454. package/build/hooks/useErrorListener.js +16 -1
  455. package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
  456. package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
  457. package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
  458. package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
  459. package/build/hooks/useFormReadOnly.d.ts +6 -0
  460. package/build/hooks/useFormReadOnly.js +40 -0
  461. package/build/hooks/useVerifyToken.js +1 -1
  462. package/build/index.d.ts +2 -2
  463. package/build/index.js +4 -3
  464. package/build/theme/shadows.js +1 -1
  465. package/build/utils/array.d.ts +17 -3
  466. package/build/utils/array.js +220 -6
  467. package/build/utils/date.d.ts +1 -0
  468. package/build/utils/date.js +6 -0
  469. package/build/utils/error.d.ts +1 -0
  470. package/build/utils/error.js +3 -0
  471. package/build/utils/gtm.d.ts +6 -0
  472. package/build/utils/gtm.js +29 -0
  473. package/build/utils/index.d.ts +1 -0
  474. package/build/utils/index.js +1 -0
  475. package/build/utils/object.d.ts +4 -0
  476. package/build/utils/object.js +17 -0
  477. package/build/utils/string.d.ts +5 -2
  478. package/build/utils/string.js +28 -7
  479. package/package.json +4 -2
  480. package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
  481. package/build/features/brand/screens/BrandInfo/Segments.d.ts +0 -8
  482. package/build/features/connect/screens/Merchant/Segments.d.ts +0 -8
  483. package/build/features/shared/Button/ListButton.d.ts +0 -18
  484. package/build/features/shared/Button/ListButton.js +0 -125
  485. /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';
75
- export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (_a, thunkApi) {
76
- var token = _a.token, isInternally = _a.isInternally;
74
+ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType } from '../../../utils';
75
+ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
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 verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
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;
@@ -98,49 +98,46 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
98
98
  countryCode = data === null || data === void 0 ? void 0 : data.country_code;
99
99
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
100
100
  }
101
- if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 14];
101
+ if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
102
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
103
+ return [3, 16];
104
+ case 2:
105
+ if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 15];
102
106
  board_id = data === null || data === void 0 ? void 0 : data.id;
103
107
  board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
104
- if (!(board_id && board_info_id)) return [3, 4];
108
+ if (!(board_id && board_info_id)) return [3, 5];
105
109
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
106
- case 2:
110
+ case 3:
107
111
  boardInfoData = _l.sent();
108
112
  notification = (boardInfoData || {}).notification;
109
113
  _b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
110
- if (!(id && type)) return [3, 4];
111
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
112
- case 3:
113
- payload_1 = (_l.sent()).payload;
114
- individualData = payload_1.data || {};
115
- _l.label = 4;
114
+ if (!(id && type)) return [3, 5];
115
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
116
116
  case 4:
117
+ data_1 = (_l.sent()).data;
118
+ individualData = data_1 || {};
119
+ _l.label = 5;
120
+ case 5:
117
121
  if (!board_id) return [3, 7];
118
122
  return [4, API.boardService.retrieveBoardDetails(board_id)];
119
- case 5:
120
- boardData = _l.sent();
121
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
122
123
  case 6:
123
- boardInfoStatus = _l.sent();
124
+ boardData = _l.sent();
124
125
  _l.label = 7;
125
126
  case 7:
126
127
  if (!countryCode) {
127
- 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;
128
129
  if (countryCode)
129
130
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
130
131
  }
131
- info = (boardInfoStatus || {}).info;
132
- 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';
133
- if (!hasIndividualCompleted) return [3, 8];
134
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
135
- return [3, 14];
136
- case 8:
137
132
  if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
138
- if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 10];
133
+ if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 9];
139
134
  return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
140
- case 9:
135
+ case 8:
141
136
  _l.sent();
142
- _l.label = 10;
137
+ _l.label = 9;
138
+ case 9: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
143
139
  case 10:
140
+ boardInfoStatus = _l.sent();
144
141
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
145
142
  return [3, 14];
146
143
  case 11:
@@ -153,24 +150,52 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
153
150
  case 13:
154
151
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
155
152
  _l.label = 14;
156
- case 14: return [2, {
157
- data: data,
158
- boardResponse: {
159
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
160
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
161
- entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
162
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
163
- merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
164
- name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
165
- contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
166
- individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
167
- countries: countries,
168
- countryCode: countryCode,
169
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
170
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
171
- },
172
- token: token
173
- }];
153
+ case 14: return [3, 16];
154
+ case 15:
155
+ if (isUpdatePhoneInfo) {
156
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
157
+ }
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
+ }];
181
+ }
182
+ });
183
+ });
184
+ });
185
+ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (_a, thunkApi) {
186
+ var token = _a.token, isInternally = _a.isInternally;
187
+ return __awaiter(void 0, void 0, void 0, function () {
188
+ return __generator(this, function (_b) {
189
+ switch (_b.label) {
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
+ })];
196
+ case 1:
197
+ _b.sent();
198
+ return [2];
174
199
  }
175
200
  });
176
201
  });
@@ -193,29 +218,27 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
193
218
  });
194
219
  }); });
195
220
  export var addDetailsAsync = createAsyncThunk('individual/addDetailsAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
196
- var settings, user, userList, id, type, birth, countryCode;
221
+ var settings, user, userList, birth, individual_id, countryCode;
197
222
  return __generator(this, function (_a) {
198
223
  switch (_a.label) {
199
224
  case 0:
200
225
  settings = thunkApi.getState().settings;
201
226
  user = params.user, userList = params.userList;
202
- id = user.id, type = user.type, birth = user.birth;
227
+ birth = user.birth, individual_id = user.individual_id;
203
228
  countryCode = (birth === null || birth === void 0 ? void 0 : birth.country) || settings.data.businessCountry.iso2;
204
229
  if (!countryCode) return [3, 2];
205
230
  return [4, thunkApi.dispatch(getCityList(countryCode))];
206
231
  case 1:
207
232
  _a.sent();
208
233
  _a.label = 2;
209
- case 2: return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type }))];
210
- case 3:
211
- _a.sent();
234
+ case 2:
212
235
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
213
- return [2, { userList: userList }];
236
+ return [2, { userList: userList, individualId: individual_id, countryCode: settings.data.businessCountry.iso2, countries: settings.data.countries }];
214
237
  }
215
238
  });
216
239
  }); });
217
240
  export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsByEmail', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
218
- 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;
219
242
  var _c;
220
243
  return __generator(this, function (_d) {
221
244
  switch (_d.label) {
@@ -223,7 +246,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
223
246
  individual = thunkApi.getState().individual;
224
247
  _a = individual.data.verify.responseBody || {}, merchant_id = _a.merchant_id, board_id = _a.board_id;
225
248
  user = params.user, collectInfo = params.collectInfo;
226
- id = user.id, type = user.type;
249
+ id = user.id, objects = user.objects, ids = user.ids;
227
250
  _b = (user === null || user === void 0 ? void 0 : user.contact) || {}, resEmail = _b.email, resPhone = _b.phone;
228
251
  isPhoneAndEmailAvailable = isValidEmail(resEmail) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.country_code) && (resPhone === null || resPhone === void 0 ? void 0 : resPhone.number);
229
252
  email = collectInfo.email, mobile = collectInfo.mobile, countryCode = collectInfo.countryCode;
@@ -232,8 +255,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
232
255
  if (!(!isPhoneAndEmailAvailable && hasContact)) return [3, 2];
233
256
  hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
234
257
  requestBody = {
235
- id: id,
236
- type: type,
258
+ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id],
237
259
  contact: {
238
260
  email: email,
239
261
  phone: hasPhone
@@ -244,18 +266,11 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
244
266
  : undefined
245
267
  }
246
268
  };
247
- return [4, API.individualService.updateIndividual(requestBody)];
269
+ return [4, API.individualService.updateMultipleIndividual(requestBody)];
248
270
  case 1:
249
- data_1 = _d.sent();
250
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.user;
251
- if (type === IndividualType.SHARE_HOLDER)
252
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.shareholder;
253
- else if (type === IndividualType.BOARD_MEMBER)
254
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.board_member;
255
- else if (type === IndividualType.BUYER)
256
- individualData = data_1 === null || data_1 === void 0 ? void 0 : data_1.buyer;
257
- else if (type === IndividualType.CUSTOMER)
258
- 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;
259
274
  _d.label = 2;
260
275
  case 2:
261
276
  payload = {
@@ -269,7 +284,7 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
269
284
  notification: {
270
285
  recipient: {
271
286
  id: id,
272
- type: type
287
+ type: (objects === null || objects === void 0 ? void 0 : objects[0]) || ''
273
288
  },
274
289
  channel: ['email']
275
290
  }
@@ -277,14 +292,14 @@ export var requestDetailsByEmail = createAsyncThunk('individual/requestDetailsBy
277
292
  return [4, API.boardService.requestDetailsByEmail(payload)];
278
293
  case 3:
279
294
  data = _d.sent();
280
- return [2, { data: data, userData: __assign(__assign({}, individualData), { type: type }) }];
295
+ return [2, { data: data, individualData: individualData }];
281
296
  }
282
297
  });
283
298
  }); });
284
299
  export var getIndividualList = createAsyncThunk('individual/getIndividualList', function (businessId) { return __awaiter(void 0, void 0, void 0, function () {
285
- var payload, _a, users, shareholders, board_members, userList, shareHolderList, boardMemberList, individualList;
286
- return __generator(this, function (_b) {
287
- switch (_b.label) {
300
+ var payload, individuals, list;
301
+ return __generator(this, function (_a) {
302
+ switch (_a.label) {
288
303
  case 0:
289
304
  payload = {
290
305
  page: 1,
@@ -293,12 +308,9 @@ export var getIndividualList = createAsyncThunk('individual/getIndividualList',
293
308
  };
294
309
  return [4, API.individualService.getIndividualList(payload)];
295
310
  case 1:
296
- _a = _b.sent(), users = _a.users, shareholders = _a.shareholders, board_members = _a.board_members;
297
- userList = (users || []).map(function (user) { return (__assign(__assign({}, user), { type: IndividualType.USER })); });
298
- shareHolderList = (shareholders || []).map(function (shareholder) { return (__assign(__assign({}, shareholder), { type: IndividualType.SHARE_HOLDER })); });
299
- boardMemberList = (board_members || []).map(function (board_member) { return (__assign(__assign({}, board_member), { type: IndividualType.BOARD_MEMBER })); });
300
- individualList = __spreadArray(__spreadArray(__spreadArray([], userList, true), shareHolderList, true), boardMemberList, true);
301
- return [2, individualList];
311
+ individuals = (_a.sent()).individuals;
312
+ list = sortUserList(mapUserList(individuals)) || [];
313
+ return [2, __spreadArray([], list, true)];
302
314
  }
303
315
  });
304
316
  }); });
@@ -318,30 +330,35 @@ export var getCityList = createAsyncThunk('individual/getCityList', function (co
318
330
  });
319
331
  }); });
320
332
  export var retrieveIndividualInfo = createAsyncThunk('individual/retrieveIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
321
- var id, type, countryCode, settings, data, individualData;
322
- return __generator(this, function (_a) {
323
- 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) {
324
336
  case 0:
325
337
  id = params.id, type = params.type, countryCode = params.countryCode;
326
338
  settings = thunkApi.getState().settings;
327
339
  return [4, API.individualService.retrieveIndividual(id, type)];
328
340
  case 1:
329
- data = _a.sent();
341
+ data = _b.sent();
342
+ _a = getIndividualType([type]), isShareholder = _a.isShareholder, isBoardMember = _a.isBoardMember, isBuyer = _a.isBuyer, isCustomer = _a.isCustomer;
330
343
  individualData = data === null || data === void 0 ? void 0 : data.user;
331
- if (type === IndividualType.SHARE_HOLDER)
344
+ if (isShareholder)
332
345
  individualData = data === null || data === void 0 ? void 0 : data.shareholder;
333
- else if (type === IndividualType.BOARD_MEMBER)
346
+ else if (isBoardMember)
334
347
  individualData = data === null || data === void 0 ? void 0 : data.board_member;
335
- else if (type === IndividualType.BUYER)
348
+ else if (isBuyer)
336
349
  individualData = data === null || data === void 0 ? void 0 : data.buyer;
337
- else if (type === IndividualType.CUSTOMER)
350
+ else if (isCustomer)
338
351
  individualData = data === null || data === void 0 ? void 0 : data.customer;
339
- 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
+ }];
340
357
  }
341
358
  });
342
359
  }); });
343
360
  export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', function (countryCode) { return __awaiter(void 0, void 0, void 0, function () {
344
- var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupation;
361
+ var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupationData, occupation, mappedOccupation;
345
362
  return __generator(this, function (_b) {
346
363
  switch (_b.label) {
347
364
  case 0:
@@ -358,15 +375,35 @@ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', fun
358
375
  API.dataService.getOccupation(dataBody)
359
376
  ])];
360
377
  case 1:
361
- _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
+ });
362
384
  return [2, {
363
385
  sourceIncome: sourceIncome,
364
386
  monthlyIncome: monthlyIncome,
365
- occupation: occupation
387
+ occupation: { list: mappedOccupation || [] }
366
388
  }];
367
389
  }
368
390
  });
369
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
+ }); });
370
407
  export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
371
408
  var _a, user, data;
372
409
  var _b, _c;
@@ -382,8 +419,8 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
382
419
  });
383
420
  }); });
384
421
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
385
- 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;
386
- 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;
387
424
  return __generator(this, function (_q) {
388
425
  switch (_q.label) {
389
426
  case 0:
@@ -393,7 +430,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
393
430
  countries = settings.data.countries;
394
431
  payload = {
395
432
  data: params.otp,
396
- 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,
397
434
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
398
435
  step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
399
436
  encryption_contract: ['data']
@@ -402,7 +439,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
402
439
  case 1:
403
440
  data = (_q.sent()).data;
404
441
  boardInfoStatus = undefined;
405
- 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)
406
443
  throw new Error(data.errors[0].description);
407
444
  if (!board_id) return [3, 3];
408
445
  return [4, API.boardService.retrieveBoardDetails(board_id)];
@@ -410,7 +447,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
410
447
  boardData = _q.sent();
411
448
  _q.label = 3;
412
449
  case 3:
413
- countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
450
+ countryCode = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.country;
414
451
  if (!(board_id && board_info_id)) return [3, 6];
415
452
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
416
453
  case 4:
@@ -418,47 +455,39 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
418
455
  notification = (boardInfoData || {}).notification;
419
456
  _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
420
457
  if (!(id && type)) return [3, 6];
421
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode }))];
458
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
422
459
  case 5:
423
- payload_2 = (_q.sent()).payload;
424
- individualData = payload_2.data || {};
460
+ data_3 = (_q.sent()).data;
461
+ individualData = data_3 || {};
425
462
  _q.label = 6;
426
463
  case 6:
427
464
  if (countryCode)
428
465
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
429
- if (!board_id) return [3, 8];
430
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
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];
468
+ return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
431
469
  case 7:
432
- boardInfoStatus = _q.sent();
470
+ _q.sent();
433
471
  _q.label = 8;
434
- case 8:
435
- info = (boardInfoStatus || {}).info;
436
- 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';
437
- if (!hasIndividualCompleted) return [3, 9];
438
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
439
- return [3, 15];
472
+ case 8: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
440
473
  case 9:
441
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 12];
442
- if (!((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)) return [3, 11];
443
- return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
444
- case 10:
445
- _q.sent();
446
- _q.label = 11;
447
- case 11:
474
+ boardInfoStatus = _q.sent();
448
475
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
449
- return [3, 15];
450
- case 12:
476
+ return [3, 13];
477
+ case 10:
451
478
  birthCountry = ((_k = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _k === void 0 ? void 0 : _k.country) || countryCode;
452
- if (!birthCountry) return [3, 14];
479
+ if (!birthCountry) return [3, 12];
453
480
  return [4, thunkApi.dispatch(getCityList(birthCountry))];
454
- case 13:
481
+ case 11:
455
482
  _q.sent();
456
- _q.label = 14;
457
- case 14:
458
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
459
- _q.label = 15;
460
- case 15:
483
+ _q.label = 12;
484
+ case 12:
485
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
486
+ _q.label = 13;
487
+ case 13:
461
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;
462
491
  return [2, {
463
492
  data: data,
464
493
  boardResponse: {
@@ -469,10 +498,11 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
469
498
  merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
470
499
  name: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.names,
471
500
  contact: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.contact,
472
- individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
501
+ individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
473
502
  countries: countries,
474
503
  countryCode: countryCode,
475
504
  notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
505
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
476
506
  flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
477
507
  },
478
508
  formData: __assign({}, params)
@@ -480,183 +510,243 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
480
510
  }
481
511
  });
482
512
  }); });
483
- export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
484
- 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;
485
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
486
- return __generator(this, function (_s) {
487
- switch (_s.label) {
488
- case 0:
489
- _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
490
- _b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user, entity = _b.entity;
491
- _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;
492
- 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;
493
- code = entity === null || entity === void 0 ? void 0 : entity.country;
494
- data_status = (user || {}).data_status;
495
- userName = getUserNameObject(name);
496
- identification_id_type = nid && (nid === null || nid === void 0 ? void 0 : nid.startsWith('1')) ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
497
- isNameEditable = (data_status === null || data_status === void 0 ? void 0 : data_status.name) === FieldType.EDITABLE && userName.first;
498
- isEmailEditable = ((_d = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _d === void 0 ? void 0 : _d.email) === FieldType.EDITABLE;
499
- 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;
500
- 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;
501
- 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;
502
- 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;
503
- 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;
504
- 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;
505
- isNationalityEditable = (data_status === null || data_status === void 0 ? void 0 : data_status.nationality) === FieldType.EDITABLE;
506
- hasContact = email || mobile || countryCode;
507
- hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
508
- hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
509
- hasBirth = placeOfBirthCity || placeOfBirthCountry;
510
- names = isNameEditable
511
- ? {
512
- en: userName,
513
- ar: userName
514
- }
515
- : undefined;
516
- contact = hasContact
517
- ? {
518
- email: isEmailEditable ? email : undefined,
519
- phone: hasPhone
520
- ? {
521
- country_code: isMobileCountryEditable ? (_o = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _o === void 0 ? void 0 : _o.toString() : undefined,
522
- number: isMobileNumberEditable ? mobile : undefined
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 || ''
523
531
  }
524
- : undefined
525
- }
526
- : undefined;
527
- requestBody = {
528
- id: id,
529
- type: type,
530
- names: names,
531
- gender: gender || undefined,
532
- contact: contact,
533
- identification: hasIdentification
534
- ? {
535
- id: isNidEditable ? nid : undefined,
536
- issued_country_code: isIssuedCountryEditable ? issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2 : undefined,
537
- expiry: isExpiryEditable ? new Date(expiryDate).getTime() : undefined,
538
- type: isIdTypeEditable ? identification_id_type : undefined
539
532
  }
540
- : undefined,
541
- date_of_birth: dob,
542
- birth: hasBirth && {
543
- city: (_p = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _p === void 0 ? void 0 : _p.en,
544
- country: placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
545
- },
546
- nationality: isNationalityEditable ? nationality === null || nationality === void 0 ? void 0 : nationality.iso2 : undefined,
547
- encryption_contract: [
548
- 'gender',
549
- 'contact.email',
550
- 'contact.phone.country_code',
551
- 'contact.phone.number',
552
- 'identification.id',
553
- 'identification.issued_country_code',
554
- 'identification.expiry',
555
- 'identification.type',
556
- 'birth.city',
557
- 'birth.country',
558
- 'date_of_birth',
559
- 'nationality'
560
- ],
561
- step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO
562
- };
563
- return [4, API.individualService.updateIndividual(requestBody)];
564
- case 1:
565
- data = (_s.sent()).data;
566
- if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
567
- return [4, thunkApi.dispatch(retrieveDataList(code))];
568
- case 2:
569
- _s.sent();
570
- _s.label = 3;
571
- case 3:
572
- thunkApi.dispatch(handleNextScreenStep());
573
- (_r = (_q = settings.data.appConfig).onStepCompleted) === null || _r === void 0 ? void 0 : _r.call(_q, settings.data.activeScreen.name, requestBody);
574
- return [2, { data: data, formData: params }];
575
- }
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
+ });
576
543
  });
577
- }); });
578
- export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
579
- 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;
580
- var _d, _e, _f, _g, _h, _j;
581
- return __generator(this, function (_k) {
582
- switch (_k.label) {
583
- case 0:
584
- _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
585
- _b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user;
586
- _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;
587
- civilID = params.civilID, signatureFileId = params.signatureFileId;
588
- businessCountry = settings.data.businessCountry;
589
- documentsList = [];
590
- isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
591
- if ((civilID || []).length > 0)
592
- documentsList.push({ type: 'Civil ID File', images: civilID });
593
- if (isSendSignatureFile && (signatureFileId || []).length > 0)
594
- documentsList.push({ type: 'Signature File', images: signatureFileId });
595
- documentBody = {
596
- individual_type_id: id || '',
597
- country: businessCountry.iso2,
598
- documents: documentsList
599
- };
600
- if (!(documentsList.length > 0)) return [3, 2];
601
- return [4, API.entityService.updateDocumentInfo(documentBody)];
602
- case 1:
603
- _k.sent();
604
- _k.label = 2;
605
- case 2:
606
- occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
607
- 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);
608
- 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);
609
- isPEPEditable = ((_f = user === null || user === void 0 ? void 0 : user.data_status) === null || _f === void 0 ? void 0 : _f.is_relative_PEP) === FieldType.EDITABLE;
610
- isInfluencerEditable = ((_g = user === null || user === void 0 ? void 0 : user.data_status) === null || _g === void 0 ? void 0 : _g.is_influencer) === FieldType.EDITABLE;
611
- isSharesAvailable = shareCount || shareValue;
612
- pepInfo = isPEPEditable ? isPEP : undefined;
613
- influencerInfo = isInfluencerEditable ? isInfluencer : undefined;
614
- occupationInfo = isOccupationEditable ? { id: occupation.id } : undefined;
615
- sourceIncomeInfo = isSourceIncomeEditable ? [{ id: sourceIncome.id }] : undefined;
616
- monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) && { id: monthlyIncome.id };
617
- userPayload = {
618
- occupation: occupationInfo,
619
- source_income: sourceIncomeInfo,
620
- monthly_income: monthlyIncomeInfo,
621
- is_relative_PEP: pepInfo,
622
- is_influencer: influencerInfo
623
- };
624
- shareHolderPayload = {
625
- shares: isSharesAvailable
626
- ? {
627
- count: shareCount && Number(shareCount),
628
- value: shareValue && Number(shareValue)
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
629
592
  }
630
- : undefined
631
- };
632
- boardMemberPayload = {
633
- is_relative_PEP: pepInfo,
634
- is_influencer: influencerInfo
635
- };
636
- buyerMemberPayload = {
637
- occupation: occupationInfo,
638
- source_income: sourceIncomeInfo,
639
- monthly_income: monthlyIncomeInfo
640
- };
641
- payload = userPayload;
642
- if (type === IndividualType.SHARE_HOLDER)
643
- payload = shareHolderPayload;
644
- if (type === IndividualType.BOARD_MEMBER)
645
- payload = boardMemberPayload;
646
- if (type === IndividualType.BUYER)
647
- payload = buyerMemberPayload;
648
- if (type === IndividualType.CUSTOMER)
649
- payload = {};
650
- requestBody = __assign(__assign({ id: id, type: type }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
651
- return [4, API.individualService.updateIndividual(requestBody)];
652
- case 3:
653
- data = (_k.sent()).data;
654
- thunkApi.dispatch(handleNextScreenStep());
655
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
656
- return [2, { data: data, formData: params }];
657
- }
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
+ });
658
640
  });
659
- }); });
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
675
+ ? {
676
+ count: shareCount && Number(shareCount),
677
+ value: shareValue && Number(removeAllCharsFromNumber(shareValue))
678
+ }
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 && {}));
695
+ }
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
+ });
748
+ });
749
+ });
660
750
  export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', function (_a) {
661
751
  var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
662
752
  return __awaiter(void 0, void 0, void 0, function () {
@@ -680,13 +770,13 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
680
770
  });
681
771
  });
682
772
  export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
683
- var _a, settings, individual, _b, id, infoId, payload, data, boardInfoStatus;
684
- var _c, _d, _e, _f;
685
- return __generator(this, function (_g) {
686
- 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) {
687
777
  case 0:
688
778
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
689
- _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;
690
780
  if (!id)
691
781
  return [2];
692
782
  payload = {
@@ -696,17 +786,27 @@ export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess',
696
786
  };
697
787
  return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
698
788
  case 1:
699
- data = _g.sent();
789
+ data = _h.sent();
700
790
  return [4, API.boardService.retrieveBoardInfoStatus(id)];
701
791
  case 2:
702
- boardInfoStatus = _g.sent();
792
+ boardInfoStatus = _h.sent();
703
793
  return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
704
794
  case 3:
705
- _g.sent();
706
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
707
- (_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 });
708
808
  thunkApi.dispatch(handleNextScreenStep());
709
- 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 }];
710
810
  }
711
811
  });
712
812
  }); });
@@ -722,6 +822,10 @@ var initialState = {
722
822
  otpData: {
723
823
  otp: ''
724
824
  },
825
+ individualPhoneInfo: {
826
+ mobile: '',
827
+ countryCode: defaultCountry
828
+ },
725
829
  individualCollectData: {
726
830
  email: '',
727
831
  mobile: '',
@@ -736,7 +840,7 @@ var initialState = {
736
840
  nid: '',
737
841
  issuedCountry: undefined,
738
842
  expiryDate: '',
739
- dob: getEighteenYearsAgo(),
843
+ dob: '',
740
844
  placeOfBirthCountry: undefined,
741
845
  placeOfBirthCity: undefined,
742
846
  nationality: undefined
@@ -746,7 +850,6 @@ var initialState = {
746
850
  sourceIncome: undefined,
747
851
  monthlyIncome: undefined,
748
852
  employerName: '',
749
- employerLocation: undefined,
750
853
  isPEP: null,
751
854
  isInfluencer: null,
752
855
  shareCount: '',
@@ -780,16 +883,25 @@ export var individualSlice = createSlice({
780
883
  },
781
884
  extraReducers: function (builder) {
782
885
  builder
783
- .addCase(verifyLeadToken.pending, function (state) {
886
+ .addCase(verifyToken.pending, function (state) {
784
887
  state.error = null;
785
- state.customLoading = true;
786
888
  })
787
- .addCase(verifyLeadToken.fulfilled, function (state, action) {
889
+ .addCase(verifyToken.fulfilled, function (state, action) {
788
890
  state.error = null;
789
- state.customLoading = false;
790
891
  var _a = action.payload, data = _a.data, token = _a.token, boardResponse = _a.boardResponse;
791
892
  state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
792
893
  state.data.verify.token = token;
894
+ })
895
+ .addCase(verifyToken.rejected, function (state, action) {
896
+ state.error = action.error.message;
897
+ })
898
+ .addCase(verifyLeadToken.pending, function (state) {
899
+ state.error = null;
900
+ state.customLoading = true;
901
+ })
902
+ .addCase(verifyLeadToken.fulfilled, function (state) {
903
+ state.error = null;
904
+ state.customLoading = false;
793
905
  })
794
906
  .addCase(verifyLeadToken.rejected, function (state, action) {
795
907
  state.error = action.error.message;
@@ -839,10 +951,72 @@ export var individualSlice = createSlice({
839
951
  state.error = null;
840
952
  })
841
953
  .addCase(addDetailsAsync.fulfilled, function (state, action) {
954
+ var _a, _b, _c, _d;
842
955
  state.loading = false;
843
956
  state.error = null;
844
- 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; });
845
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;
846
1020
  })
847
1021
  .addCase(addDetailsAsync.rejected, function (state, action) {
848
1022
  state.loading = false;
@@ -855,12 +1029,12 @@ export var individualSlice = createSlice({
855
1029
  .addCase(requestDetailsByEmail.fulfilled, function (state, action) {
856
1030
  state.loading = false;
857
1031
  state.error = null;
858
- var _a = action.payload, data = _a.data, userData = _a.userData;
1032
+ var _a = action.payload, data = _a.data, individualData = _a.individualData;
859
1033
  var userList = (state.data.verify.responseBody || {}).userList;
860
1034
  var list = userList || [];
861
1035
  list = list.map(function (user) {
862
1036
  var _a, _b;
863
- 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;
864
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;
865
1039
  });
866
1040
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { requestEmailData: data, userList: list });
@@ -870,18 +1044,16 @@ export var individualSlice = createSlice({
870
1044
  state.error = action.error.message;
871
1045
  })
872
1046
  .addCase(retrieveIndividualInfo.pending, function (state) {
873
- state.loading = true;
874
1047
  state.error = null;
875
1048
  })
876
1049
  .addCase(retrieveIndividualInfo.fulfilled, function (state, action) {
877
1050
  var _a, _b, _c, _d;
878
- state.loading = false;
879
1051
  state.error = null;
880
- var _e = action.payload, data = _e.data, countries = _e.countries, countryCode = _e.countryCode;
1052
+ var _e = action.payload, data = _e.data, countries = _e.countries;
881
1053
  var user = (state.data.verify.responseBody || {}).user;
882
- 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 }) });
883
- 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;
884
- 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;
885
1057
  var cityList = (state.data.verify.responseBody || {}).cityList;
886
1058
  if (data)
887
1059
  state.data.individualPersonalData.name = getUserName(data, false);
@@ -896,7 +1068,6 @@ export var individualSlice = createSlice({
896
1068
  state.data.individualPersonalData.gender = gender.toLowerCase();
897
1069
  if (identification === null || identification === void 0 ? void 0 : identification.id)
898
1070
  state.data.individualPersonalData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
899
- state.data.individualPersonalData.issuedCountry = identification === null || identification === void 0 ? void 0 : identification.issued_country_code;
900
1071
  if (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) {
901
1072
  state.data.individualPersonalData.issuedCountry = findCountryByIso2(countries, identification === null || identification === void 0 ? void 0 : identification.issued_country_code);
902
1073
  }
@@ -909,7 +1080,8 @@ export var individualSlice = createSlice({
909
1080
  }
910
1081
  if (birth === null || birth === void 0 ? void 0 : birth.city) {
911
1082
  var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
912
- 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);
913
1085
  });
914
1086
  state.data.individualPersonalData.placeOfBirthCity = selectedCity;
915
1087
  }
@@ -923,29 +1095,21 @@ export var individualSlice = createSlice({
923
1095
  state.data.individualData.shareCount = shareCount;
924
1096
  }
925
1097
  if (shareValue) {
926
- state.data.individualData.shareValue = shareValue;
1098
+ state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
927
1099
  }
928
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]);
929
1101
  if (!!selectedSourceIncome)
930
1102
  state.data.individualData.sourceIncome = selectedSourceIncome;
931
- var code = employer_country || countryCode;
932
- if (!!code) {
933
- var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
934
- state.data.individualData.employerLocation = employerLocation;
935
- }
936
1103
  var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
937
1104
  return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
938
1105
  });
939
- var selectedOccupation = occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (occup) {
940
- return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
941
- });
1106
+ var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
942
1107
  state.data.individualData.monthlyIncome = selectedMonthlyIncome;
943
1108
  state.data.individualData.occupation = selectedOccupation;
944
1109
  state.data.individualData.isPEP = is_relative_PEP;
945
1110
  state.data.individualData.isInfluencer = is_influencer;
946
1111
  })
947
1112
  .addCase(retrieveIndividualInfo.rejected, function (state, action) {
948
- state.loading = false;
949
1113
  state.error = action.error.message;
950
1114
  })
951
1115
  .addCase(getIndividualList.pending, function (state) {
@@ -982,9 +1146,7 @@ export var individualSlice = createSlice({
982
1146
  var selectedMonthlyIncome = monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) {
983
1147
  return income.id === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id);
984
1148
  });
985
- var selectedOccupation = occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (occup) {
986
- return occup.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id);
987
- });
1149
+ var selectedOccupation = (occupation === null || occupation === void 0 ? void 0 : occupation.chapter) || (occupation === null || occupation === void 0 ? void 0 : occupation.section);
988
1150
  state.data.individualData.monthlyIncome = selectedMonthlyIncome;
989
1151
  state.data.individualData.occupation = selectedOccupation;
990
1152
  })
@@ -1004,10 +1166,10 @@ export var individualSlice = createSlice({
1004
1166
  var cityList = action.payload;
1005
1167
  state.data.verify.responseBody = __assign(__assign({}, data), { cityList: cityList });
1006
1168
  var birth = (((_a = state.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.user) || {}).birth;
1007
- var city = (birth || {}).city;
1008
- if (city) {
1009
- var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (c) {
1010
- 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);
1011
1173
  });
1012
1174
  state.data.individualPersonalData.placeOfBirthCity = selectedCity;
1013
1175
  }
@@ -1015,6 +1177,21 @@ export var individualSlice = createSlice({
1015
1177
  .addCase(getCityList.rejected, function (state, action) {
1016
1178
  state.cityLoading = false;
1017
1179
  state.error = action.error.message;
1180
+ })
1181
+ .addCase(updatePhoneInfo.pending, function (state) {
1182
+ state.loading = true;
1183
+ state.error = null;
1184
+ })
1185
+ .addCase(updatePhoneInfo.fulfilled, function (state, action) {
1186
+ state.loading = false;
1187
+ state.error = null;
1188
+ var _a = action.payload, data = _a.data, formData = _a.formData;
1189
+ state.data.individualPhoneInfo = formData;
1190
+ state.data.individualPhoneInfo.responseBody = data;
1191
+ })
1192
+ .addCase(updatePhoneInfo.rejected, function (state, action) {
1193
+ state.loading = false;
1194
+ state.error = action.error.message;
1018
1195
  })
1019
1196
  .addCase(updateIndividualPersonalInfo.pending, function (state) {
1020
1197
  state.loading = true;
@@ -1038,9 +1215,16 @@ export var individualSlice = createSlice({
1038
1215
  .addCase(updateIndividualInfo.fulfilled, function (state, action) {
1039
1216
  state.loading = false;
1040
1217
  state.error = null;
1041
- var _a = action.payload, data = _a.data, formData = _a.formData;
1218
+ var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData;
1042
1219
  state.data.individualData = formData;
1043
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 });
1044
1228
  })
1045
1229
  .addCase(updateIndividualInfo.rejected, function (state, action) {
1046
1230
  state.loading = false;
@@ -1060,6 +1244,20 @@ export var individualSlice = createSlice({
1060
1244
  .addCase(retrieveBoardDetails.rejected, function (state, action) {
1061
1245
  state.error = action.error.message;
1062
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;
1063
1261
  })
1064
1262
  .addCase(checkEmailAvailability.fulfilled, function (state, action) {
1065
1263
  var _a;
@@ -1078,14 +1276,15 @@ export var individualSlice = createSlice({
1078
1276
  var _a;
1079
1277
  state.loading = false;
1080
1278
  state.error = null;
1081
- var response = (action.payload || {}).response;
1279
+ var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
1082
1280
  var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1083
1281
  if (description) {
1084
1282
  state.error = description;
1085
1283
  return;
1086
1284
  }
1087
1285
  var flows = response.flows;
1088
- 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 }) }));
1089
1288
  })
1090
1289
  .addCase(updateBoardSuccess.pending, function (state) {
1091
1290
  state.loading = true;