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

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 (310) hide show
  1. package/build/@types/app.d.ts +50 -20
  2. package/build/@types/app.js +9 -3
  3. package/build/@types/form.d.ts +21 -12
  4. package/build/api/auth.d.ts +28 -5
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +51 -5
  14. package/build/api/entity.js +39 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +44 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +9 -6
  21. package/build/api/lead.js +8 -1
  22. package/build/app/rootReducer.d.ts +0 -1
  23. package/build/app/rootReducer.js +0 -2
  24. package/build/app/settings.d.ts +9 -2
  25. package/build/app/settings.js +22 -11
  26. package/build/app/store.d.ts +0 -2
  27. package/build/assets/locales/ar.json +258 -183
  28. package/build/assets/locales/en.json +190 -108
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
  30. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  32. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  33. package/build/components/AnimationFlow/Dialog.d.ts +4 -1
  34. package/build/components/AnimationFlow/Dialog.js +5 -3
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  37. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  38. package/build/components/ArabicDatePicker/index.js +2 -0
  39. package/build/components/ArabicDatePicker/style.css +24 -0
  40. package/build/components/DatePicker/customStyle.css +86 -0
  41. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  42. package/build/components/FileInput/DragAndDrop.js +108 -8
  43. package/build/components/Lottie/Lottie.d.ts +878 -0
  44. package/build/components/Lottie/Lottie.js +58 -0
  45. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  46. package/build/components/Lottie/files/success.json +425 -0
  47. package/build/components/Lottie/index.d.ts +3 -0
  48. package/build/components/Lottie/index.js +3 -0
  49. package/build/components/OTPField/OTPField.d.ts +2 -1
  50. package/build/components/OTPField/OTPField.js +2 -2
  51. package/build/components/OTPTimer/OTPTimer.js +1 -1
  52. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  53. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  54. package/build/components/ProgressBar/index.d.ts +2 -0
  55. package/build/components/ProgressBar/index.js +2 -0
  56. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  57. package/build/components/RadioLabel/RadioLabel.js +2 -2
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  59. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  60. package/build/constants/api.d.ts +6 -0
  61. package/build/constants/api.js +14 -1
  62. package/build/constants/app.d.ts +5 -5
  63. package/build/constants/app.js +62 -32
  64. package/build/constants/assets.d.ts +14 -0
  65. package/build/constants/assets.js +16 -2
  66. package/build/constants/dummy.d.ts +1 -1
  67. package/build/constants/dummy.js +2 -2
  68. package/build/constants/validation.d.ts +10 -0
  69. package/build/constants/validation.js +11 -1
  70. package/build/features/app/auth/authStore.d.ts +30 -4
  71. package/build/features/app/auth/authStore.js +182 -20
  72. package/build/features/app/bank/bankStore.d.ts +16 -0
  73. package/build/features/app/bank/bankStore.js +88 -41
  74. package/build/features/app/business/businessStore.d.ts +22 -3
  75. package/build/features/app/business/businessStore.js +445 -296
  76. package/build/features/app/connect/connectStore.d.ts +34 -31
  77. package/build/features/app/connect/connectStore.js +427 -300
  78. package/build/features/app/entity/entityStore.d.ts +40 -8
  79. package/build/features/app/entity/entityStore.js +389 -149
  80. package/build/features/app/individual/individualStore.d.ts +18 -0
  81. package/build/features/app/individual/individualStore.js +178 -85
  82. package/build/features/app/password/passwordStore.d.ts +1 -7
  83. package/build/features/app/password/passwordStore.js +31 -20
  84. package/build/features/app/tax/taxStore.js +23 -16
  85. package/build/features/auth/Auth.d.ts +2 -1
  86. package/build/features/auth/Auth.js +37 -9
  87. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  88. package/build/features/auth/screens/NID/DOB.js +47 -0
  89. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  90. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  91. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  92. package/build/features/auth/screens/NID/NID.js +68 -0
  93. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  94. package/build/features/auth/screens/NID/TAC.js +87 -0
  95. package/build/features/auth/screens/NID/index.d.ts +3 -0
  96. package/build/features/auth/screens/NID/index.js +2 -0
  97. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  98. package/build/features/auth/screens/NID/validation.js +19 -0
  99. package/build/features/auth/screens/OTP/OTP.js +8 -4
  100. package/build/features/auth/screens/OTP/OTPInput.js +9 -2
  101. package/build/features/bank/Bank.js +4 -4
  102. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  103. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  104. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  105. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  106. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  107. package/build/features/bank/screens/Success/Success.js +7 -3
  108. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  109. package/build/features/business/Business.js +4 -4
  110. package/build/features/business/screens/Activities/Activities.js +16 -17
  111. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  112. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  113. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  114. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  115. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  116. package/build/features/business/screens/Activities/validation.js +0 -9
  117. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  118. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  119. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  121. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  122. package/build/features/business/screens/BusinessType/LicenseList.js +26 -7
  123. package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
  124. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
  126. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  127. package/build/features/business/screens/BusinessType/validation.js +52 -3
  128. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  129. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  130. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  131. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  132. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  133. package/build/features/business/screens/CivilID/index.js +2 -0
  134. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  135. package/build/features/business/screens/CivilID/validation.js +4 -0
  136. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  137. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  138. package/build/features/business/screens/Customers/Customers.js +15 -9
  139. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  140. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  141. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  142. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  143. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  144. package/build/features/business/screens/OTP/OTP.js +15 -2
  145. package/build/features/business/screens/Success/Success.js +10 -3
  146. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
  147. package/build/features/business/screens/Verify/Verify.js +4 -4
  148. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  153. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  154. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  155. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  156. package/build/features/connect/Connect.d.ts +1 -0
  157. package/build/features/connect/Connect.js +38 -10
  158. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  159. package/build/features/connect/screens/CivilID/CivilID.js +102 -0
  160. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  161. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  162. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  163. package/build/features/connect/screens/CivilID/index.js +2 -0
  164. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  165. package/build/features/connect/screens/CivilID/validation.js +4 -0
  166. package/build/features/connect/screens/Individual/Email.js +11 -3
  167. package/build/features/connect/screens/Individual/Individual.js +44 -28
  168. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  169. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  170. package/build/features/connect/screens/Merchant/Merchant.js +41 -64
  171. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
  172. package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
  173. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  174. package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
  175. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  176. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  177. package/build/features/connect/screens/Merchant/validation.js +108 -173
  178. package/build/features/connect/screens/Mobile/Mobile.js +33 -12
  179. package/build/features/connect/screens/NID/NID.js +5 -1
  180. package/build/features/connect/screens/OTP/OTP.js +20 -6
  181. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  188. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  189. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  190. package/build/features/entity/Entity.js +6 -6
  191. package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
  192. package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
  193. package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
  194. package/build/features/entity/screens/Customers/Customers.js +90 -0
  195. package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
  196. package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
  197. package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
  198. package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
  199. package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
  200. package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
  201. package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
  202. package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
  203. package/build/features/entity/screens/Customers/index.d.ts +3 -0
  204. package/build/features/entity/screens/Customers/index.js +2 -0
  205. package/build/features/entity/screens/Customers/validation.d.ts +20 -0
  206. package/build/features/entity/screens/Customers/validation.js +13 -0
  207. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
  208. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
  209. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  210. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  211. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +38 -10
  212. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  213. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
  214. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
  215. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  216. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
  217. package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
  218. package/build/features/entity/screens/Success/Success.js +7 -3
  219. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -8
  220. package/build/features/entity/screens/Verify/Verify.js +18 -5
  221. package/build/features/featuresScreens.d.ts +0 -1
  222. package/build/features/featuresScreens.js +30 -7
  223. package/build/features/individual/Individual.js +4 -4
  224. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  225. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  226. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  227. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  228. package/build/features/individual/screens/Success/Success.js +7 -3
  229. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  230. package/build/features/individual/screens/Verify/Verify.js +18 -5
  231. package/build/features/password/Password.js +4 -4
  232. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  233. package/build/features/password/screens/OTP/OTP.js +15 -2
  234. package/build/features/password/screens/Success/Success.js +7 -3
  235. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -12
  236. package/build/features/password/screens/Verify/Verify.js +16 -3
  237. package/build/features/shared/Background/Background.d.ts +2 -5
  238. package/build/features/shared/Background/Background.js +7 -3
  239. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  240. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  241. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  242. package/build/features/shared/Button/MobileButton.js +2 -2
  243. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  244. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  245. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  246. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  247. package/build/features/shared/Dialog/index.d.ts +4 -0
  248. package/build/features/shared/Dialog/index.js +4 -0
  249. package/build/features/shared/Input/Input.d.ts +1 -1
  250. package/build/features/shared/Input/Input.js +2 -2
  251. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  252. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  253. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  254. package/build/features/signIn/SignIn.js +4 -4
  255. package/build/features/signIn/screens/Email/Email.js +4 -2
  256. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  257. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  258. package/build/features/signIn/screens/Password/Password.js +15 -2
  259. package/build/features/tax/Tax.js +6 -6
  260. package/build/features/tax/screens/Success/Success.js +9 -3
  261. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -10
  262. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  263. package/build/features/tax/screens/Verify/Verify.js +16 -3
  264. package/build/hooks/index.d.ts +2 -0
  265. package/build/hooks/index.js +2 -0
  266. package/build/hooks/useAppConfig.d.ts +3 -1
  267. package/build/hooks/useAppConfig.js +2 -2
  268. package/build/hooks/useAppDispatch.d.ts +0 -1
  269. package/build/hooks/useErrorListener.js +0 -6
  270. package/build/hooks/useScreen.d.ts +3 -0
  271. package/build/hooks/useScreen.js +14 -0
  272. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  273. package/build/hooks/useSetFromDefaultValues.js +24 -0
  274. package/build/index.css +140 -0
  275. package/build/index.d.ts +2 -3
  276. package/build/index.js +1 -4
  277. package/build/utils/array.d.ts +49 -1
  278. package/build/utils/array.js +58 -0
  279. package/build/utils/common.d.ts +1 -0
  280. package/build/utils/common.js +3 -0
  281. package/build/utils/device.d.ts +1 -0
  282. package/build/utils/device.js +13 -0
  283. package/build/utils/index.d.ts +1 -0
  284. package/build/utils/index.js +1 -0
  285. package/build/utils/locale.js +1 -1
  286. package/build/utils/object.d.ts +1 -0
  287. package/build/utils/object.js +12 -0
  288. package/build/utils/string.d.ts +13 -0
  289. package/build/utils/string.js +71 -1
  290. package/build/utils/validation.d.ts +2 -0
  291. package/build/utils/validation.js +6 -0
  292. package/package.json +4 -3
  293. package/build/features/app/otp/otpStore.d.ts +0 -28
  294. package/build/features/app/otp/otpStore.js +0 -153
  295. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  296. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  297. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  298. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  299. package/build/features/otp/OTP.d.ts +0 -7
  300. package/build/features/otp/OTP.js +0 -58
  301. package/build/features/otp/index.d.ts +0 -0
  302. package/build/features/otp/index.js +0 -1
  303. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  304. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  305. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  306. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  307. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  308. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  309. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  310. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
