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

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 (298) 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 +8 -2
  25. package/build/app/settings.js +21 -10
  26. package/build/app/store.d.ts +1 -3
  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/FileInput/DragAndDrop.d.ts +10 -1
  41. package/build/components/FileInput/DragAndDrop.js +108 -8
  42. package/build/components/Lottie/Lottie.d.ts +878 -0
  43. package/build/components/Lottie/Lottie.js +58 -0
  44. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  45. package/build/components/Lottie/files/success.json +425 -0
  46. package/build/components/Lottie/index.d.ts +3 -0
  47. package/build/components/Lottie/index.js +3 -0
  48. package/build/components/OTPField/OTPField.d.ts +2 -1
  49. package/build/components/OTPField/OTPField.js +2 -2
  50. package/build/components/OTPTimer/OTPTimer.js +1 -1
  51. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  52. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  53. package/build/components/ProgressBar/index.d.ts +2 -0
  54. package/build/components/ProgressBar/index.js +2 -0
  55. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  56. package/build/components/RadioLabel/RadioLabel.js +2 -2
  57. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  59. package/build/constants/api.d.ts +6 -0
  60. package/build/constants/api.js +14 -1
  61. package/build/constants/app.d.ts +4 -5
  62. package/build/constants/app.js +51 -28
  63. package/build/constants/assets.d.ts +14 -0
  64. package/build/constants/assets.js +16 -2
  65. package/build/constants/dummy.d.ts +1 -1
  66. package/build/constants/dummy.js +2 -2
  67. package/build/constants/validation.d.ts +10 -0
  68. package/build/constants/validation.js +11 -1
  69. package/build/features/app/auth/authStore.d.ts +30 -4
  70. package/build/features/app/auth/authStore.js +182 -20
  71. package/build/features/app/bank/bankStore.d.ts +16 -0
  72. package/build/features/app/bank/bankStore.js +88 -41
  73. package/build/features/app/business/businessStore.d.ts +22 -3
  74. package/build/features/app/business/businessStore.js +445 -296
  75. package/build/features/app/connect/connectStore.d.ts +34 -31
  76. package/build/features/app/connect/connectStore.js +427 -300
  77. package/build/features/app/entity/entityStore.d.ts +29 -7
  78. package/build/features/app/entity/entityStore.js +253 -148
  79. package/build/features/app/individual/individualStore.d.ts +18 -0
  80. package/build/features/app/individual/individualStore.js +178 -85
  81. package/build/features/app/password/passwordStore.js +5 -5
  82. package/build/features/app/tax/taxStore.js +23 -16
  83. package/build/features/auth/Auth.d.ts +3 -1
  84. package/build/features/auth/Auth.js +40 -11
  85. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  86. package/build/features/auth/screens/NID/DOB.js +47 -0
  87. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  88. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  89. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  90. package/build/features/auth/screens/NID/NID.js +68 -0
  91. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  92. package/build/features/auth/screens/NID/TAC.js +87 -0
  93. package/build/features/auth/screens/NID/index.d.ts +3 -0
  94. package/build/features/auth/screens/NID/index.js +2 -0
  95. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  96. package/build/features/auth/screens/NID/validation.js +19 -0
  97. package/build/features/auth/screens/OTP/OTP.js +8 -4
  98. package/build/features/auth/screens/OTP/OTPInput.js +9 -2
  99. package/build/features/bank/Bank.js +4 -4
  100. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  101. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  102. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  103. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  104. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  105. package/build/features/bank/screens/Success/Success.js +7 -3
  106. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  107. package/build/features/business/Business.d.ts +1 -1
  108. package/build/features/business/Business.js +7 -6
  109. package/build/features/business/screens/Activities/Activities.js +16 -17
  110. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  111. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  112. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  113. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  114. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  115. package/build/features/business/screens/Activities/validation.js +0 -9
  116. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  117. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  118. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  119. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  121. package/build/features/business/screens/BusinessType/LicenseList.js +26 -7
  122. package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
  123. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  124. package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
  125. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  126. package/build/features/business/screens/BusinessType/validation.js +52 -3
  127. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  128. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  129. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  130. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  131. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  132. package/build/features/business/screens/CivilID/index.js +2 -0
  133. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  134. package/build/features/business/screens/CivilID/validation.js +4 -0
  135. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  136. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  137. package/build/features/business/screens/Customers/Customers.js +15 -9
  138. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  139. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  140. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  141. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  142. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  143. package/build/features/business/screens/OTP/OTP.js +15 -2
  144. package/build/features/business/screens/Success/Success.js +10 -3
  145. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
  146. package/build/features/business/screens/Verify/Verify.js +4 -4
  147. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  148. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  153. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  154. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  155. package/build/features/connect/Connect.d.ts +2 -1
  156. package/build/features/connect/Connect.js +41 -12
  157. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  158. package/build/features/connect/screens/CivilID/CivilID.js +102 -0
  159. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  160. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  161. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  162. package/build/features/connect/screens/CivilID/index.js +2 -0
  163. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  164. package/build/features/connect/screens/CivilID/validation.js +4 -0
  165. package/build/features/connect/screens/Individual/Email.js +11 -3
  166. package/build/features/connect/screens/Individual/Individual.js +44 -28
  167. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  168. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  169. package/build/features/connect/screens/Merchant/Merchant.js +41 -64
  170. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +3 -1
  171. package/build/features/connect/screens/Merchant/SalesChannels.js +30 -31
  172. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  173. package/build/features/connect/screens/Merchant/SocialMedia.js +129 -109
  174. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  175. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  176. package/build/features/connect/screens/Merchant/validation.js +108 -173
  177. package/build/features/connect/screens/Mobile/Mobile.js +33 -12
  178. package/build/features/connect/screens/NID/NID.js +5 -1
  179. package/build/features/connect/screens/OTP/OTP.js +20 -6
  180. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  181. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  187. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  188. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  189. package/build/features/entity/Entity.d.ts +1 -1
  190. package/build/features/entity/Entity.js +9 -8
  191. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
  192. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
  193. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  194. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  195. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +38 -10
  196. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  197. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
  198. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
  199. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  200. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
  201. package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
  202. package/build/features/entity/screens/Success/Success.js +7 -3
  203. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +9 -8
  204. package/build/features/entity/screens/Verify/Verify.js +18 -5
  205. package/build/features/featuresScreens.d.ts +0 -1
  206. package/build/features/featuresScreens.js +25 -7
  207. package/build/features/individual/Individual.d.ts +1 -1
  208. package/build/features/individual/Individual.js +7 -6
  209. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  210. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  211. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  212. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  213. package/build/features/individual/screens/Success/Success.js +7 -3
  214. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  215. package/build/features/individual/screens/Verify/Verify.js +18 -5
  216. package/build/features/password/Password.d.ts +1 -1
  217. package/build/features/password/Password.js +7 -6
  218. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  219. package/build/features/password/screens/OTP/OTP.js +15 -2
  220. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -12
  221. package/build/features/password/screens/Verify/Verify.js +16 -3
  222. package/build/features/shared/Background/Background.d.ts +2 -5
  223. package/build/features/shared/Background/Background.js +7 -3
  224. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  225. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  226. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  227. package/build/features/shared/Button/MobileButton.js +2 -2
  228. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  229. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  230. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  231. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  232. package/build/features/shared/Dialog/index.d.ts +4 -0
  233. package/build/features/shared/Dialog/index.js +4 -0
  234. package/build/features/shared/Input/Input.d.ts +1 -1
  235. package/build/features/shared/Input/Input.js +2 -2
  236. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  237. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  238. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  239. package/build/features/signIn/SignIn.d.ts +1 -1
  240. package/build/features/signIn/SignIn.js +7 -6
  241. package/build/features/signIn/screens/Email/Email.js +4 -2
  242. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  243. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  244. package/build/features/signIn/screens/Password/Password.js +15 -2
  245. package/build/features/tax/Tax.d.ts +1 -1
  246. package/build/features/tax/Tax.js +9 -8
  247. package/build/features/tax/screens/Success/Success.js +9 -3
  248. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -10
  249. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  250. package/build/features/tax/screens/Verify/Verify.js +16 -3
  251. package/build/hooks/index.d.ts +2 -0
  252. package/build/hooks/index.js +2 -0
  253. package/build/hooks/useAppConfig.d.ts +3 -1
  254. package/build/hooks/useAppConfig.js +2 -2
  255. package/build/hooks/useAppDispatch.d.ts +0 -1
  256. package/build/hooks/useErrorListener.js +0 -6
  257. package/build/hooks/useScreen.d.ts +3 -0
  258. package/build/hooks/useScreen.js +14 -0
  259. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  260. package/build/hooks/useSetFromDefaultValues.js +24 -0
  261. package/build/index.d.ts +2 -3
  262. package/build/index.js +1 -4
  263. package/build/utils/array.d.ts +49 -1
  264. package/build/utils/array.js +58 -0
  265. package/build/utils/common.d.ts +1 -0
  266. package/build/utils/common.js +3 -0
  267. package/build/utils/device.d.ts +1 -0
  268. package/build/utils/device.js +13 -0
  269. package/build/utils/index.d.ts +1 -0
  270. package/build/utils/index.js +1 -0
  271. package/build/utils/locale.js +1 -1
  272. package/build/utils/object.d.ts +1 -0
  273. package/build/utils/object.js +12 -0
  274. package/build/utils/rsa.d.ts +2 -2
  275. package/build/utils/rsa.js +1 -1
  276. package/build/utils/string.d.ts +33 -20
  277. package/build/utils/string.js +71 -1
  278. package/build/utils/validation.d.ts +2 -0
  279. package/build/utils/validation.js +6 -0
  280. package/package.json +5 -4
  281. package/build/features/app/otp/otpStore.d.ts +0 -28
  282. package/build/features/app/otp/otpStore.js +0 -153
  283. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  284. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  285. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  286. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  287. package/build/features/otp/OTP.d.ts +0 -7
  288. package/build/features/otp/OTP.js +0 -58
  289. package/build/features/otp/index.d.ts +0 -0
  290. package/build/features/otp/index.js +0 -1
  291. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  292. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  293. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  294. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  295. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  296. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  297. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  298. 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;
