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

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 (557) hide show
  1. package/build/@types/app.d.ts +46 -8
  2. package/build/@types/app.js +16 -0
  3. package/build/@types/config.d.ts +21 -64
  4. package/build/@types/form.d.ts +11 -1
  5. package/build/@types/redux.d.ts +1 -0
  6. package/build/@types/theme.d.ts +1 -1
  7. package/build/@types/theme.js +1 -1
  8. package/build/api/account.d.ts +4 -0
  9. package/build/api/account.js +9 -2
  10. package/build/api/auth.d.ts +35 -20
  11. package/build/api/auth.js +1 -1
  12. package/build/api/data.d.ts +4 -17
  13. package/build/api/data.js +5 -45
  14. package/build/api/entity.d.ts +5 -2
  15. package/build/api/entity.js +12 -4
  16. package/build/api/firebase.js +68 -8
  17. package/build/api/index.d.ts +13 -25
  18. package/build/api/lead.d.ts +16 -3
  19. package/build/api/lead.js +16 -0
  20. package/build/api/user.d.ts +7 -0
  21. package/build/api/user.js +9 -1
  22. package/build/app/rootReducer.d.ts +1 -0
  23. package/build/app/rootReducer.js +3 -1
  24. package/build/app/settings.d.ts +3 -2
  25. package/build/app/settings.js +56 -29
  26. package/build/app/store.d.ts +2 -0
  27. package/build/assets/locales/ar.json +353 -151
  28. package/build/assets/locales/en.json +349 -150
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -6
  30. package/build/components/AnimationFlow/AnimationFlow.js +5 -5
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +5 -3
  32. package/build/components/AnimationFlow/BottomSheet.js +43 -14
  33. package/build/components/AnimationFlow/Dialog.d.ts +4 -4
  34. package/build/components/AnimationFlow/Dialog.js +5 -3
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
  37. package/build/components/ArabicDatePicker/style.css +32 -3
  38. package/build/components/DatePicker/DatePicker.d.ts +1 -1
  39. package/build/components/DatePicker/DatePicker.js +2 -2
  40. package/build/components/Footer/Footer.js +2 -1
  41. package/build/components/Input/Input.js +1 -1
  42. package/build/components/Providers/ThemeProvider.js +3 -3
  43. package/build/components/Tooltip/Tooltip.js +1 -1
  44. package/build/constants/api.d.ts +5 -7
  45. package/build/constants/api.js +11 -15
  46. package/build/constants/app.d.ts +39 -0
  47. package/build/constants/app.js +345 -35
  48. package/build/constants/assets.d.ts +3 -0
  49. package/build/constants/assets.js +4 -1
  50. package/build/constants/dummy.d.ts +4 -219
  51. package/build/constants/dummy.js +64 -6194
  52. package/build/constants/flows.d.ts +26 -0
  53. package/build/constants/flows.js +27 -0
  54. package/build/constants/index.d.ts +1 -0
  55. package/build/constants/index.js +1 -0
  56. package/build/constants/validation.d.ts +2 -0
  57. package/build/constants/validation.js +2 -0
  58. package/build/features/app/auth/authStore.d.ts +29 -15
  59. package/build/features/app/auth/authStore.js +454 -155
  60. package/build/features/app/bank/bankStore.d.ts +13 -18
  61. package/build/features/app/bank/bankStore.js +186 -153
  62. package/build/features/app/board/boardStore.d.ts +5 -1
  63. package/build/features/app/board/boardStore.js +82 -51
  64. package/build/features/app/brand/brandStore.d.ts +17 -33
  65. package/build/features/app/brand/brandStore.js +254 -257
  66. package/build/features/app/business/businessStore.d.ts +37 -15
  67. package/build/features/app/business/businessStore.js +407 -223
  68. package/build/features/app/connect/connectStore.d.ts +34 -13
  69. package/build/features/app/connect/connectStore.js +317 -123
  70. package/build/features/app/connectExpress/connectExpressStore.d.ts +53 -30
  71. package/build/features/app/connectExpress/connectExpressStore.js +601 -370
  72. package/build/features/app/entity/entityStore.d.ts +20 -36
  73. package/build/features/app/entity/entityStore.js +204 -238
  74. package/build/features/app/individual/individualStore.d.ts +18 -34
  75. package/build/features/app/individual/individualStore.js +269 -292
  76. package/build/features/app/kyc/kycStore.d.ts +67 -0
  77. package/build/features/app/kyc/kycStore.js +408 -0
  78. package/build/features/app/password/passwordStore.d.ts +33 -18
  79. package/build/features/app/password/passwordStore.js +260 -219
  80. package/build/features/app/signIn/signInStore.js +19 -15
  81. package/build/features/app/tax/taxStore.d.ts +13 -7
  82. package/build/features/app/tax/taxStore.js +170 -136
  83. package/build/features/auth/Auth.d.ts +5 -6
  84. package/build/features/auth/Auth.js +44 -21
  85. package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
  86. package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
  87. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
  88. package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
  89. package/build/features/auth/screens/AuthSwitch/index.js +2 -0
  90. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
  91. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
  92. package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
  93. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
  94. package/build/features/auth/screens/CivilID/CivilID.js +4 -35
  95. package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
  96. package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
  97. package/build/features/auth/screens/DOB/DOBForm.js +59 -0
  98. package/build/features/auth/screens/DOB/index.d.ts +3 -0
  99. package/build/features/auth/screens/DOB/index.js +2 -0
  100. package/build/features/{business/screens/OTP → auth/screens/DOB}/validation.d.ts +4 -4
  101. package/build/features/auth/screens/DOB/validation.js +4 -0
  102. package/build/features/auth/screens/Email/Email.d.ts +5 -0
  103. package/build/features/auth/screens/Email/Email.js +57 -0
  104. package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
  105. package/build/features/auth/screens/Email/EmailField.js +52 -0
  106. package/build/features/auth/screens/Email/index.d.ts +3 -0
  107. package/build/features/auth/screens/Email/index.js +2 -0
  108. package/build/features/auth/screens/Email/validation.d.ts +8 -0
  109. package/build/features/auth/screens/Email/validation.js +4 -0
  110. package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
  111. package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
  112. package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
  113. package/build/features/auth/screens/EmailSent/index.js +2 -0
  114. package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
  115. package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
  116. package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
  117. package/build/features/auth/screens/MigratingData/index.js +2 -0
  118. package/build/features/auth/screens/Mobile/Mobile.js +6 -38
  119. package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
  120. package/build/features/auth/screens/Mobile/validation.js +11 -3
  121. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  122. package/build/features/auth/screens/NID/NID.js +7 -43
  123. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  124. package/build/features/auth/screens/NID/validation.js +0 -1
  125. package/build/features/auth/screens/OTP/OTP.js +41 -10
  126. package/build/features/auth/screens/OTP/OTPInput.js +23 -6
  127. package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
  128. package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
  129. package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
  130. package/build/features/auth/screens/OperatorError/index.js +2 -0
  131. package/build/features/auth/screens/Password/Password.d.ts +5 -0
  132. package/build/features/auth/screens/Password/Password.js +61 -0
  133. package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
  134. package/build/features/auth/screens/Password/PasswordField.js +28 -0
  135. package/build/features/auth/screens/Password/index.d.ts +3 -0
  136. package/build/features/auth/screens/Password/index.js +2 -0
  137. package/build/features/auth/screens/Password/validation.d.ts +8 -0
  138. package/build/features/auth/screens/Password/validation.js +4 -0
  139. package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
  140. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
  141. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
  142. package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
  143. package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
  144. package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  145. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
  146. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  147. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  148. package/build/features/bank/Bank.d.ts +5 -1
  149. package/build/features/bank/Bank.js +22 -9
  150. package/build/features/bank/screens/BankDetails/BankDetails.js +20 -6
  151. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
  152. package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
  153. package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
  154. package/build/features/bank/screens/OperatorError/index.js +2 -0
  155. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  156. package/build/features/bank/screens/Verify/Verify.js +7 -6
  157. package/build/features/board/Board.d.ts +2 -0
  158. package/build/features/board/Board.js +24 -13
  159. package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
  160. package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
  161. package/build/features/board/screens/OperatorError/index.d.ts +3 -0
  162. package/build/features/board/screens/OperatorError/index.js +2 -0
  163. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  164. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  165. package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
  166. package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
  167. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
  168. package/build/features/board/screens/Verify/Verify.js +3 -2
  169. package/build/features/brand/Brand.d.ts +5 -1
  170. package/build/features/brand/Brand.js +22 -9
  171. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +7 -7
  172. package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
  173. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
  174. package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
  175. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
  176. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
  177. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  178. package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
  179. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  180. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  181. package/build/features/brand/screens/BrandInfo/BrandInfo.js +26 -6
  182. package/build/features/brand/screens/BrandInfo/BrandName.js +5 -2
  183. package/build/features/brand/screens/BrandInfo/validation.js +2 -2
  184. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
  185. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
  186. package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
  187. package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
  188. package/build/features/brand/screens/OperatorError/index.js +2 -0
  189. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  190. package/build/features/brand/screens/Verify/Verify.js +3 -2
  191. package/build/features/business/Business.js +20 -12
  192. package/build/features/business/screens/Activities/Activities.js +26 -9
  193. package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
  194. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  195. package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
  196. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  197. package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
  198. package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
  199. package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
  200. package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
  201. package/build/features/business/screens/Customers/CustomerLocations.d.ts +12 -10
  202. package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
  203. package/build/features/business/screens/Customers/Customers.js +50 -10
  204. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
  205. package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
  206. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
  207. package/build/features/business/screens/Customers/ExpectedSalesRange.js +11 -5
  208. package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
  209. package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
  210. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
  211. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
  212. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  213. package/build/features/business/screens/Customers/validation.js +3 -8
  214. package/build/features/business/screens/DOB/DOB.d.ts +6 -0
  215. package/build/features/business/screens/DOB/DOB.js +45 -0
  216. package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
  217. package/build/features/business/screens/DOB/DOBForm.js +72 -0
  218. package/build/features/business/screens/DOB/index.d.ts +3 -0
  219. package/build/features/business/screens/DOB/index.js +2 -0
  220. package/build/features/{connectExpress/screens/IdentityOTP → business/screens/DOB}/validation.d.ts +4 -4
  221. package/build/features/business/screens/DOB/validation.js +4 -0
  222. package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
  223. package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
  224. package/build/features/business/screens/IDBOD/validation.js +0 -1
  225. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  226. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
  227. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
  228. package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
  229. package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
  230. package/build/features/business/screens/MobileOwnership/index.js +2 -0
  231. package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
  232. package/build/features/business/screens/MobileOwnership/validation.js +38 -0
  233. package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
  234. package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
  235. package/build/features/business/screens/OperatorError/index.d.ts +3 -0
  236. package/build/features/business/screens/OperatorError/index.js +2 -0
  237. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
  238. package/build/features/business/screens/Verify/Verify.js +15 -4
  239. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  240. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
  241. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  242. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  243. package/build/features/connect/Connect.d.ts +5 -1
  244. package/build/features/connect/Connect.js +22 -17
  245. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
  246. package/build/features/connect/screens/CivilID/CivilID.js +6 -1
  247. package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
  248. package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
  249. package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
  250. package/build/features/connect/screens/DOB/DOBForm.js +59 -0
  251. package/build/features/connect/screens/DOB/index.d.ts +3 -0
  252. package/build/features/connect/screens/DOB/index.js +2 -0
  253. package/build/features/connect/screens/DOB/validation.d.ts +8 -0
  254. package/build/features/connect/screens/DOB/validation.js +4 -0
  255. package/build/features/connect/screens/Individual/Email.js +1 -3
  256. package/build/features/connect/screens/Individual/Individual.js +11 -5
  257. package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
  258. package/build/features/connect/screens/Individual/validation.js +11 -3
  259. package/build/features/connect/screens/Merchant/BrandName.js +5 -2
  260. package/build/features/connect/screens/Merchant/validation.js +2 -2
  261. package/build/features/connect/screens/Mobile/Mobile.js +12 -9
  262. package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
  263. package/build/features/connect/screens/Mobile/validation.js +11 -3
  264. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  265. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +105 -0
  266. package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  267. package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
  268. package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
  269. package/build/features/connect/screens/MobileOwnership/index.js +2 -0
  270. package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
  271. package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
  272. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  273. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  274. package/build/features/connect/screens/NID/NID.js +5 -11
  275. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  276. package/build/features/connect/screens/NID/validation.js +0 -1
  277. package/build/features/connect/screens/OTP/OTP.js +6 -6
  278. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  279. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  280. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  281. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
  282. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  283. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  284. package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
  285. package/build/features/connectExpress/ConnectExpress.js +63 -42
  286. package/build/features/connectExpress/screens/AccountAlreadyCreated/AccountAlreadyCreated.js +14 -2
  287. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
  288. package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
  289. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
  290. package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
  291. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +5 -2
  292. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
  293. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  294. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
  295. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
  296. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +2 -2
  297. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
  298. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  299. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
  300. package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
  301. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
  302. package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
  303. package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
  304. package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
  305. package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
  306. package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
  307. package/build/features/connectExpress/screens/DOB/index.js +2 -0
  308. package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
  309. package/build/features/connectExpress/screens/DOB/validation.js +4 -0
  310. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  311. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
  312. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  313. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  314. package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
  315. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
  316. package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
  317. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  318. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +107 -0
  319. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  320. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
  321. package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
  322. package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
  323. package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
  324. package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
  325. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  326. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  327. package/build/features/connectExpress/screens/NID/NID.js +10 -10
  328. package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
  329. package/build/features/connectExpress/screens/NID/TAC.js +2 -2
  330. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  331. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  332. package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
  333. package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
  334. package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
  335. package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
  336. package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
  337. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
  338. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
  339. package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
  340. package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
  341. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
  342. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
  343. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
  344. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
  345. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
  346. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  347. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +35 -0
  348. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  349. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  350. package/build/features/entity/Entity.d.ts +4 -1
  351. package/build/features/entity/Entity.js +22 -9
  352. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
  353. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
  354. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
  355. package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
  356. package/build/features/entity/screens/EntityName/EntityName.js +33 -15
  357. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +7 -7
  358. package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
  359. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
  360. package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
  361. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
  362. package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
  363. package/build/features/entity/screens/EntityName/LegalName.js +1 -13
  364. package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
  365. package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
  366. package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
  367. package/build/features/entity/screens/EntityName/validation.js +1 -10
  368. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
  369. package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
  370. package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
  371. package/build/features/entity/screens/OperatorError/index.js +2 -0
  372. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  373. package/build/features/entity/screens/Verify/Verify.js +3 -2
  374. package/build/features/featuresScreens.d.ts +1 -0
  375. package/build/features/featuresScreens.js +211 -13
  376. package/build/features/individual/Individual.d.ts +4 -1
  377. package/build/features/individual/Individual.js +22 -9
  378. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
  379. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
  380. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
  381. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
  382. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
  383. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
  384. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  385. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
  386. package/build/features/individual/screens/IndividualList/IndividualList.js +21 -6
  387. package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
  388. package/build/features/individual/screens/IndividualList/UserList.js +7 -7
  389. package/build/features/individual/screens/IndividualList/validation.js +11 -4
  390. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  391. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
  392. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
  393. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +76 -20
  394. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
  395. package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
  396. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
  397. package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
  398. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
  399. package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
  400. package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
  401. package/build/features/individual/screens/OperatorError/index.js +2 -0
  402. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  403. package/build/features/individual/screens/Verify/Verify.js +3 -2
  404. package/build/features/kyc/KYC.d.ts +11 -0
  405. package/build/features/kyc/KYC.js +99 -0
  406. package/build/features/kyc/index.d.ts +1 -0
  407. package/build/features/kyc/index.js +1 -0
  408. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
  409. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
  410. package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
  411. package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
  412. package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
  413. package/build/features/kyc/screens/Loading/Loading.js +10 -0
  414. package/build/features/kyc/screens/Loading/index.d.ts +2 -0
  415. package/build/features/kyc/screens/Loading/index.js +2 -0
  416. package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
  417. package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
  418. package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
  419. package/build/features/kyc/screens/OperatorError/index.js +2 -0
  420. package/build/features/kyc/screens/Success/Success.d.ts +5 -0
  421. package/build/features/kyc/screens/Success/Success.js +32 -0
  422. package/build/features/kyc/screens/Success/index.d.ts +2 -0
  423. package/build/features/kyc/screens/Success/index.js +2 -0
  424. package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
  425. package/build/features/kyc/screens/Terms/Header.js +36 -0
  426. package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
  427. package/build/features/kyc/screens/Terms/Terms.js +81 -0
  428. package/build/features/kyc/screens/Terms/index.d.ts +2 -0
  429. package/build/features/kyc/screens/Terms/index.js +2 -0
  430. package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
  431. package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
  432. package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
  433. package/build/features/kyc/screens/TokenError/index.js +2 -0
  434. package/build/features/kyc/screens/Users/Users.d.ts +3 -0
  435. package/build/features/kyc/screens/Users/Users.js +76 -0
  436. package/build/features/kyc/screens/Users/index.d.ts +2 -0
  437. package/build/features/kyc/screens/Users/index.js +2 -0
  438. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  439. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
  440. package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
  441. package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
  442. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
  443. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
  444. package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
  445. package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
  446. package/build/features/password/Password.d.ts +4 -1
  447. package/build/features/password/Password.js +88 -31
  448. package/build/features/password/screens/CreatePassword/CreatePassword.js +10 -4
  449. package/build/features/password/screens/OTP/OTP.js +3 -3
  450. package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
  451. package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
  452. package/build/features/password/screens/OperatorError/index.d.ts +3 -0
  453. package/build/features/password/screens/OperatorError/index.js +2 -0
  454. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  455. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  456. package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
  457. package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
  458. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  459. package/build/features/password/screens/Verify/Verify.js +7 -6
  460. package/build/features/shared/Address/CountryList.d.ts +6 -6
  461. package/build/features/shared/Address/InputSelect.d.ts +6 -6
  462. package/build/features/shared/Background/Background.js +1 -1
  463. package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
  464. package/build/features/shared/Button/Button.js +3 -1
  465. package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
  466. package/build/features/shared/Button/FlowsButtons.js +18 -4
  467. package/build/features/shared/Button/NafathButton.d.ts +8 -0
  468. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
  469. package/build/features/shared/Button/index.d.ts +2 -2
  470. package/build/features/shared/Button/index.js +2 -2
  471. package/build/features/shared/Calender/Calender.d.ts +2 -1
  472. package/build/features/shared/Calender/Calender.js +3 -3
  473. package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
  474. package/build/features/shared/Containers/FeatureContainer.js +5 -3
  475. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  476. package/build/features/shared/Dialog/DialogContainer.js +5 -4
  477. package/build/features/shared/Input/Input.d.ts +2 -2
  478. package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
  479. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  480. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  481. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  482. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  483. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  484. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  485. package/build/features/shared/NafathVerification/index.js +2 -0
  486. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
  487. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
  488. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  489. package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
  490. package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
  491. package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
  492. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
  493. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
  494. package/build/features/signIn/SignIn.js +18 -7
  495. package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
  496. package/build/features/signIn/screens/Mobile/validation.js +11 -3
  497. package/build/features/signIn/screens/OTP/OTP.js +5 -4
  498. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
  499. package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
  500. package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
  501. package/build/features/signIn/screens/OperatorError/index.js +2 -0
  502. package/build/features/tax/Tax.d.ts +4 -1
  503. package/build/features/tax/Tax.js +22 -9
  504. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
  505. package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
  506. package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
  507. package/build/features/tax/screens/OperatorError/index.js +2 -0
  508. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  509. package/build/features/tax/screens/TaxDetails/TaxDetails.js +9 -3
  510. package/build/features/tax/screens/Verify/Verify.js +7 -6
  511. package/build/hooks/index.d.ts +3 -0
  512. package/build/hooks/index.js +3 -0
  513. package/build/hooks/useAppConfig.d.ts +3 -3
  514. package/build/hooks/useAppConfig.js +4 -3
  515. package/build/hooks/useAppDispatch.d.ts +1 -0
  516. package/build/hooks/useAppTheme.js +4 -6
  517. package/build/hooks/useCountDown.d.ts +10 -0
  518. package/build/hooks/useCountDown.js +17 -0
  519. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  520. package/build/hooks/useFormDirtyCheck.js +66 -0
  521. package/build/hooks/useSanitizedTranslation.d.ts +2 -0
  522. package/build/hooks/useSanitizedTranslation.js +15 -0
  523. package/build/hooks/useVerifyToken.d.ts +4 -2
  524. package/build/hooks/useVerifyToken.js +9 -4
  525. package/build/index.css +360 -120
  526. package/build/index.d.ts +3 -2
  527. package/build/index.js +4 -2
  528. package/build/theme/components.js +7 -0
  529. package/build/theme/palette.js +2 -1
  530. package/build/theme/shadows.js +1 -1
  531. package/build/theme/theme.d.ts +1 -1
  532. package/build/theme/theme.js +2 -2
  533. package/build/utils/array.js +2 -2
  534. package/build/utils/common.d.ts +1 -0
  535. package/build/utils/common.js +16 -3
  536. package/build/utils/object.d.ts +1 -0
  537. package/build/utils/object.js +3 -0
  538. package/build/utils/string.d.ts +6 -2
  539. package/build/utils/string.js +28 -3
  540. package/build/utils/validation.d.ts +2 -0
  541. package/build/utils/validation.js +6 -0
  542. package/package.json +2 -2
  543. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  544. package/build/features/business/screens/OTP/OTP.js +0 -90
  545. package/build/features/business/screens/OTP/OTPInput.d.ts +0 -5
  546. package/build/features/business/screens/OTP/OTPInput.js +0 -49
  547. package/build/features/business/screens/OTP/index.d.ts +0 -3
  548. package/build/features/business/screens/OTP/index.js +0 -2
  549. package/build/features/business/screens/OTP/validation.js +0 -4
  550. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +0 -87
  551. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  552. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
  553. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  554. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  555. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  556. package/build/features/shared/Button/AbsherButton.d.ts +0 -8
  557. /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