@@ -12,6 +12,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
12
12
  contact: any;
13
13
  countries: CountryCode[];
14
14
  countryCode: any;
15
+ notification: any;
15
16
  flows: {
16
17
  name: string;
17
18
  status: string;
@@ -33,6 +34,23 @@ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk
33
34
  }, string, {}>;
34
35
  export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
35
36
  data: any;
37
+ boardResponse: {
38
+ user: any;
39
+ brand: any;
40
+ bank_account: any;
41
+ entity: any;
42
+ merchant: any;
43
+ name: any;
44
+ contact: any;
45
+ countries: CountryCode[];
46
+ countryCode: any;
47
+ notification: any;
48
+ flows: {
49
+ name: string;
50
+ status: string;
51
+ url: string;
52
+ }[];
53
+ };
36
54
  formData: {
37
55
  otp: string;
38
56
  };
@@ -49,13 +49,13 @@ var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
- import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
52
+ import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
53
53
  import { BUSINESS_FLOW_SUCCESS, INDIVIDUAl_STEP_NAMES } from '../../../constants';
54
54
  export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
- var payload, settings, data, boardData, countryCode, boardInfoData, countries, board_id, board_info_id, entity, info, hasIndividualCompleted;
56
- var _a, _b, _c;
57
- return __generator(this, function (_d) {
58
- switch (_d.label) {
55
+ var payload, settings, data, boardData, individualData, countryCode, boardInfoData, countries, board_id, board_info_id, notification, _a, id, type, info, hasIndividualCompleted;
56
+ var _b, _c, _d, _e;
57
+ return __generator(this, function (_f) {
58
+ switch (_f.label) {
59
59
  case 0:
60
60
  payload = {
61
61
  service_name: 'tap_email',
@@ -64,50 +64,68 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
64
64
  settings = thunkApi.getState().settings;
65
65
  return [4, API.leadService.verifyLeadToken(payload)];
66
66
  case 1:
67
- data = (_d.sent()).data;
67
+ data = (_f.sent()).data;
68
68
  boardInfoData = undefined;
69
69
  countries = settings.data.countries;
70
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 6];
70
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 10];
71
+ if (data === null || data === void 0 ? void 0 : data.country_code) {
72
+ countryCode = data === null || data === void 0 ? void 0 : data.country_code;
73
+ thunkApi.dispatch(handleSetCountryByIso2(countryCode));
74
+ }
75
+ if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 10];
71
76
  board_id = data === null || data === void 0 ? void 0 : data.id;
72
77
  board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
73
- if (!(!!board_id && !!board_info_id)) return [3, 3];
78
+ if (!(board_id && board_info_id)) return [3, 4];
74
79
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
75
80
  case 2:
76
- boardInfoData = _d.sent();
77
- _d.label = 3;
78
- case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
81
+ boardInfoData = _f.sent();
82
+ notification = (boardInfoData || {}).notification;
83
+ _a = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _a.id, type = _a.type;
84
+ if (!(id && type)) return [3, 4];
85
+ return [4, API.individualService.retrieveIndividual(id, type)];
86
+ case 3:
87
+ individualData = _f.sent();
88
+ _f.label = 4;
79
89
  case 4:
80
- boardData = _d.sent();
81
- entity = ((boardData === null || boardData === void 0 ? void 0 : boardData.business) || {}).entity;
82
- countryCode = entity === null || entity === void 0 ? void 0 : entity.country;
83
- info = boardInfoData.info;
84
- hasIndividualCompleted = ((_a = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _a === void 0 ? void 0 : _a.status) === 'completed';
85
- return [4, thunkApi.dispatch(retrieveDataList(entity === null || entity === void 0 ? void 0 : entity.country))];
90
+ if (!board_id) return [3, 6];
91
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
86
92
  case 5:
87
- _d.sent();
88
- if (data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_AUTH) {
89
- thunkApi.dispatch(handleCurrentActiveScreen('INDIVIDUAL_VERIFY_STEP'));
90
- }
91
- else if (hasIndividualCompleted) {
92
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
93
+ boardData = _f.sent();
94
+ _f.label = 6;
95
+ case 6:
96
+ if (!countryCode) {
97
+ countryCode = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
98
+ if (countryCode)
99
+ thunkApi.dispatch(handleSetCountryByIso2(countryCode));
93
100
  }
94
- else if (data.step_name === INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO) {
95
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
96
- }
97
- _d.label = 6;
98
- case 6: return [2, {
101
+ info = (boardInfoData || {}).info;
102
+ hasIndividualCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
103
+ if (!hasIndividualCompleted) return [3, 7];
104
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
105
+ return [3, 10];
106
+ case 7:
107
+ if (!countryCode) return [3, 9];
108
+ return [4, thunkApi.dispatch(retrieveDataList(countryCode))];
109
+ case 8:
110
+ _f.sent();
111
+ _f.label = 9;
112
+ case 9:
113
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
114
+ _f.label = 10;
115
+ case 10: return [2, {
99
116
  data: data,
100
117
  boardResponse: {
101
- user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
118
+ user: individualData === null || individualData === void 0 ? void 0 : individualData.user,
102
119
  brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
103
120
  bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
104
121
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
105
122
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
106
- name: (_b = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _b === void 0 ? void 0 : _b.name,
107
- contact: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.contact,
123
+ name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names,
124
+ contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact,
108
125
  countries: countries,
109
126
  countryCode: countryCode,
110
- flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info)
127
+ notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
128
+ flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [])
111
129
  },
112
130
  token: token
113
131
  }];
@@ -132,16 +150,24 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
132
150
  });
133
151
  }); });
134
152
  export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', function (countryCode) { return __awaiter(void 0, void 0, void 0, function () {
135
- var _a, sourceIncome, monthlyIncome, occupation;
153
+ var monthlyIncomeBody, dataBody, _a, sourceIncome, monthlyIncome, occupation;
136
154
  return __generator(this, function (_b) {
137
155
  switch (_b.label) {
138
- case 0: return [4, Promise.all([
139
- API.dataService.getSourceOfIncome(),
140
- API.dataService.getMonthlyIncome(countryCode),
141
- API.dataService.getOccupation()
142
- ])];
156
+ case 0:
157
+ monthlyIncomeBody = {
158
+ page: 0,
159
+ country_code: [countryCode]
160
+ };
161
+ dataBody = {
162
+ page: 0
163
+ };
164
+ return [4, Promise.all([
165
+ API.dataService.getSourceOfIncome(dataBody),
166
+ API.dataService.getMonthlyIncome(monthlyIncomeBody),
167
+ API.dataService.getOccupation(dataBody)
168
+ ])];
143
169
  case 1:
144
- _a = _b.sent(), sourceIncome = _a[0].data, monthlyIncome = _a[1].data, occupation = _a[2];
170
+ _a = _b.sent(), sourceIncome = _a[0], monthlyIncome = _a[1], occupation = _a[2];
145
171
  return [2, {
146
172
  sourceIncome: sourceIncome,
147
173
  monthlyIncome: monthlyIncome,
@@ -159,70 +185,114 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
159
185
  case 1:
160
186
  data = _c.sent();
161
187
  return [2, {
162
- data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.name, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
188
+ data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
163
189
  }];
164
190
  }
165
191
  });
166
192
  }); });