@@ -76,7 +76,7 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
76
76
  case 3: return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
77
77
  case 4:
78
78
  _b.sent();
79
- info = boardInfoData.info;
79
+ info = (boardInfoData || {}).info;
80
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';
81
81
  if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
82
82
  thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
@@ -88,7 +88,7 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
88
88
  thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
89
89
  }
90
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 }];
91
+ case 5: return [2, { data: data, boardResponse: { flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []) }, token: token }];
92
92
  }
93
93
  });
94
94
  }); });
@@ -118,7 +118,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails
118
118
  case 1:
119
119
  data = _c.sent();
120
120
  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 })
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.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
122
122
  }];
123
123
  }
124
124
  });
@@ -202,7 +202,7 @@ export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', f
202
202
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
203
203
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
204
204
  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 }];
205
+ return [2, { response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat((data === null || data === void 0 ? void 0 : data.info) || []) }), formData: params }];
206
206
  }
207
207
  });
208
208
  }); });
@@ -227,7 +227,7 @@ export var verifyOperationToken = createAsyncThunk('verifyOperationToken', funct
227
227
  _a.label = 3;
228
228
  case 3:
229
229
  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) }];
230
+ return [2, { data: data, token: token, boardId: boardId, flows: BUSINESS_FLOW_SUCCESS.concat((boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []) }];
231
231
  }