@@ -58,16 +58,15 @@ var _a;
58
58
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
59
  import API from '../../../api';
60
60
  import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
61
- import { BUSINESS_STEP_NAMES, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
62
- import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA } from '../../../utils';
61
+ import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE, defaultCountry } from '../../../constants';
62
+ import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix } from '../../../utils';
63
63
  import { handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
64
64
  export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
- var settings, payload, data, publicKey, countryIso2, boardData, brandData, currencyData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
65
+ var payload, data, publicKey, countryIso2, boardData, brandData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
66
66
  var _b, _c;
67
67
  return __generator(this, function (_d) {
68
68
  switch (_d.label) {
69
69
  case 0:
70
- settings = thunkApi.getState().settings;
71
70
  payload = {
72
71
  service_name: 'tap_email',
73
72
  verify_token: token
@@ -86,9 +85,9 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
86
85
  countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
87
86
  if (countryIso2)
88
87
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
89
- if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 21];
88
+ if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 20];
90
89
  boardData = undefined;
91
- brandData = void 0, currencyData = undefined, isicActivityList = undefined;
90
+ brandData = void 0, isicActivityList = undefined;
92
91
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
93
92
  case 2:
94
93
  leadData = (_d.sent()).data;
@@ -101,7 +100,10 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
101
100
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && (isSA(countryIso2) || isOtherThanKWOrSA(countryIso2))) {
102
101
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
103
102
  }
104
- if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 20];
103
+ if (data.step_name === COLLECT_DOB_INFO_NAFATH) {
104
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_DOB_STEP'));
105
+ }
106
+ if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 19];
105
107
  _a = leadData || {}, steps = _a.steps, brand = _a.brand, board_id = _a.board_id, business_id = _a.business_id, entity = _a.entity;