167
193
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
168
- var _a, individual, settings, responseBody, payload, data, flows, hasIndividualCompleted;
169
- var _b, _c, _d, _e;
170
- return __generator(this, function (_f) {
171
- switch (_f.label) {
194
+ var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, countryCode, notification, _c, id, type, info, hasIndividualCompleted;
195
+ var _d, _e, _f, _g, _h, _j, _k;
196
+ return __generator(this, function (_l) {
197
+ switch (_l.label) {
172
198
  case 0:
173
199
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
174
200
  responseBody = individual.data.verify.responseBody;
201
+ _b = responseBody || {}, board_id = _b.board_id, board_info_id = _b.board_info_id;
202
+ countries = settings.data.countries;
175
203
  payload = {
176
204
  data: params.otp,
177
- service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
205
+ service_name: (_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name,
178
206
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
179
207
  step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
180
208
  encryption_contract: ['data']
181
209
  };
182
210
  return [4, API.leadService.verifyLeadOTP(payload)];
183
211
  case 1:
184
- data = (_f.sent()).data;
185
- if (!(data === null || data === void 0 ? void 0 : data.errors)) {
186
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
187
- flows = (responseBody || {}).flows;
188
- hasIndividualCompleted = ((_e = flows === null || flows === void 0 ? void 0 : flows.find(function (flow) { return flow.name === 'individual'; })) === null || _e === void 0 ? void 0 : _e.status) === 'completed';
189
- if (hasIndividualCompleted) {
190
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
191
- }
192
- else {
193
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
194
- }
195
- }
196
- return [2, { data: data, formData: __assign({}, params) }];
212
+ data = (_l.sent()).data;
213
+ countryCode = undefined;
214
+ if (!!(data === null || data === void 0 ? void 0 : data.errors)) return [3, 10];
215
+ if (!(board_id && board_info_id)) return [3, 4];
216
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
217
+ case 2:
218
+ boardInfoData = _l.sent();
219
+ notification = (boardInfoData || {}).notification;
220
+ _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
221
+ if (!(id && type)) return [3, 4];
222
+ return [4, API.individualService.retrieveIndividual(id, type)];
223
+ case 3:
224
+ individualData = _l.sent();
225
+ _l.label = 4;
226
+ case 4:
227
+ if (!board_id) return [3, 6];
228
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
229
+ case 5:
230
+ boardData = _l.sent();
231
+ _l.label = 6;
232
+ case 6:
233
+ countryCode = (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.country;
234
+ info = (boardInfoData || {}).info;
235
+ hasIndividualCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
236
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
237
+ if (!hasIndividualCompleted) return [3, 7];
238
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
239
+ return [3, 10];
240
+ case 7:
241
+ if (!countryCode) return [3, 9];
242
+ return [4, thunkApi.dispatch(retrieveDataList(countryCode))];
243
+ case 8:
244
+ _l.sent();
245
+ _l.label = 9;
246
+ case 9:
247
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
248
+ _l.label = 10;
249
+ case 10: return [2, {
250
+ data: data,
251
+ boardResponse: {
252
+ user: individualData === null || individualData === void 0 ? void 0 : individualData.user,
253
+ brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
254
+ bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
255
+ entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
256
+ merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
257
+ name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
258
+ contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
259
+ countries: countries,
260
+ countryCode: countryCode,
261
+ notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
262
+ flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [])
263
+ },
264
+ formData: __assign({}, params)
265
+ }];
197
266
  }
198
267
  });
199
268
  }); });