232
232
  });
233
233
  }); });
@@ -50,13 +50,13 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
52
  import { hasKey } from '../../../utils';
53
- import { handleNextScreenStep, handleCurrentActiveScreen } from '../../../app/settings';
53
+ import { handleNextScreenStep, handleCurrentActiveScreen, handleSetCountryByIso2 } from '../../../app/settings';
54
54
  import { BUSINESS_FLOW_SUCCESS, TAX_STEP_NAMES } from '../../../constants';
55
55
  export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
- var payload, data, boardData, boardInfoData, info, hasTaxCompleted;
57
- var _a, _b;
58
- return __generator(this, function (_c) {
59
- switch (_c.label) {
56
+ var payload, data, boardData, boardInfoData, info, countryIso2, hasTaxCompleted;
57
+ var _a, _b, _c;
58
+ return __generator(this, function (_d) {
59
+ switch (_d.label) {
60
60
  case 0:
61
61
  payload = {
62
62
  service_name: 'tap_email',
@@ -64,20 +64,23 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (to
64
64
  };
65
65
  return [4, API.leadService.verifyLeadToken(payload)];
66
66
  case 1:
67
- data = (_c.sent()).data;
67
+ data = (_d.sent()).data;
68
68
  boardInfoData = undefined;
69
69
  if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
70
70
  if (!(!!data.id && !!data.board_info_id)) return [3, 3];
71
71
  return [4, API.boardService.retrieveBoardInfo({ id: data.id, infoId: data.board_info_id })];
72
72
  case 2:
73
- boardInfoData = _c.sent();
74
- _c.label = 3;
73
+ boardInfoData = _d.sent();
74
+ _d.label = 3;
75
75
  case 3:
76
- info = boardInfoData.info;
76
+ info = (boardInfoData || {}).info;
77
77
  return [4, API.boardService.retrieveBoardDetails(data === null || data === void 0 ? void 0 : data.id)];
78
78
  case 4:
79
- boardData = _c.sent();
80
- hasTaxCompleted = ((_a = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'tax'; })) === null || _a === void 0 ? void 0 : _a.status) === 'completed';
79
+ boardData = _d.sent();
80
+ countryIso2 = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.country;
81
+ if (countryIso2)
82
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
83
+ hasTaxCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'tax'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
81
84
  if (hasTaxCompleted) {
82
85
  thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
83
86
  }
@@ -87,10 +90,10 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (to
87
90
  else if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
88
91
  thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP'));
89
92
  }
90
- _c.label = 5;
93
+ _d.label = 5;
91
94
  case 5: return [2, {
92
95
  data: data,
93
- 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), entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant }),
96
+ 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) || []), entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant }),
94
97
  token: token