106
108
  brandID = brand === null || brand === void 0 ? void 0 : brand.id;
107
109
  hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
@@ -119,64 +121,61 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
119
121
  _d.label = 5;
120
122
  case 5:
121
123
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
122
- return [3, 20];
124
+ return [3, 19];
123
125
  case 6:
124
126
  if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 7];
125
127
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
126
- return [3, 20];
128
+ return [3, 19];
127
129
  case 7:
128
130
  if (!hasBusinessCustomersCompleted) return [3, 8];
129
131
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
130
- return [3, 20];
132
+ return [3, 19];
131
133
  case 8:
132
- if (!hasBusinessCRActivitiesCompleted) return [3, 13];
133
- return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
134
- case 9:
135
- currencyData = _d.sent();
134
+ if (!hasBusinessCRActivitiesCompleted) return [3, 12];
136
135
  return [4, API.dataService.getActivitiesIsIc()];
137
- case 10:
136
+ case 9:
138
137
  list = (_d.sent()).list;
139
138
  isicActivityList = list || [];
140
139
  return [4, thunkApi.dispatch(retrieveDataList())];
141
- case 11:
140
+ case 10:
142
141
  _d.sent();
143
142
  return [4, API.brandService.retrieveBrand(brandID)];
144
- case 12:
143
+ case 11:
145
144
  brandData = _d.sent();
146
145
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
147
- return [3, 20];
148
- case 13:
149
- if (!hasBusinessCRInfoCompleted) return [3, 16];
146
+ return [3, 19];
147
+ case 12:
148
+ if (!hasBusinessCRInfoCompleted) return [3, 15];
150
149
  return [4, API.dataService.getActivitiesIsIc()];
151
- case 14:
150
+ case 13:
152
151
  list = (_d.sent()).list;
153
152
  isicActivityList = list || [];
154
153
  return [4, API.brandService.retrieveBrand(brandID)];
155
- case 15:
154
+ case 14:
156
155
  brandData = _d.sent();
157
156
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
158
- return [3, 20];
159
- case 16: return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
160
- case 17:
157
+ return [3, 19];
158
+ case 15: return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
159
+ case 16:
161
160
  _d.sent();
162
- if (!isSA(countryIso2)) return [3, 19];
161
+ if (!isSA(countryIso2)) return [3, 18];
163
162
  return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
164
- case 18:
163
+ case 17:
165
164
  _d.sent();