200
269
  export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
201
- var _a, settings, individual, requestBody, data;
202
- var _b, _c, _d, _e, _f, _g, _h, _j;
203
- return __generator(this, function (_k) {
204
- switch (_k.label) {
270
+ var _a, settings, individual, _b, id, type, requestBody, data;
271
+ var _c, _d, _e, _f, _g, _h, _j, _k;
272
+ return __generator(this, function (_l) {
273
+ switch (_l.label) {
205
274
  case 0:
206
275
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
276
+ _b = ((_d = (_c = individual.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id = _b.id, type = _b.type;
207
277
  requestBody = {
208
- id: (_b = individual.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.individual_id,
209
- lead_id: (_c = individual.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.id,
210
- occupation: (_d = params.occupation) === null || _d === void 0 ? void 0 : _d.id,
278
+ id: id,
279
+ type: type,
280
+ occupation: { id: (_e = params.occupation) === null || _e === void 0 ? void 0 : _e.id },
211
281
  employer_name: params.employerName,
212
- employer_country: (_e = params.employerLocation) === null || _e === void 0 ? void 0 : _e.iso2,
213
- source_income: [(_f = params.sourceIncome) === null || _f === void 0 ? void 0 : _f.id],
214
- actual_income: (_g = params.monthlyIncome) === null || _g === void 0 ? void 0 : _g.id,
282
+ employer_country: (_f = params.employerLocation) === null || _f === void 0 ? void 0 : _f.iso2,
283
+ source_income: [{ id: (_g = params.sourceIncome) === null || _g === void 0 ? void 0 : _g.id }],
284
+ monthly_income: { id: (_h = params.monthlyIncome) === null || _h === void 0 ? void 0 : _h.id },
215
285
  is_relative_PEP: params.isPEP,
216
286
  is_influencer: params.isInfluencer,
217
- encryption_contract: ['employer_name', 'employer_city', 'actual_income', 'source_income[0]'],
287
+ encryption_contract: ['employer_name', 'employer_country'],
218
288
  step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO
219
289
  };
220
- return [4, API.entityService.updateIndividualInfo(requestBody)];
290
+ return [4, API.individualService.updateIndividual(requestBody)];
221
291
  case 1:
222
- data = (_k.sent()).data;
292
+ data = (_l.sent()).data;
223
293
  if (!(data === null || data === void 0 ? void 0 : data.errors)) {
224
294
  thunkApi.dispatch(handleNextScreenStep());
225
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
295
+ (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
226
296
  }
227
297
  return [2, { data: data, formData: params }];
228
298
  }
@@ -252,7 +322,7 @@ export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess',
252
322
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
253
323
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
254
324
  thunkApi.dispatch(handleNextScreenStep());
255
- return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat(data === null || data === void 0 ? void 0 : data.info) }), formData: params }];
325
+ return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat((data === null || data === void 0 ? void 0 : data.info) || []) }), formData: params }];
256
326
  }
257
327
  });