95
98
  }];
96
99
  }
@@ -207,7 +210,7 @@ export var updateLeadSuccess = createAsyncThunk('taxUpdateLeadSuccess', function
207
210
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
208
211
  thunkApi.dispatch(handleNextScreenStep());
209
212
  return [2, {
210
- response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat(data === null || data === void 0 ? void 0 : data.info), user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant }),
213
+ response: __assign(__assign({}, data), { flows: BUSINESS_FLOW_SUCCESS.concat((data === null || data === void 0 ? void 0 : data.info) || []), user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant }),
211
214
  formData: params
212
215
  }];
213
216
  }
@@ -257,8 +260,9 @@ export var taxSlice = createSlice({
257
260
  state.error = description;
258
261
  return;
259
262
  }
260
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id, name: user.name, bank_account: bank_account, vatID: vatID, merchant: merchant });
263
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id, name: user === null || user === void 0 ? void 0 : user.names, bank_account: bank_account, vatID: vatID, merchant: merchant });
261
264
  state.data.verify.token = token;
265
+ state.data.taxData.vatId = vatID;
262
266
  })
263
267
  .addCase(verifyLeadToken.pending, function (state) {
264
268
  state.error = null;
@@ -350,6 +354,7 @@ export var taxSlice = createSlice({
350
354
  .addCase(updateLeadSuccess.fulfilled, function (state, action) {
351
355
  var _a;
352
356
  state.loading = false;
357
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: false });
353
358
  state.error = null;
354
359
  var response = (action.payload || {}).response;
355
360
  var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -358,14 +363,16 @@ export var taxSlice = createSlice({
358
363
  return;
359
364
  }
360
365
  var flows = response.flows, steps = response.steps, user = response.user, bank_account = response.bank_account, vatID = response.vatID, merchant = response.merchant;
361
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps, bank_account: bank_account, name: user.name, vatID: vatID, merchant: merchant });
366
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps, bank_account: bank_account, name: user === null || user === void 0 ? void 0 : user.names, vatID: vatID, merchant: merchant });
362
367
  })
363
368
  .addCase(updateLeadSuccess.pending, function (state) {
364
369
  state.loading = true;
370
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: true });
365
371
  state.error = null;
366
372
  })
367
373
  .addCase(updateLeadSuccess.rejected, function (state, action) {
368
374
  state.loading = false;
375
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: false });
369
376
  state.error = action.error.message;
370
377
  });
371
378
  }
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { LibConfig } from '../../@types';
3
3
  export interface AuthLibProps extends LibConfig {
4
+ postURL: string;
4
5
  leadId: string;
6
+ onClose?: () => void;
5
7
  }
6
8
  export declare function AuthLib(props: AuthLibProps): JSX.Element;
7
9
  export declare function renderAuthLib(config: AuthLibProps, elementId: string): void;
8
- export declare function unmountAuthLib(elementId: string): void;
10
+ export declare function unmountAuthLib(elementId: string, unmountTimeout?: number): void;