166
- _d.label = 19;
167
- case 19:
165
+ _d.label = 18;
166
+ case 18:
168
167
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
169
- _d.label = 20;
170
- case 20: return [2, {
168
+ _d.label = 19;
169
+ case 19: return [2, {
171
170
  data: data,
171
+ verifyNextStepName: data.step_name,
172
172
  isicActivityList: isicActivityList,
173
173
  leadData: __assign(__assign({}, leadData), { flows: (boardData === null || boardData === void 0 ? void 0 : boardData.info) || [] }),
174
174
  token: token,
175
175
  brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
176
- boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id,
177
- currencyData: currencyData
176
+ boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id
178
177
  }];
179
- case 21: return [2, { data: data, isRequireOTP: true, token: token }];
178
+ case 20: return [2, { data: data, isRequireOTP: true, token: token, verifyNextStepName: data.step_name }];
180
179
  }
181
180
  });
182
181
  }); });
@@ -193,12 +192,12 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
193
192
  return [4, API.leadService.verifyLeadToken(payload)];
194
193
  case 1:
195
194
  data = (_a.sent()).data;
196
- return [2, { data: data }];
195
+ return [2, { data: data, verifyNextStepName: data.step_name }];
197
196
  }
198
197
  });
199
198
  }); });
200
199
  export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
201
- var _a, business, settings, isNID, responseBody, stepName, payload, data, publicKey, brandData, isicActivityList, currencyData, leadData, brand, country_code, steps, board_id, business_id, entity, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, boardResponse, list, list;
200
+ var _a, business, settings, isNID, responseBody, stepName, payload, data, publicKey, brandData, isicActivityList, leadData, brand, country_code, steps, board_id, business_id, entity, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, boardResponse, list, list;
202
201
  var _b, _c, _d, _e, _f, _g, _h, _j;
203
202
  return __generator(this, function (_k) {
204
203
  switch (_k.label) {
@@ -223,7 +222,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
223
222
  if (publicKey) {
224
223
  thunkApi.dispatch(handlePublicKey(publicKey));
225
224
  }
226
- currencyData = undefined;
225
+ isicActivityList = undefined;
227
226
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
228
227
  case 2:
229
228
  leadData = (_k.sent()).data;
@@ -277,14 +276,15 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
277
276
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP')); });
278
277
  return [3, 23];
279
278
  case 13:
280
- if (!hasBusinessCustomersCompleted) return [3, 14];
281
- sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP')); });
279
+ if (!(data.step_name === COLLECT_DOB_INFO_NAFATH)) return [3, 14];
280
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_DOB_STEP')); });
282
281
  return [3, 23];
283
282
  case 14:
284
- if (!hasBusinessCRActivitiesCompleted) return [3, 19];
285
- return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
283
+ if (!hasBusinessCustomersCompleted) return [3, 15];
284
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP')); });
285
+ return [3, 23];
286
286
  case 15:
287
- currencyData = _k.sent();
287
+ if (!hasBusinessCRActivitiesCompleted) return [3, 19];
288
288
  return [4, API.dataService.getActivitiesIsIc()];
289
289
  case 16:
290
290
  list = (_k.sent()).list;
@@ -311,7 +311,121 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
311
311
  case 22:
312
312
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP')); });
313
313
  _k.label = 23;
314
- case 23: return [2, { data: data, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData, currencyData: currencyData }];
314
+ case 23: return [2, { data: data, verifyNextStepName: data.step_name, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
315
+ }
316
+ });
317
+ }); });
318
+ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
319
+ var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess, isFailed, isNextScreenDob, isNextScreenCollectMobileOwnership, screen_1;
320
+ var _b, _c, _d, _e, _f, _g;
321
+ return __generator(this, function (_h) {
322
+ switch (_h.label) {
323
+ case 0:
324
+ _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
325
+ responseBody = business.data.nidData.responseBody;
326
+ expiry = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.expiry) || 120;
327
+ interval = 5;
328
+ maxCalls = Math.floor(expiry / interval);
329
+ if (thunkApi.signal.aborted) {
330
+ return [2, { response: null }];
331
+ }
332
+ count = 1;
333
+ _h.label = 1;
334
+ case 1:
335
+ if (!(count <= maxCalls)) return [3, 8];
336
+ return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
337
+ case 2:
338
+ data = _h.sent();
339
+ isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
340
+ isFailed = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
341
+ if (isFailed) {
342
+ (_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
343
+ return [2, { response: data }];
344
+ }
345
+ if (!isSuccess) return [3, 5];
346
+ return [4, thunkApi.dispatch(retrieveEntityList({ leadId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.id }))];
347
+ case 3:
348
+ _h.sent();
349
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
350
+ (_g = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _g === void 0 ? void 0 : _g.call(params);
351
+ return [4, sleep(3000)];
352
+ case 4:
353
+ _h.sent();
354
+ isNextScreenDob = data.step_name === COLLECT_DOB_INFO_NAFATH;
355
+ isNextScreenCollectMobileOwnership = data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP;
356
+ if (isNextScreenCollectMobileOwnership) {
357
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
358
+ }
359
+ else {
360
+ screen_1 = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
361
+ thunkApi.dispatch(handleNextScreenStep(screen_1));
362
+ }
363
+ return [2, { response: data, isNextScreenDob: isNextScreenDob }];
364
+ case 5: return [4, sleep(interval * 1000)];
365
+ case 6:
366
+ _h.sent();
367
+ _h.label = 7;
368
+ case 7:
369
+ count++;
370
+ return [3, 1];
371
+ case 8: throw new Error(NAFATH_VERIFICATION_FAILED);
372
+ }
373
+ });
374
+ }); });
375
+ export var updateLeadMobile = createAsyncThunk('connect/updateLeadMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
376
+ var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
377
+ var _b, _c;
378
+ return __generator(this, function (_d) {
379
+ switch (_d.label) {
380
+ case 0:
381
+ _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
382
+ lead_id = (business.data.verify.responseBody || {}).lead_id;
383
+ payload = {
384
+ id: lead_id || '',
385
+ contact: {
386
+ phone: {
387
+ country_code: params.countryCode.idd_prefix.toString(),
388
+ number: params.mobile
389
+ }
390
+ },
391
+ step_name: BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP,
392
+ encryption_contract: ['contact.phone.country_code', 'contact.phone.number']
393
+ };
394
+ return [4, API.leadService.updateLead(payload)];
395
+ case 1:
396
+ leadResponse = _d.sent();
397
+ if (leadResponse.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP) {
398
+ throw new Error("The new mobile number doesn't match the national ID, please update the mobile to the correct one");
399
+ }
400
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, params);
401
+ isNextScreenDob = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
402
+ screen = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
403
+ thunkApi.dispatch(handleNextScreenStep(screen));
404
+ return [2, { leadResponse: leadResponse, formData: params }];
405
+ }
406
+ });
407
+ }); });
408
+ export var skipUpdateLeadMobile = createAsyncThunk('connect/skipUpdateLeadMobile', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
409
+ var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
410
+ var _b, _c;
411
+ return __generator(this, function (_d) {
412
+ switch (_d.label) {
413
+ case 0:
414
+ _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
415
+ lead_id = (business.data.verify.responseBody || {}).lead_id;
416
+ payload = {
417
+ id: lead_id || '',
418
+ step_name: BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP_SKIPPED,
419
+ encryption_contract: []
420
+ };
421
+ return [4, API.leadService.updateLead(payload)];
422
+ case 1:
423
+ leadResponse = _d.sent();
424
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, {});
425
+ isNextScreenDob = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
426
+ screen = isNextScreenDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_BUSINESS_TYPE_STEP';
427
+ thunkApi.dispatch(handleNextScreenStep(screen));
428
+ return [2, { leadResponse: leadResponse }];
315
429
  }
316
430
  });
317
431
  }); });
@@ -389,20 +503,20 @@ export var createCivilIdAuth = createAsyncThunk('createCivilIdAuth', function (p
389
503
  });
390
504
  }); });
391
505
  export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
392
- var _a, settings, business, identification_id_type, stepName, lead_id, countryIso2, dob, requestBody, data, business_id, entity, screen;
506
+ var _a, settings, business, identification_id_type, stepName, lead_id, countryIso2, dob, requestBody, data, business_id, entity, screen, countryCode;
393
507
  var _b, _c;