258
328
  }); });
@@ -308,23 +378,25 @@ export var individualSlice = createSlice({
308
378
  state.error = description;
309
379
  return;
310
380
  }
311
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
381
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
312
382
  state.data.verify.token = token;
313
- var _c = boardResponse || {}, countries = _c.countries, countryCode = _c.countryCode, brand = _c.brand;
314
- var _d = brand || {}, source_income = _d.source_income, actual_income = _d.actual_income, occupation = _d.occupation, is_relative_PEP = _d.is_relative_PEP, is_influencer = _d.is_influencer;
383
+ var _c = boardResponse || {}, countries = _c.countries, user = _c.user, countryCode = _c.countryCode;
384
+ var _d = user || {}, source_income = _d.source_income, monthly_income = _d.monthly_income, occupation = _d.occupation, is_relative_PEP = _d.is_relative_PEP, is_influencer = _d.is_influencer;
315
385
  var _e = state.data.individualData.responseBody || {}, sourceIncomeList = _e.sourceIncomeList, monthlyIncomeList = _e.monthlyIncomeList, occupationList = _e.occupationList;
316
- var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a, _b; return ((_a = source === null || source === void 0 ? void 0 : source.name_en) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === ((_b = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase()); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
386
+ 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); })) ||
387
+ (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
317
388
  if (!!selectedSourceIncome)
318
389
  state.data.individualData.sourceIncome = selectedSourceIncome;
319
- var selectedMonthlyIncome = (monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) { var _a; return ((_a = income === null || income === void 0 ? void 0 : income.name_en) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === (actual_income === null || actual_income === void 0 ? void 0 : actual_income.toLocaleLowerCase()); })) || (monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList[2]);
390
+ var selectedMonthlyIncome = (monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) { return (income === null || income === void 0 ? void 0 : income.id) === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id); })) ||
391
+ (monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList[2]);
320
392
  if (!!selectedMonthlyIncome)
321
393
  state.data.individualData.monthlyIncome = selectedMonthlyIncome;
322
- var code = (data === null || data === void 0 ? void 0 : data.employer_country) || countryCode;
394
+ var code = (user === null || user === void 0 ? void 0 : user.employer_country) || countryCode;
323
395
  if (!!code) {
324
396
  var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
325
397
  state.data.individualData.employerLocation = employerLocation;
326
398
  }
327
- var selectedOccupation = (occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (o) { var _a; return ((_a = o === null || o === void 0 ? void 0 : o.name_en) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === (occupation === null || occupation === void 0 ? void 0 : occupation.toLocaleLowerCase()); })) || (occupationList === null || occupationList === void 0 ? void 0 : occupationList[0]);
399
+ var selectedOccupation = (occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (o) { return (o === null || o === void 0 ? void 0 : o.id) === (occupation === null || occupation === void 0 ? void 0 : occupation.id); })) || (occupationList === null || occupationList === void 0 ? void 0 : occupationList[0]);
328
400
  if (!!selectedOccupation)
329
401
  state.data.individualData.occupation = selectedOccupation;
330
402
  state.data.individualData.isPEP = is_relative_PEP;
@@ -359,7 +431,7 @@ export var individualSlice = createSlice({
359
431
  var _a;
360
432
  state.loading = false;
361
433
  state.error = null;
362
- var _b = action.payload, data = _b.data, formData = _b.formData;
434
+ var _b = action.payload, data = _b.data, formData = _b.formData, boardResponse = _b.boardResponse;
363
435
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
364
436
  if (description) {
365
437
  state.error = description;
@@ -367,7 +439,28 @@ export var individualSlice = createSlice({
367
439
  }
368
440
  state.data.otpData = formData;
369
441
  state.data.otpData.responseBody = data;
370
- state.data.individualData = __assign({}, state.data.individualData);
442
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), boardResponse);
443
+ var _c = boardResponse || {}, countries = _c.countries, user = _c.user, countryCode = _c.countryCode;
444
+ var _d = user || {}, source_income = _d.source_income, monthly_income = _d.monthly_income, occupation = _d.occupation, is_relative_PEP = _d.is_relative_PEP, is_influencer = _d.is_influencer;
445
+ var _e = state.data.individualData.responseBody || {}, sourceIncomeList = _e.sourceIncomeList, monthlyIncomeList = _e.monthlyIncomeList, occupationList = _e.occupationList;
446
+ 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); })) ||
447
+ (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
448
+ if (!!selectedSourceIncome)
449
+ state.data.individualData.sourceIncome = selectedSourceIncome;
450
+ var selectedMonthlyIncome = (monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.find(function (income) { return (income === null || income === void 0 ? void 0 : income.id) === (monthly_income === null || monthly_income === void 0 ? void 0 : monthly_income.id); })) ||
451
+ (monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList[2]);
452
+ if (!!selectedMonthlyIncome)
453
+ state.data.individualData.monthlyIncome = selectedMonthlyIncome;
454
+ var code = (user === null || user === void 0 ? void 0 : user.employer_country) || countryCode;
455
+ if (!!code) {
456
+ var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
457
+ state.data.individualData.employerLocation = employerLocation;
458
+ }
459
+ var selectedOccupation = (occupationList === null || occupationList === void 0 ? void 0 : occupationList.find(function (o) { return (o === null || o === void 0 ? void 0 : o.id) === (occupation === null || occupation === void 0 ? void 0 : occupation.id); })) || (occupationList === null || occupationList === void 0 ? void 0 : occupationList[0]);
460
+ if (!!selectedOccupation)
461
+ state.data.individualData.occupation = selectedOccupation;
462
+ state.data.individualData.isPEP = is_relative_PEP;
463
+ state.data.individualData.isInfluencer = is_influencer;
371
464
  })