394
508
  return __generator(this, function (_d) {
395
509
  switch (_d.label) {
396
510
  case 0:
397
511
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
398
- identification_id_type = params.nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
512
+ identification_id_type = IDENTIFICATION_TYPE.NAFATH;
399
513
  stepName = BUSINESS_STEP_NAMES.IDENTITY_AUTH;
400
514
  lead_id = (business.data.verify.responseBody || {}).lead_id;
401
515
  countryIso2 = settings.data.businessCountry.iso2;
402
- dob = dateFormat(new Date(params.dob));
403
516
  if (isOtherThanKWOrSA(countryIso2)) {
404
517
  identification_id_type = IDENTIFICATION_TYPE.NID;
405
518
  }
519
+ dob = identification_id_type === IDENTIFICATION_TYPE.NAFATH ? undefined : dateFormat(new Date(params.dob));
406
520
  requestBody = {
407
521
  id: lead_id || '',
408
522
  identification: {
@@ -418,49 +532,59 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
418
532
  case 1:
419
533
  data = _d.sent();
420
534
  business_id = data.business_id, entity = data.entity;
421
- screen = 'BUSINESS_OTP_STEP';
422
- if (!isOtherThanKWOrSA(countryIso2)) return [3, 4];
535
+ screen = 'BUSINESS_VERIFY_NAFATH_STEP';
536
+ if (!isOtherThanKWOrSA(countryIso2)) return [3, 3];
423
537
  screen = 'BUSINESS_BUSINESS_TYPE_STEP';
424
538
  return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
425
539
  case 2:
426
540
  _d.sent();
427
- if (!isSA(countryIso2)) return [3, 4];
428
- return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
541
+ _d.label = 3;
429
542
  case 3:
430
- _d.sent();
431
- _d.label = 4;
432
- case 4:
433
543
  thunkApi.dispatch(handleNextScreenStep(screen));
434
544
  (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
435
- return [2, { data: data, formData: __assign(__assign({}, params), { type: identification_id_type }) }];
545
+ countryCode = settings.data.businessCountry;
546
+ if (data.contact.phone.country_code)
547
+ countryCode = findCountryByIddPrefix(settings.data.countries, data.contact.phone.country_code);
548
+ return [2, { data: data, formData: __assign(__assign({}, params), { type: identification_id_type }), countryCode: countryCode }];
436
549
  }
437
550
  });
438
551
  }); });
439
- export var resendOTPLeadIdentity = createAsyncThunk('resendOTPLeadIdentity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
440
- var _a, settings, business, _b, nid, dob, type, stepName, lead_id, date_of_birth, requestBody, data;
441
- return __generator(this, function (_c) {
442
- switch (_c.label) {
552
+ export var updateLeadDOB = createAsyncThunk('business/updateLeadDOB', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
553
+ var _a, settings, business, stepName, _b, lead_id, verifyNextStepName, requestBody, data;
554
+ var _c, _d, _e, _f;
555
+ return __generator(this, function (_g) {
556
+ switch (_g.label) {
443
557
  case 0:
444
558
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
445
- _b = business.data.nidData, nid = _b.nid, dob = _b.dob, type = _b.type;
446
- stepName = BUSINESS_STEP_NAMES.IDENTITY_AUTH;
447
- lead_id = (business.data.verify.responseBody || {}).lead_id;
448
- date_of_birth = dateFormat(new Date(dob));
559
+ stepName = BUSINESS_STEP_NAMES.BUSINESS_DOB_INFO;
560
+ _b = business.data.verify.responseBody || {}, lead_id = _b.lead_id, verifyNextStepName = _b.verifyNextStepName;
449
561
  requestBody = {
450
562
  id: lead_id || '',
451
- identification: {
452
- id: nid,
453
- issued_country_code: settings.data.businessCountry.iso2,
454
- type: type
455
- },
456
- date_of_birth: date_of_birth,
563
+ date_of_birth: params.dob,
457
564
  step_name: stepName,
458
- encryption_contract: ['identification.issued_country_code', 'identification.id', 'identification.type', 'date_of_birth']
565
+ encryption_contract: ['date_of_birth']
459
566
  };
460
567
  return [4, API.leadService.updateLead(requestBody)];
461
568
  case 1:
462
- data = _c.sent();
463
- return [2, data];
569
+ data = _g.sent();
570
+ if (!(verifyNextStepName === COLLECT_DOB_INFO_NAFATH)) return [3, 4];
571
+ return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: data.business_id, entityId: (_c = data.entity) === null || _c === void 0 ? void 0 : _c.id }))];
572
+ case 2:
573
+ _g.sent();
574
+ if (!isSA((_d = settings.data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2)) return [3, 4];
575
+ return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
576
+ case 3:
577
+ _g.sent();
578
+ _g.label = 4;
579
+ case 4:
580
+ if (data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP) {
581
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
582
+ }
583
+ else {
584
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
585
+ }
586
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
587
+ return [2, { data: data, formData: params }];
464
588
  }
465
589
  });
466
590
  }); });
@@ -497,13 +621,13 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
497
621
  case 1:
498
622
  data = _c.sent();
499
623
  return [2, {
500
- 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, individuals: data === null || data === void 0 ? void 0 : data.individuals, board_id: data === null || data === void 0 ? void 0 : data.id })
624
+ 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, individuals: data === null || data === void 0 ? void 0 : data.individuals, board_id: data === null || data === void 0 ? void 0 : data.id, board_status: data === null || data === void 0 ? void 0 : data.status })
501
625
  }];
502
626
  }
503
627
  });
504
628
  }); });
505
629
  export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
506
- var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, brandData, data_1, brandRes, _c, message, error, list, documentData, entityData, entityId, documentBody, payload_1;
630
+ var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, documentData, entityData, brandData, data_1, brandRes, _c, message, error, list, entityId, documentBody, payload_1;
507
631
  var _d, _e, _f;
508
632
  return __generator(this, function (_g) {
509
633
  switch (_g.label) {
@@ -564,6 +688,8 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
564
688
  error = message;
565
689
  if ((error === null || error === void 0 ? void 0 : error.toLowerCase()) === 'entity with license already exist') {
566
690
  stepName = 'BUSINESS_VERIFY_BRAND_INFO';
691
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep(stepName)); });
692
+ return [2, { data: data, formData: params, accountData: accountData, documentData: documentData, entityData: entityData, isicActivityList: [] }];
567
693
  }
568
694
  else
569
695
  throw new Error(error);
@@ -571,7 +697,6 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
571
697
  case 8: return [4, API.dataService.getActivitiesIsIc()];
572
698
  case 9:
573
699
  list = (_g.sent()).list;
574
- entityData = undefined;
575
700
  entityId = accountData === null || accountData === void 0 ? void 0 : accountData.entity_id;
576
701
  if (!((certificateId || []).length > 0)) return [3, 11];
577
702
  documentBody = {
@@ -598,137 +723,147 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
598
723
  entityData = _g.sent();
599
724
  _g.label = 13;
600
725
  case 13:
601
- thunkApi.dispatch(handleNextScreenStep(stepName));
726
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep(stepName)); });
602
727
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
603
728
  return [2, { data: __assign(__assign({}, data), { brand: brandData }), formData: params, accountData: accountData, documentData: documentData, entityData: entityData, isicActivityList: list || [] }];
604
729
  }
605
730
  });
606
731
  }); });