372
465
  .addCase(verifyLeadOTP.rejected, function (state, action) {
373
466
  state.loading = false;
@@ -382,7 +475,7 @@ export var individualSlice = createSlice({
382
475
  state.error = null;
383
476
  var _a = action.payload, sourceIncome = _a.sourceIncome, monthlyIncome = _a.monthlyIncome, occupation = _a.occupation;
384
477
  var data = state.data.individualData.responseBody;
385
- state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: sourceIncome || [], monthlyIncomeList: monthlyIncome || [], occupationList: occupation || [] });
478
+ state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: (sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.list) || [], monthlyIncomeList: (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.list) || [], occupationList: (occupation === null || occupation === void 0 ? void 0 : occupation.list) || [] });
386
479
  })
387
480
  .addCase(retrieveDataList.rejected, function (state, action) {
388
481
  state.loading = false;
@@ -417,8 +510,8 @@ export var individualSlice = createSlice({
417
510
  state.error = null;
418
511
  state.loading = false;
419
512
  var data = (action.payload || {}).data;
420
- var _a = data || {}, entity = _a.entity, user = _a.user;
421
- state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), data), { entity: entity, name: user === null || user === void 0 ? void 0 : user.name });
513
+ var entity = (data || {}).entity;
514
+ state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), data), { entity: entity });
422
515
  })
423
516
  .addCase(retrieveBoardDetails.rejected, function (state, action) {
424
517
  state.error = action.error.message;
@@ -2,13 +2,7 @@ import { RootState } from '../../../app/store';
2
2
  import { FlowsTypes, OTPFormValues, PasswordCreateFormValues, ResponseData, SharedState } from '../../../@types';
3
3
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  data: any;
5
- boardResponse: {
6
- flows: {
7
- name: string;
8
- status: string;
9
- url: string;
10
- }[];
11
- };
5
+ boardResponse: any;
12
6
  token: string;
13
7
  }, string, {}>;
14
8
  export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
@@ -49,13 +49,13 @@ var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
- import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
52
+ import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
53
53
  import { BUSINESS_FLOW_SUCCESS, PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
54
54
  export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
- var payload, data, boardInfoData, board_id, board_info_id, info, hasPasswordCompleted;
56
- var _a;
57
- return __generator(this, function (_b) {
58
- switch (_b.label) {
55
+ var payload, data, boardInfoData, boardData, board_id, board_info_id, countryIso2, info, hasPasswordCompleted;
56
+ var _a, _b, _c, _d;
57
+ return __generator(this, function (_e) {
58
+ switch (_e.label) {
59
59
  case 0:
60
60
  payload = {
61
61
  service_name: 'tap_email',
@@ -63,21 +63,28 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
63
63
  };
64
64
  return [4, API.leadService.verifyLeadToken(payload)];
65
65
  case 1:
66
- data = (_b.sent()).data;
67
- boardInfoData = undefined;
68
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
66
+ data = (_e.sent()).data;
67
+ boardData = undefined;
68
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 6];
69
69
  board_id = data === null || data === void 0 ? void 0 : data.id;
70
70
  board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
71
- if (!(!!board_id && !!board_info_id)) return [3, 3];
71
+ if (!(board_id && board_info_id)) return [3, 3];
72
72
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
73
73
  case 2:
74
- boardInfoData = _b.sent();
75
- _b.label = 3;
76
- case 3: return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
74
+ boardInfoData = _e.sent();
75
+ _e.label = 3;
76
+ case 3:
77
+ if (!board_id) return [3, 5];
78
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
77
79
  case 4:
78
- _b.sent();
79
- info = boardInfoData.info;
80
- hasPasswordCompleted = ((_a = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _a === void 0 ? void 0 : _a.status) === 'completed';
80
+ boardData = _e.sent();
81
+ _e.label = 5;
82
+ case 5:
83
+ countryIso2 = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.country;
84
+ if (countryIso2)
85
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
86
+ info = (boardInfoData || {}).info;
87
+ hasPasswordCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
81
88
  if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
82
89
  thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
83
90
  }
@@ -87,8 +94,12 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
87
94
  else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
88
95
  thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
89
96
  }
90
- _b.label = 5;
91
- case 5: return [2, { data: data, boardResponse: { flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) }, token: token }];
97
+ _e.label = 6;
98
+ case 6: return [2, {
99
+ data: data,
100
+ boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []), user: boardData === null || boardData === void 0 ? void 0 : boardData.user, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names, contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact }),
101
+ token: token
102
+ }];
92
103
  }
93
104
  });
94
105
  }); });
@@ -118,7 +129,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails
118
129
  case 1:
119
130
  data = _c.sent();
120
131
  return [2, {
121
- data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.name, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
132
+ data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
122
133
  }];
123
134
  }
124
135
  });
@@ -202,7 +213,7 @@ export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', f
202
213
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
203
214
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
204
215
  thunkApi.dispatch(handleNextScreenStep());
205
- return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat(data === null || data === void 0 ? void 0 : data.info) }), formData: params }];
216
+ return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat((data === null || data === void 0 ? void 0 : data.info) || []) }), formData: params }];
206
217
  }
207
218
  });
208
219
  }); });
@@ -227,7 +238,7 @@ export var verifyOperationToken = createAsyncThunk('verifyOperationToken', funct
227
238
  _a.label = 3;
228
239
  case 3:
229
240
  thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
230
- return [2, { data: data, token: token, boardId: boardId, flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) }];
241
+ return [2, { data: data, token: token, boardId: boardId, flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []) }];
231
242
  }
232
243
  });
233
244
  }); });