607
- export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
608
- var _a, settings, business, _b, brand, entity_activities, entity, _c, brandActivities, brandId, activities, operationStartDate, stepName, id, removedActivities, payload, newBrandActivities, newEntityActivities, activityPayload, requestBody, data, currencyData;
609
- var _d, _e;
610
- return __generator(this, function (_f) {
611
- switch (_f.label) {
612
- case 0:
613
- _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
614
- _b = business.data.verify.responseBody || {}, brand = _b.brand, entity_activities = _b.entity_activities, entity = _b.entity;
615
- _c = brand || {}, brandActivities = _c.activities, brandId = _c.id;
616
- activities = params.activities, operationStartDate = params.operationStartDate;
617
- stepName = BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES;
618
- id = brandId;
619
- removedActivities = (brandActivities || []).filter(function (brandActivity) { return !(activities || []).some(function (activity) { return activity.id === brandActivity.id; }); });
620
- if (!(removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length)) return [3, 2];
621
- payload = {
622
- id: id,
623
- activities: removedActivities.map(function (_a) {
624
- var id = _a.id;
625
- return ({ id: id });
626
- })
627
- };
628
- return [4, API.brandService.removeBrandActivity(payload)];
629
- case 1:
630
- _f.sent();
631
- _f.label = 2;
632
- case 2:
633
- newBrandActivities = activities === null || activities === void 0 ? void 0 : activities.filter(function (act) { return !(brandActivities || []).some(function (brandActivity) { return act.id === brandActivity.id; }); });
634
- newEntityActivities = activities === null || activities === void 0 ? void 0 : activities.filter(function (act) { return !(entity_activities || []).some(function (entityActivity) { return act.id === entityActivity.id; }); });
635
- if (!(newEntityActivities === null || newEntityActivities === void 0 ? void 0 : newEntityActivities.length)) return [3, 4];
636
- activityPayload = {
637
- id: entity === null || entity === void 0 ? void 0 : entity.id,
638
- activities: newEntityActivities.map(function (_a) {
639
- var id = _a.id;
640
- return ({ id: id });
641
- })
642
- };
643
- return [4, API.entityService.updateEntityActivity(activityPayload)];
644
- case 3:
645
- _f.sent();
646
- _f.label = 4;
647
- case 4:
648
- requestBody = __assign(__assign({ id: id }, ((newBrandActivities === null || newBrandActivities === void 0 ? void 0 : newBrandActivities.length) && { activities: newBrandActivities.map(function (_a) {
649
- var id = _a.id;
650
- return ({ id: id });
651
- }) })), { operations: {
652
- start_date: operationStartDate
653
- }, step_name: stepName, encryption_contract: ['operations.start_date'] });
654
- return [4, API.brandService.updateBrandInfo(requestBody)];
655
- case 5:
656
- data = _f.sent();
657
- thunkApi.dispatch(retrieveDataList());
658
- return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
659
- case 6:
660
- currencyData = _f.sent();
661
- thunkApi.dispatch(updateStepName(stepName));
662
- thunkApi.dispatch(handleNextScreenStep());
663
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
664
- return [2, { data: data === null || data === void 0 ? void 0 : data.brand, formData: __assign({}, params), currencyData: currencyData }];
665
- }
732
+ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', function (_a, thunkApi) {
733
+ var formData = _a.formData, originalFormData = _a.originalFormData;
734
+ return __awaiter(void 0, void 0, void 0, function () {
735
+ var _b, settings, business, _c, brand, entity_activities, entity, _d, brandActivities, brandId, data_status, activities, operationStartDate, isActivitiesNonEditable, isOperationStartDateNonEditable, stepName, id, removedActivities, payload, newBrandActivities, newEntityActivities, activityPayload, requestBody, data;
736
+ var _e, _f;
737
+ return __generator(this, function (_g) {
738
+ switch (_g.label) {
739
+ case 0:
740
+ _b = thunkApi.getState(), settings = _b.settings, business = _b.business;
741
+ _c = business.data.verify.responseBody || {}, brand = _c.brand, entity_activities = _c.entity_activities, entity = _c.entity;
742
+ _d = brand || {}, brandActivities = _d.activities, brandId = _d.id, data_status = _d.data_status;
743
+ activities = formData.activities, operationStartDate = formData.operationStartDate;
744
+ isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
745
+ isOperationStartDateNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'business_start_date');
746
+ stepName = BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES;
747
+ id = brandId;
748
+ removedActivities = (brandActivities || []).filter(function (brandActivity) { return !(activities || []).some(function (activity) { return activity.id === brandActivity.id; }); });
749
+ if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length))) return [3, 2];
750
+ payload = {
751
+ id: id,
752
+ activities: removedActivities.map(function (_a) {
753
+ var id = _a.id;
754
+ return ({ id: id });
755
+ })
756
+ };
757
+ return [4, API.brandService.removeBrandActivity(payload)];
758
+ case 1:
759
+ _g.sent();
760
+ _g.label = 2;
761
+ case 2:
762
+ newBrandActivities = activities === null || activities === void 0 ? void 0 : activities.filter(function (act) { return !(brandActivities || []).some(function (brandActivity) { return act.id === brandActivity.id; }); });
763
+ newEntityActivities = activities === null || activities === void 0 ? void 0 : activities.filter(function (act) { return !(entity_activities || []).some(function (entityActivity) { return act.id === entityActivity.id; }); });
764
+ if (!(!isActivitiesNonEditable && (newEntityActivities === null || newEntityActivities === void 0 ? void 0 : newEntityActivities.length))) return [3, 4];
765
+ activityPayload = {
766
+ id: entity === null || entity === void 0 ? void 0 : entity.id,
767
+ activities: newEntityActivities.map(function (_a) {
768
+ var id = _a.id;
769
+ return ({ id: id });
770
+ })
771
+ };
772
+ return [4, API.entityService.updateEntityActivity(activityPayload)];
773
+ case 3:
774
+ _g.sent();
775
+ _g.label = 4;
776
+ case 4:
777
+ requestBody = __assign(__assign(__assign({ id: id }, ((newBrandActivities === null || newBrandActivities === void 0 ? void 0 : newBrandActivities.length) && !isActivitiesNonEditable && { activities: newBrandActivities.map(function (_a) {
778
+ var id = _a.id;
779
+ return ({ id: id });
780
+ }) })), (!isOperationStartDateNonEditable && {
781
+ operations: {
782
+ start_date: operationStartDate
783
+ }
784
+ })), { step_name: stepName, encryption_contract: ['operations.start_date'] });
785
+ return [4, API.brandService.updateBrandInfo(requestBody)];
786
+ case 5:
787
+ data = _g.sent();
788
+ return [4, thunkApi.dispatch(retrieveDataList())];
789
+ case 6:
790
+ _g.sent();
791
+ thunkApi.dispatch(updateStepName(stepName));
792
+ thunkApi.dispatch(handleNextScreenStep());
793
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
794
+ return [2, { data: data === null || data === void 0 ? void 0 : data.brand, formData: originalFormData }];
795
+ }
796
+ });
666
797
  });
667
- }); });
798
+ });
668
799
  export var retrieveDataList = createAsyncThunk('businessRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
669
- var settings, countryISO2, dataBody, salesDataBody, _a, customerBases, expectedSales, expectedCustomerSales;
670
- return __generator(this, function (_b) {
671
- switch (_b.label) {
800
+ var settings, countryISO2, dataBody, _a, customer_base, sales, expected_customers;
801
+ var _b;
802
+ return __generator(this, function (_c) {
803
+ switch (_c.label) {
672
804
  case 0:
673
805
  settings = thunkApi.getState().settings;
674
806
  countryISO2 = settings.data.businessCountry.iso2;
675
807
  dataBody = {
676
- page: 0
677
- };
678
- salesDataBody = {
679
808
  page: 0,
680
809
  country_code: [countryISO2]
681
810
  };
682
- return [4, Promise.all([
683
- API.dataService.getCustomerBases(dataBody),
684
- API.dataService.getExpectedSales(salesDataBody),
685
- API.dataService.getExpectedCustomerSales(dataBody)
686
- ])];
811
+ return [4, API.dataService.getBrandOperations(dataBody)];
687
812
  case 1:
688
- _a = _b.sent(), customerBases = _a[0].list, expectedSales = _a[1].list, expectedCustomerSales = _a[2].list;
813
+ _a = _c.sent(), customer_base = _a.customer_base, sales = _a.sales, expected_customers = _a.expected_customers;
689
814
  return [2, {
690
- customerBases: customerBases,
691
- expectedSales: (expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) ? expectedSales : EXPECTED_SALES_LIST,
692
- expectedCustomerSales: expectedCustomerSales,
815
+ customerBases: (customer_base === null || customer_base === void 0 ? void 0 : customer_base.list) || [],
816
+ expectedSales: ((_b = sales === null || sales === void 0 ? void 0 : sales.list) === null || _b === void 0 ? void 0 : _b.length) ? sales.list : EXPECTED_SALES_LIST,
817
+ expectedCustomerSales: (expected_customers === null || expected_customers === void 0 ? void 0 : expected_customers.list) || [],
693
818
  countryISO2: countryISO2
694
819
  }];
695
820
  }
696
821
  });
697
822
  }); });
698
- export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
699
- var _a, settings, business, id, customerLocation, customerBase, sales, stepName, requestBody, data;
700
- var _b, _c, _d, _e, _f, _g;
701
- return __generator(this, function (_h) {
702
- switch (_h.label) {
703
- case 0:
704
- _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
705
- id = (_c = (_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) === null || _c === void 0 ? void 0 : _c.id;
706
- customerLocation = params.customerLocations.map(function (location) { return ({
707
- id: location === null || location === void 0 ? void 0 : location.id
708
- }); });
709
- customerBase = { id: ((_d = params.expectedCustomer) === null || _d === void 0 ? void 0 : _d.id) || '', period: 'monthly', locations: customerLocation };
710
- sales = { id: ((_e = params.expectedSale) === null || _e === void 0 ? void 0 : _e.id) || '', period: 'monthly' };
711
- stepName = BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS;
712
- requestBody = {
713
- operations: {
714
- customer_base: customerBase,
715
- sales: sales
716
- },
717
- term: ['refund', 'chargeback'],
718
- id: id,
719
- step_name: stepName,
720
- encryption_contract: []
721
- };
722
- return [4, API.brandService.updateBrandInfo(requestBody)];
723
- case 1:
724
- data = _h.sent();
725
- thunkApi.dispatch(updateStepName(stepName));
726
- thunkApi.dispatch(handleNextScreenStep());
727
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
728
- return [2, { data: data === null || data === void 0 ? void 0 : data.brand, formData: params }];
729
- }
823
+ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', function (_a, thunkApi) {
824
+ var formData = _a.formData, originalFormData = _a.originalFormData;
825
+ return __awaiter(void 0, void 0, void 0, function () {
826
+ var _b, settings, business, _c, data_status, id, isCustomerBaseLocationNonEditable, isCustomerBaseNonEditable, isTermsNonEditable, isSalesRangeNonEditable, customerLocations, expectedCustomer, expectedSale, stepName, requestBody, customerLocation, customerBaseId, salesId, customerBase, data;
827
+ var _d, _e, _f;
828
+ return __generator(this, function (_g) {
829
+ switch (_g.label) {
830
+ case 0:
831
+ _b = thunkApi.getState(), settings = _b.settings, business = _b.business;
832
+ _c = ((_d = business.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.brand) || {}, data_status = _c.data_status, id = _c.id;
833
+ isCustomerBaseLocationNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base_location');
834
+ isCustomerBaseNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base');
835
+ isTermsNonEditable = hasNoneEditableValue(data_status, 'terms');
836
+ isSalesRangeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'sales_range');
837
+ customerLocations = formData.customerLocations, expectedCustomer = formData.expectedCustomer, expectedSale = formData.expectedSale;
838
+ stepName = BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS;
839
+ requestBody = {
840
+ term: !isTermsNonEditable ? ['refund', 'chargeback'] : undefined,
841
+ id: id,
842
+ step_name: stepName,
843
+ encryption_contract: []
844
+ };
845
+ customerLocation = (customerLocations || []).map(function (location) { return ({
846
+ id: location.id
847
+ }); });
848
+ customerBaseId = (expectedCustomer === null || expectedCustomer === void 0 ? void 0 : expectedCustomer.id) && { id: expectedCustomer.id, period: 'monthly' };
849
+ salesId = (expectedSale === null || expectedSale === void 0 ? void 0 : expectedSale.id) && { id: expectedSale.id, period: 'monthly' };
850
+ customerBase = (customerBaseId || customerLocation.length) && __assign(__assign({}, (customerBaseId && !isCustomerBaseNonEditable && { id: expectedCustomer.id, period: 'monthly' })), (customerLocation.length && !isCustomerBaseLocationNonEditable && { locations: customerLocation }));
851
+ if (customerBase && !(isCustomerBaseNonEditable && isCustomerBaseLocationNonEditable))
852
+ requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { customer_base: customerBase }) });
853
+ if (salesId && !isSalesRangeNonEditable) {
854
+ requestBody = __assign(__assign({}, requestBody), { operations: __assign(__assign({}, requestBody.operations), { sales: salesId }) });
855
+ }
856
+ return [4, API.brandService.updateBrandInfo(requestBody)];
857
+ case 1:
858
+ data = _g.sent();
859
+ thunkApi.dispatch(updateStepName(stepName));
860
+ thunkApi.dispatch(handleNextScreenStep());
861
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
862
+ return [2, { data: data === null || data === void 0 ? void 0 : data.brand, formData: originalFormData }];
863
+ }
864
+ });
730
865
  });
731
- }); });
866
+ });
732
867
  export var updateLeadSuccess = createAsyncThunk('businessUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
733
868
  var _a, settings, business, _b, steps, lead_id, flowCompleted, boardResponse, payload, data, board_id;
734
869
  var _c, _d, _e, _f;
@@ -751,6 +886,12 @@ export var updateLeadSuccess = createAsyncThunk('businessUpdateLeadSuccess', fun
751
886
  return [4, API.leadService.updateLead(payload)];
752
887
  case 1:
753
888
  data = _g.sent();
889
+ sendCustomEventToGTM({
890
+ event: 'Send Event',
891
+ event_category: 'Account Creation Flow',
892
+ event_action: 'Account Creation Success',
893
+ event_label: settings.data.businessCountry.iso2
894
+ });
754
895
  board_id = data === null || data === void 0 ? void 0 : data.board_id;
755
896
  if (!board_id) return [3, 4];
756
897
  return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
@@ -798,10 +939,13 @@ var initialState = {
798
939
  uploadingArticle: false,
799
940
  data: {
800
941
  flowName: FlowsTypes.BUSINESS,
801
- currency: '',
802
942
  verify: {
803
943
  token: ''
804
944
  },
945
+ mobileData: {
946
+ countryCode: defaultCountry,
947
+ mobile: ''
948
+ },
805
949
  otpData: {
806
950
  otp: '',
807
951
  isNID: false
@@ -814,9 +958,13 @@ var initialState = {
814
958
  dob: '',
815
959
  type: ''
816
960
  },
961
+ dobData: {
962
+ dob: ''
963
+ },
817
964
  businessTypeData: {
818
965
  licenseNumber: '',
819
- entityLegalName: ''
966
+ entityLegalName: '',
967
+ isPrevDob: false
820
968
  },
821
969
  activitiesData: {
822
970
  activities: [],
@@ -862,13 +1010,13 @@ export var businessSlice = createSlice({
862
1010
  state.customLoading = true;
863
1011
  })
864
1012
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
865
- var _a, _b, _c, _d, _e, _f;
1013
+ var _a, _b, _c, _d, _e;
866
1014
  state.error = null;
867
1015
  state.customLoading = false;
868
- var _g = action.payload, data = _g.data, boardId = _g.boardId, brandData = _g.brandData, leadData = _g.leadData, token = _g.token, isRequireOTP = _g.isRequireOTP, isicActivityList = _g.isicActivityList, currencyData = _g.currencyData;
1016
+ var _f = action.payload, data = _f.data, boardId = _f.boardId, brandData = _f.brandData, leadData = _f.leadData, token = _f.token, isRequireOTP = _f.isRequireOTP, isicActivityList = _f.isicActivityList, verifyNextStepName = _f.verifyNextStepName;
869
1017
  var responseBody = state.data.verify.responseBody;
870
- state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id }), (brandData && { brand: brandData }));
871
- var _h = leadData || {}, identification = _h.identification, date_of_birth = _h.date_of_birth;
1018
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id, verifyNextStepName: verifyNextStepName }), (brandData && { brand: brandData }));
1019
+ var _g = leadData || {}, identification = _g.identification, date_of_birth = _g.date_of_birth;
872
1020
  if (identification === null || identification === void 0 ? void 0 : identification.id)
873
1021
  state.data.nidData.nid = identification.id;
874
1022
  if (date_of_birth)
@@ -880,13 +1028,13 @@ export var businessSlice = createSlice({
880
1028
  state.data.otpData.isNID = false;
881
1029
  if (isRequireOTP)
882
1030
  return;
883
- var _j = state.data.verify.responseBody || {}, entity = _j.entity, entity_activities = _j.entity_activities, business_name = _j.business_name;
1031
+ var _h = state.data.verify.responseBody || {}, entity = _h.entity, entity_activities = _h.entity_activities, business_name = _h.business_name;
884
1032
  if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
885
1033
  state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
886
1034
  var issuingDate = ((_a = brandData === null || brandData === void 0 ? void 0 : brandData.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
887
1035
  if (issuingDate)
888
1036
  state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
889
- var _k = brandData || {}, terms = _k.terms, activities = _k.activities;
1037
+ var _j = brandData || {}, terms = _j.terms, activities = _j.activities;
890
1038
  var entityActivities = (entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
891
1039
  return !(activities === null || activities === void 0 ? void 0 : activities.some(function (value) { return value.id === activity.id; }));
892
1040
  })) || [];
@@ -897,11 +1045,9 @@ export var businessSlice = createSlice({
897
1045
  state.data.customersData.refundPolicy = element.agree;
898
1046
  }
899
1047
  });
900
- if ((_c = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _c === void 0 ? void 0 : _c.english)
901
- state.data.currency = currencyData.code.english;
902
1048
  state.data.activitiesData.activities = selectedActivity;
903
1049
  var licenseList = [OTHER_CR_LICENSE, OTHER_FL_LICENSE];
904
- state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList }), (!((_f = (_e = (_d = state.data.businessTypeData) === null || _d === void 0 ? void 0 : _d.responseBody) === null || _e === void 0 ? void 0 : _e.licenseList) === null || _f === void 0 ? void 0 : _f.length) && { licenseList: licenseList }));
1050
+ state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList }), (!((_e = (_d = (_c = state.data.businessTypeData) === null || _c === void 0 ? void 0 : _c.responseBody) === null || _d === void 0 ? void 0 : _d.licenseList) === null || _e === void 0 ? void 0 : _e.length) && { licenseList: licenseList }));
905
1051
  })
906
1052
  .addCase(verifyLeadToken.rejected, function (state, action) {
907
1053
  state.error = action.error.message;
@@ -913,13 +1059,13 @@ export var businessSlice = createSlice({
913
1059
  .addCase(resendOTP.fulfilled, function (state, action) {
914
1060
  var _a;
915
1061
  state.error = null;
916
- var data = action.payload.data;
1062
+ var _b = action.payload, data = _b.data, verifyNextStepName = _b.verifyNextStepName;
917
1063
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
918
1064
  if (description) {
919
1065
  state.error = description;
920
1066
  return;
921
1067
  }
922
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
1068
+ state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), data), { verifyNextStepName: verifyNextStepName });
923
1069
  })
924
1070
  .addCase(resendOTP.rejected, function (state, action) {
925
1071
  state.error = action.error.message;
@@ -929,29 +1075,27 @@ export var businessSlice = createSlice({
929
1075
  state.error = null;
930
1076
  })
931
1077
  .addCase(verifyLeadOTP.fulfilled, function (state, action) {
932
- var _a, _b, _c, _d, _e, _f;
1078
+ var _a, _b, _c, _d, _e;
933
1079
  state.loading = false;
934
1080
  state.error = null;
935
- var _g = action.payload, data = _g.data, formData = _g.formData, brand = _g.brand, leadData = _g.leadData, isicActivityList = _g.isicActivityList, currencyData = _g.currencyData;
1081
+ var _f = action.payload, data = _f.data, formData = _f.formData, brand = _f.brand, leadData = _f.leadData, isicActivityList = _f.isicActivityList, verifyNextStepName = _f.verifyNextStepName;
936
1082
  state.data.otpData = formData;
937
1083
  state.data.otpData.responseBody = data;
938
- if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
939
- state.data.currency = currencyData.code.english;
940
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, leadData), state.data.verify.responseBody), (brand && { brand: brand })), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
941
- var _h = leadData || {}, identification = _h.identification, date_of_birth = _h.date_of_birth;
1084
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, leadData), state.data.verify.responseBody), { verifyNextStepName: verifyNextStepName }), (brand && { brand: brand })), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
1085
+ var _g = leadData || {}, identification = _g.identification, date_of_birth = _g.date_of_birth;
942
1086
  if (identification === null || identification === void 0 ? void 0 : identification.id)
943
1087
  state.data.nidData.nid = identification.id;
944
1088
  if (date_of_birth)
945
1089
  state.data.nidData.dob = dateFormat(date_of_birth);
946
1090
  if (identification === null || identification === void 0 ? void 0 : identification.type)
947
1091
  state.data.nidData.type = identification.type;
948
- var _j = leadData || {}, entity = _j.entity, entity_activities = _j.entity_activities, business_name = _j.business_name;
1092
+ var _h = leadData || {}, entity = _h.entity, entity_activities = _h.entity_activities, business_name = _h.business_name;
949
1093
  if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
950
1094
  state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
951
- var issuingDate = ((_b = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _b === void 0 ? void 0 : _b.start_date) || ((_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date);
1095
+ var issuingDate = ((_a = brand === null || brand === void 0 ? void 0 : brand.operations) === null || _a === void 0 ? void 0 : _a.start_date) || ((_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date);
952
1096
  if (issuingDate)
953
1097
  state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
954
- var _k = brand || {}, terms = _k.terms, activities = _k.activities;
1098
+ var _j = brand || {}, terms = _j.terms, activities = _j.activities;
955
1099
  var entityActivities = (entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
956
1100
  return !(activities === null || activities === void 0 ? void 0 : activities.some(function (value) { return value.id === activity.id; }));
957
1101
  })) || [];
@@ -964,7 +1108,7 @@ export var businessSlice = createSlice({
964
1108
  });
965
1109
  state.data.activitiesData.activities = selectedActivity;
966
1110
  var licenseList = [OTHER_CR_LICENSE, OTHER_FL_LICENSE];
967
- state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList }), (!((_f = (_e = (_d = state.data.businessTypeData) === null || _d === void 0 ? void 0 : _d.responseBody) === null || _e === void 0 ? void 0 : _e.licenseList) === null || _f === void 0 ? void 0 : _f.length) && { licenseList: licenseList }));
1111
+ state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList }), (!((_e = (_d = (_c = state.data.businessTypeData) === null || _c === void 0 ? void 0 : _c.responseBody) === null || _d === void 0 ? void 0 : _d.licenseList) === null || _e === void 0 ? void 0 : _e.length) && { licenseList: licenseList }));
968
1112
  })
969
1113
  .addCase(verifyLeadOTP.rejected, function (state, action) {
970
1114
  state.loading = false;
@@ -1014,7 +1158,7 @@ export var businessSlice = createSlice({
1014
1158
  var _a;
1015
1159
  state.loading = false;
1016
1160
  state.error = null;
1017
- var _b = action.payload, data = _b.data, formData = _b.formData;
1161
+ var _b = action.payload, data = _b.data, formData = _b.formData, countryCode = _b.countryCode;
1018
1162
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1019
1163
  if (description) {
1020
1164
  state.error = description;
@@ -1024,28 +1168,71 @@ export var businessSlice = createSlice({
1024
1168
  state.data.nidData.responseBody = data;
1025
1169
  state.data.otpData.otp = '';
1026
1170
  state.data.otpData.isNID = true;
1171
+ state.data.mobileData.countryCode = countryCode;
1172
+ state.data.mobileData.mobile = data.contact.phone.number;
1027
1173
  })
1028
1174
  .addCase(updateLeadIdentity.rejected, function (state, action) {
1029
1175
  state.loading = false;
1030
1176
  state.error = action.error.message;
1031
1177
  })
1032
- .addCase(resendOTPLeadIdentity.pending, function (state) {
1178
+ .addCase(updateLeadMobile.pending, function (state) {
1179
+ state.loading = true;
1033
1180
  state.error = null;
1034
1181
  })
1035
- .addCase(resendOTPLeadIdentity.fulfilled, function (state, action) {
1036
- var _a;
1182
+ .addCase(updateLeadMobile.fulfilled, function (state, action) {
1183
+ state.loading = false;
1037
1184
  state.error = null;
1038
- var data = action.payload;
1039
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1040
- if (description) {
1041
- state.error = description;
1042
- return;
1185
+ state.data.mobileData.mobile = action.payload.leadResponse.contact.phone.number;
1186
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), action.payload.leadResponse);
1187
+ })
1188
+ .addCase(updateLeadMobile.rejected, function (state, action) {
1189
+ state.loading = false;
1190
+ state.error = action.error.message;
1191
+ })
1192
+ .addCase(skipUpdateLeadMobile.pending, function (state) {
1193
+ state.loading = true;
1194
+ state.error = null;
1195
+ })
1196
+ .addCase(skipUpdateLeadMobile.fulfilled, function (state, action) {
1197
+ state.loading = false;
1198
+ state.error = null;
1199
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), action.payload.leadResponse);
1200
+ })
1201
+ .addCase(skipUpdateLeadMobile.rejected, function (state, action) {
1202
+ state.loading = false;
1203
+ state.error = action.error.message;
1204
+ })
1205
+ .addCase(verifyNafath.pending, function (state) {
1206
+ state.loading = true;
1207
+ state.error = null;
1208
+ })
1209
+ .addCase(verifyNafath.fulfilled, function (state, action) {
1210
+ state.loading = false;
1211
+ state.error = null;
1212
+ var _a = action.payload, response = _a.response, isNextScreenDob = _a.isNextScreenDob;
1213
+ state.data.businessTypeData.isPrevDob = isNextScreenDob || false;
1214
+ state.data.otpData.responseBody = response;
1215
+ })
1216
+ .addCase(verifyNafath.rejected, function (state, action) {
1217
+ state.loading = false;
1218
+ var error = action.error.message;
1219
+ if (error !== 'Aborted') {
1220
+ state.error = error;
1043
1221
  }
1044
- state.data.nidData.responseBody = data;
1045
- state.data.otpData.otp = '';
1046
- state.data.otpData.isNID = true;
1047
1222
  })
1048
- .addCase(resendOTPLeadIdentity.rejected, function (state, action) {
1223
+ .addCase(updateLeadDOB.pending, function (state) {
1224
+ state.loading = true;
1225
+ state.error = null;
1226
+ })
1227
+ .addCase(updateLeadDOB.fulfilled, function (state, action) {
1228
+ state.loading = false;
1229
+ state.error = null;
1230
+ var _a = action.payload, data = _a.data, formData = _a.formData;
1231
+ state.data.dobData = formData;
1232
+ state.data.dobData.responseBody = data;
1233
+ })
1234
+ .addCase(updateLeadDOB.rejected, function (state, action) {
1235
+ state.loading = false;
1049
1236
  state.error = action.error.message;
1050
1237
  })
1051
1238
  .addCase(retrieveEntityList.pending, function (state) {
@@ -1185,13 +1372,10 @@ export var businessSlice = createSlice({
1185
1372
  state.error = null;
1186
1373
  })
1187
1374
  .addCase(updateActivitiesInfo.fulfilled, function (state, action) {
1188
- var _a;
1189
1375
  state.loading = false;
1190
1376
  state.error = null;
1191
- var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
1377
+ var _a = action.payload, data = _a.data, formData = _a.formData;
1192
1378
  state.data.activitiesData = formData;
1193
- if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
1194
- state.data.currency = currencyData.code.english;
1195
1379
  var terms = (data || {}).terms;
1196
1380
  terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
1197
1381
  if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {