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

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 (314) hide show
  1. package/build/@types/app.d.ts +50 -20
  2. package/build/@types/app.js +9 -3
  3. package/build/@types/form.d.ts +21 -12
  4. package/build/api/auth.d.ts +28 -5
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +51 -5
  14. package/build/api/entity.js +39 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +44 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +9 -6
  21. package/build/api/lead.js +8 -1
  22. package/build/app/rootReducer.d.ts +0 -1
  23. package/build/app/rootReducer.js +0 -2
  24. package/build/app/settings.d.ts +9 -2
  25. package/build/app/settings.js +22 -11
  26. package/build/app/store.d.ts +0 -2
  27. package/build/assets/locales/ar.json +258 -183
  28. package/build/assets/locales/en.json +190 -108
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
  30. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  32. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  33. package/build/components/AnimationFlow/Dialog.d.ts +4 -1
  34. package/build/components/AnimationFlow/Dialog.js +5 -3
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  37. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  38. package/build/components/ArabicDatePicker/index.js +2 -0
  39. package/build/components/ArabicDatePicker/style.css +24 -0
  40. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  41. package/build/components/FileInput/DragAndDrop.js +108 -8
  42. package/build/components/Lottie/Lottie.d.ts +878 -0
  43. package/build/components/Lottie/Lottie.js +58 -0
  44. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  45. package/build/components/Lottie/files/success.json +425 -0
  46. package/build/components/Lottie/index.d.ts +3 -0
  47. package/build/components/Lottie/index.js +3 -0
  48. package/build/components/OTPField/OTPField.d.ts +2 -1
  49. package/build/components/OTPField/OTPField.js +2 -2
  50. package/build/components/OTPTimer/OTPTimer.js +1 -1
  51. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  52. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  53. package/build/components/ProgressBar/index.d.ts +2 -0
  54. package/build/components/ProgressBar/index.js +2 -0
  55. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  56. package/build/components/RadioLabel/RadioLabel.js +2 -2
  57. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  59. package/build/constants/api.d.ts +6 -0
  60. package/build/constants/api.js +14 -1
  61. package/build/constants/app.d.ts +5 -5
  62. package/build/constants/app.js +62 -32
  63. package/build/constants/assets.d.ts +14 -0
  64. package/build/constants/assets.js +16 -2
  65. package/build/constants/dummy.d.ts +1 -1
  66. package/build/constants/dummy.js +2 -2
  67. package/build/constants/validation.d.ts +10 -0
  68. package/build/constants/validation.js +11 -1
  69. package/build/features/app/auth/authStore.d.ts +30 -4
  70. package/build/features/app/auth/authStore.js +182 -20
  71. package/build/features/app/bank/bankStore.d.ts +16 -0
  72. package/build/features/app/bank/bankStore.js +88 -41
  73. package/build/features/app/business/businessStore.d.ts +33 -5
  74. package/build/features/app/business/businessStore.js +487 -350
  75. package/build/features/app/connect/connectStore.d.ts +34 -31
  76. package/build/features/app/connect/connectStore.js +427 -300
  77. package/build/features/app/entity/entityStore.d.ts +40 -8
  78. package/build/features/app/entity/entityStore.js +387 -149
  79. package/build/features/app/individual/individualStore.d.ts +18 -0
  80. package/build/features/app/individual/individualStore.js +168 -89
  81. package/build/features/app/password/passwordStore.d.ts +1 -7
  82. package/build/features/app/password/passwordStore.js +31 -20
  83. package/build/features/app/tax/taxStore.js +23 -16
  84. package/build/features/auth/Auth.d.ts +2 -1
  85. package/build/features/auth/Auth.js +37 -9
  86. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  87. package/build/features/auth/screens/NID/DOB.js +47 -0
  88. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  89. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  90. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  91. package/build/features/auth/screens/NID/NID.js +68 -0
  92. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  93. package/build/features/auth/screens/NID/TAC.js +87 -0
  94. package/build/features/auth/screens/NID/index.d.ts +3 -0
  95. package/build/features/auth/screens/NID/index.js +2 -0
  96. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  97. package/build/features/auth/screens/NID/validation.js +19 -0
  98. package/build/features/auth/screens/OTP/OTP.js +8 -4
  99. package/build/features/auth/screens/OTP/OTPInput.js +9 -2
  100. package/build/features/bank/Bank.js +4 -4
  101. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  102. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  103. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  104. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  105. package/build/features/bank/screens/BankDetails/IBAN.js +4 -1
  106. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  107. package/build/features/bank/screens/Success/Success.js +7 -3
  108. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -12
  109. package/build/features/business/Business.js +4 -4
  110. package/build/features/business/screens/Activities/Activities.js +16 -17
  111. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  112. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  113. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  114. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  115. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  116. package/build/features/business/screens/Activities/validation.js +4 -10
  117. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  118. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  119. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  121. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  122. package/build/features/business/screens/BusinessType/LicenseList.js +26 -7
  123. package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
  124. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
  126. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  127. package/build/features/business/screens/BusinessType/validation.js +52 -3
  128. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  129. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  130. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  131. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  132. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  133. package/build/features/business/screens/CivilID/index.js +2 -0
  134. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  135. package/build/features/business/screens/CivilID/validation.js +4 -0
  136. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  137. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  138. package/build/features/business/screens/Customers/Customers.js +15 -9
  139. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  140. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  141. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  142. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  143. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  144. package/build/features/business/screens/OTP/OTP.js +15 -2
  145. package/build/features/business/screens/Success/Success.js +10 -3
  146. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -11
  147. package/build/features/business/screens/Verify/Verify.js +4 -4
  148. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  153. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  154. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  155. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  156. package/build/features/connect/Connect.d.ts +1 -0
  157. package/build/features/connect/Connect.js +38 -10
  158. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  159. package/build/features/connect/screens/CivilID/CivilID.js +102 -0
  160. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  161. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  162. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  163. package/build/features/connect/screens/CivilID/index.js +2 -0
  164. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  165. package/build/features/connect/screens/CivilID/validation.js +4 -0
  166. package/build/features/connect/screens/Individual/Email.js +11 -3
  167. package/build/features/connect/screens/Individual/Individual.js +44 -28
  168. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  169. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  170. package/build/features/connect/screens/Merchant/Merchant.js +48 -65
  171. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +4 -1
  172. package/build/features/connect/screens/Merchant/SalesChannels.js +28 -31
  173. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +3 -4
  174. package/build/features/connect/screens/Merchant/SocialMedia.js +106 -112
  175. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  176. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  177. package/build/features/connect/screens/Merchant/validation.js +106 -173
  178. package/build/features/connect/screens/Mobile/Mobile.js +33 -12
  179. package/build/features/connect/screens/NID/NID.js +5 -1
  180. package/build/features/connect/screens/OTP/OTP.js +20 -6
  181. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  182. package/build/features/connect/screens/ThankYou/ThankYou.js +8 -2
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  188. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  189. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  190. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  191. package/build/features/entity/Entity.js +6 -6
  192. package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
  193. package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
  194. package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
  195. package/build/features/entity/screens/Customers/Customers.js +90 -0
  196. package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
  197. package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
  198. package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
  199. package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
  200. package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
  201. package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
  202. package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
  203. package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
  204. package/build/features/entity/screens/Customers/index.d.ts +3 -0
  205. package/build/features/entity/screens/Customers/index.js +2 -0
  206. package/build/features/entity/screens/Customers/validation.d.ts +20 -0
  207. package/build/features/entity/screens/Customers/validation.js +13 -0
  208. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
  209. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
  210. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  211. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  212. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +38 -10
  213. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  214. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
  215. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
  216. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  217. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
  218. package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
  219. package/build/features/entity/screens/Success/Success.js +7 -3
  220. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -10
  221. package/build/features/entity/screens/Verify/Verify.js +18 -5
  222. package/build/features/featuresScreens.d.ts +0 -1
  223. package/build/features/featuresScreens.js +30 -7
  224. package/build/features/individual/Individual.js +4 -4
  225. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  226. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  227. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  228. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  229. package/build/features/individual/screens/Success/Success.js +7 -3
  230. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -12
  231. package/build/features/individual/screens/Verify/Verify.js +18 -5
  232. package/build/features/password/Password.js +4 -4
  233. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  234. package/build/features/password/screens/OTP/OTP.js +15 -2
  235. package/build/features/password/screens/Success/Success.js +7 -3
  236. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -13
  237. package/build/features/password/screens/Verify/Verify.js +16 -3
  238. package/build/features/shared/Background/Background.d.ts +2 -5
  239. package/build/features/shared/Background/Background.js +7 -3
  240. package/build/features/shared/Button/Button.js +1 -0
  241. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  242. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  243. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  244. package/build/features/shared/Button/MobileButton.js +2 -2
  245. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  246. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  247. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  248. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  249. package/build/features/shared/Dialog/index.d.ts +4 -0
  250. package/build/features/shared/Dialog/index.js +4 -0
  251. package/build/features/shared/Input/Input.d.ts +1 -1
  252. package/build/features/shared/Input/Input.js +2 -2
  253. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +1 -1
  254. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  255. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  256. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  257. package/build/features/signIn/SignIn.js +4 -4
  258. package/build/features/signIn/screens/Email/Email.js +4 -2
  259. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  260. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  261. package/build/features/signIn/screens/Password/Password.js +15 -2
  262. package/build/features/tax/Tax.js +6 -6
  263. package/build/features/tax/screens/Success/Success.js +9 -3
  264. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  265. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  266. package/build/features/tax/screens/Verify/Verify.js +16 -3
  267. package/build/hooks/index.d.ts +2 -0
  268. package/build/hooks/index.js +2 -0
  269. package/build/hooks/useAppConfig.d.ts +3 -1
  270. package/build/hooks/useAppConfig.js +2 -2
  271. package/build/hooks/useAppDispatch.d.ts +0 -1
  272. package/build/hooks/useErrorListener.js +0 -6
  273. package/build/hooks/useScreen.d.ts +3 -0
  274. package/build/hooks/useScreen.js +14 -0
  275. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  276. package/build/hooks/useSetFromDefaultValues.js +24 -0
  277. package/build/index.d.ts +2 -3
  278. package/build/index.js +1 -4
  279. package/build/utils/array.d.ts +50 -1
  280. package/build/utils/array.js +66 -0
  281. package/build/utils/common.d.ts +1 -0
  282. package/build/utils/common.js +3 -0
  283. package/build/utils/date.d.ts +1 -0
  284. package/build/utils/date.js +5 -0
  285. package/build/utils/device.d.ts +1 -0
  286. package/build/utils/device.js +13 -0
  287. package/build/utils/index.d.ts +2 -0
  288. package/build/utils/index.js +2 -0
  289. package/build/utils/locale.js +1 -1
  290. package/build/utils/object.d.ts +1 -0
  291. package/build/utils/object.js +12 -0
  292. package/build/utils/string.d.ts +14 -0
  293. package/build/utils/string.js +85 -3
  294. package/build/utils/validation.d.ts +2 -0
  295. package/build/utils/validation.js +6 -0
  296. package/package.json +4 -3
  297. package/build/features/app/otp/otpStore.d.ts +0 -28
  298. package/build/features/app/otp/otpStore.js +0 -153
  299. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  300. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  301. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  302. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  303. package/build/features/otp/OTP.d.ts +0 -7
  304. package/build/features/otp/OTP.js +0 -58
  305. package/build/features/otp/index.d.ts +0 -0
  306. package/build/features/otp/index.js +0 -1
  307. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  308. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  309. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  310. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  311. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  312. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  313. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  314. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
@@ -60,13 +60,13 @@ import moment from 'moment';
60
60
  import API from '../../../api';
61
61
  import { BusinessType, FlowsTypes } from '../../../@types';
62
62
  import { BUSINESS_FLOW_SUCCESS, BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
63
- import { convertNumbers2English, getEighteenYearsAgo, hasKey } from '../../../utils';
64
- import { handleNextScreenStep } from '../../../app/settings';
63
+ import { convertNumbers2English, getEighteenYearsAgo, hasKey, sleep, isKW, isSA, dateFormat } from '../../../utils';
64
+ import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
65
65
  export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
- var payload, data, leadResponse, brandInfo, boardResponse, board_id, board_info_id, steps, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted;
67
- var _a, _b, _c, _d, _e, _f;
68
- return __generator(this, function (_g) {
69
- switch (_g.label) {
66
+ var payload, data, countryIso2, boardData, brandData, leadData, entity_activities, steps, brand, board_id, board_info_id, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, activityList;
67
+ var _a;
68
+ return __generator(this, function (_b) {
69
+ switch (_b.label) {
70
70
  case 0:
71
71
  payload = {
72
72
  service_name: 'tap_email',
@@ -74,81 +74,100 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
74
74
  };
75
75
  return [4, API.leadService.verifyLeadToken(payload)];
76
76
  case 1:
77
- data = (_g.sent()).data;
78
- leadResponse = undefined;
79
- brandInfo = undefined;
80
- boardResponse = undefined;
81
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 17];
77
+ data = (_b.sent()).data;
78
+ if ((_a = data.errors) === null || _a === void 0 ? void 0 : _a.length)
79
+ throw new Error(data.errors[0].description);
80
+ if (data.mw_error)
81
+ throw new Error(data.mw_error);
82
+ countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
83
+ if (countryIso2)
84
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
85
+ if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 20];
86
+ boardData = undefined;
87
+ brandData = undefined;
82
88
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
83
89
  case 2:
84
- leadResponse = _g.sent();
85
- board_id = (_a = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _a === void 0 ? void 0 : _a.board_id;
86
- board_info_id = (_b = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _b === void 0 ? void 0 : _b.board_info_id;
87
- if (!(!!board_id && !!board_info_id)) return [3, 4];
88
- return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
89
- case 3:
90
- boardResponse = _g.sent();
91
- _g.label = 4;
92
- case 4:
93
- if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
90
+ leadData = (_b.sent()).data;
91
+ countryIso2 = leadData === null || leadData === void 0 ? void 0 : leadData.country_code;
92
+ if (!countryIso2)
93
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
94
+ if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && isKW(countryIso2)) {
95
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
96
+ }
97
+ if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && !isKW(countryIso2)) {
94
98
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
95
99
  }
96
- if (!(data.step_name === 'business_info')) return [3, 17];
97
- steps = (_c = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _c === void 0 ? void 0 : _c.steps;
98
- brandID = (_e = (_d = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _d === void 0 ? void 0 : _d.brand) === null || _e === void 0 ? void 0 : _e.id;
100
+ if (!(data.step_name === BUSINESS_STEP_NAMES.BUSINESS_INFO)) return [3, 19];
101
+ entity_activities = leadData.entity_activities, steps = leadData.steps, brand = leadData.brand, board_id = leadData.board_id, board_info_id = leadData.board_info_id;
102
+ brandID = brand === null || brand === void 0 ? void 0 : brand.id;
99
103
  hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
100
104
  hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
101
105
  hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
102
106
  hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
103
- if (!hasBusinessCompleted) return [3, 6];
104
- return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
107
+ if (!(!entity_activities && hasBusinessCRInfoCompleted)) return [3, 4];
108
+ return [4, API.dataService.getActivities()];
109
+ case 3:
110
+ activityList = (_b.sent()).list;
111
+ leadData = __assign(__assign({}, leadData), { entity_activities: activityList });
112
+ _b.label = 4;
113
+ case 4:
114
+ if (!hasBusinessCompleted) return [3, 9];
115
+ if (!(board_id && board_info_id)) return [3, 6];
116
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
105
117
  case 5:
106
- _g.sent();
107
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
108
- return [3, 17];
118
+ boardData = _b.sent();
119
+ _b.label = 6;
109
120
  case 6:
110
- if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 7];
111
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
112
- return [3, 17];
121
+ if (!board_id) return [3, 8];
122
+ return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
113
123
  case 7:
114
- if (!hasBusinessCustomersCompleted) return [3, 8];
115
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
116
- return [3, 17];
124
+ _b.sent();
125
+ _b.label = 8;
117
126
  case 8:
118
- if (!hasBusinessCRActivitiesCompleted) return [3, 12];
119
- return [4, thunkApi.dispatch(retrieveChannels())];
127
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
128
+ return [3, 19];
120
129
  case 9:
121
- _g.sent();
122
- return [4, thunkApi.dispatch(retrieveDataList())];
130
+ if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 10];
131
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
132
+ return [3, 19];
123
133
  case 10:
124
- _g.sent();
125
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
126
- return [4, API.brandService.retrieveBrand(brandID)];
134
+ if (!hasBusinessCustomersCompleted) return [3, 11];
135
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
136
+ return [3, 19];
127
137
  case 11:
128
- brandInfo = _g.sent();
129
- return [3, 17];
138
+ if (!hasBusinessCRActivitiesCompleted) return [3, 14];
139
+ return [4, thunkApi.dispatch(retrieveDataList())];
130
140
  case 12:
131
- if (!hasBusinessCRInfoCompleted) return [3, 15];
132
- return [4, thunkApi.dispatch(retrieveChannels())];
133
- case 13:
134
- _g.sent();
141
+ _b.sent();
142
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
135
143
  return [4, API.brandService.retrieveBrand(brandID)];
144
+ case 13:
145
+ brandData = _b.sent();
146
+ return [3, 19];
136
147
  case 14:
137
- brandInfo = _g.sent();
148
+ if (!hasBusinessCRInfoCompleted) return [3, 16];
149
+ return [4, API.brandService.retrieveBrand(brandID)];
150
+ case 15:
151
+ brandData = _b.sent();
138
152
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
139
- return [3, 17];
140
- case 15: return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
153
+ return [3, 19];
141
154
  case 16:
142
- _g.sent();
155
+ if (!isSA(countryIso2)) return [3, 18];
156
+ return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
157
+ case 17:
158
+ _b.sent();
159
+ _b.label = 18;
160
+ case 18:
143
161
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
144
- _g.label = 17;
145
- case 17: return [2, {
162
+ _b.label = 19;
163
+ case 19: return [2, {
146
164
  data: data,
147
- leadData: __assign(__assign({}, leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data), { flows: BUSINESS_FLOW_SUCCESS.concat(boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.info) }),
165
+ leadData: __assign(__assign({}, leadData), { flows: BUSINESS_FLOW_SUCCESS.concat((boardData === null || boardData === void 0 ? void 0 : boardData.info) || []) }),
148
166
  token: token,
149
- brandInfo: brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.brand,
150
- boardId: (_f = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _f === void 0 ? void 0 : _f.board_id
167
+ brandData: brandData,
168
+ boardId: leadData === null || leadData === void 0 ? void 0 : leadData.board_id
151
169
  }];
170
+ case 20: return [2, { data: data, isRequireOTP: true }];
152
171
  }
153
172
  });
154
173
  }); });
@@ -170,144 +189,240 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
170
189
  });
171
190
  }); });
172
191
  export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
173
- var _a, business, settings, isNID, responseBody, verifyResponse, stepName, brandID, payload, data, brandInfo, steps, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted;
174
- var _b, _c, _d, _e, _f, _g, _h, _j;
175
- return __generator(this, function (_k) {
176
- switch (_k.label) {
192
+ var _a, business, settings, isNID, responseBody, stepName, payload, data, brandData, leadData, brand, country_code, steps, board_id, board_info_id, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, entity_activities, activityList, boardResponse;
193
+ var _b, _c, _d, _e, _f, _g, _h;
194
+ return __generator(this, function (_j) {
195
+ switch (_j.label) {
177
196
  case 0:
178
197
  _a = thunkApi.getState(), business = _a.business, settings = _a.settings;
179
198
  isNID = business.data.otpData.isNID;
180
199
  responseBody = (isNID ? business.data.nidData : business.data.verify).responseBody;
181
- verifyResponse = business.data.verify.responseBody;
182
200
  stepName = isNID ? BUSINESS_STEP_NAMES.IDENTITY_VERIFY_AUTH : BUSINESS_STEP_NAMES.PHONE_AUTH;
183
- brandID = (_c = (_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) === null || _c === void 0 ? void 0 : _c.id;
184
201
  payload = {
185
202
  data: params.otp,
186
- service_name: ((_e = (_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_token) === null || _d === void 0 ? void 0 : _d.verification_by) === null || _e === void 0 ? void 0 : _e.service_name) || ((_f = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _f === void 0 ? void 0 : _f.service_name),
187
- verify_token: ((_g = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_token) === null || _g === void 0 ? void 0 : _g.verify_token) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token),
203
+ service_name: ((_c = (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_token) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.service_name) || ((_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name),
204
+ verify_token: ((_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_token) === null || _e === void 0 ? void 0 : _e.verify_token) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token),
188
205
  step_name: stepName,
189
206
  encryption_contract: ['data']
190
207
  };
191
208
  return [4, API.leadService.verifyLeadOTP(payload)];
192
209
  case 1:
193
- data = (_k.sent()).data;
194
- brandInfo = undefined;
195
- if (!!data.errors) return [3, 13];
196
- thunkApi.dispatch(updateStepName(stepName));
197
- return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
210
+ data = (_j.sent()).data;
211
+ if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
212
+ throw new Error(data.errors[0].description);
213
+ brandData = undefined;
214
+ return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
198
215
  case 2:
199
- _k.sent();
200
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { otp: params.otp });
201
- steps = responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps;
216
+ leadData = (_j.sent()).data;
217
+ thunkApi.dispatch(updateStepName(stepName));
218
+ brand = leadData.brand, country_code = leadData.country_code, steps = leadData.steps, board_id = leadData.board_id, board_info_id = leadData.board_info_id;
219
+ brandID = brand === null || brand === void 0 ? void 0 : brand.id;
220
+ countryIso2 = country_code;
221
+ if (countryIso2)
222
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
223
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
202
224
  hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
203
225
  hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
204
226
  hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
205
227
  hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
206
- if (!isNID) return [3, 3];
207
- thunkApi.dispatch(handleNextScreenStep());
208
- return [3, 13];
228
+ isIdentityAuthStep = data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH;
229
+ if (!(isSA(countryIso2) && !isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 4];
230
+ return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
209
231
  case 3:
210
- if (!hasBusinessCompleted) return [3, 5];
211
- return [4, thunkApi.dispatch(retrieveBoardDetails(verifyResponse === null || verifyResponse === void 0 ? void 0 : verifyResponse.board_id))];
232
+ _j.sent();
233
+ _j.label = 4;
212
234
  case 4:
213
- _k.sent();
214
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
215
- return [3, 13];
235
+ entity_activities = leadData.entity_activities;
236
+ if (!(!entity_activities && hasBusinessCRInfoCompleted)) return [3, 6];
237
+ return [4, API.dataService.getActivities()];
216
238
  case 5:
217
- if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 6];
218
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
219
- return [3, 13];
239
+ activityList = (_j.sent()).list;
240
+ leadData = __assign(__assign({}, leadData), { entity_activities: activityList });
241
+ _j.label = 6;
220
242
  case 6:
221
- if (!hasBusinessCustomersCompleted) return [3, 7];
222
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
223
- return [3, 13];
243
+ if (!isNID) return [3, 7];
244
+ thunkApi.dispatch(handleNextScreenStep());
245
+ return [3, 20];
224
246
  case 7:
225
- if (!hasBusinessCRActivitiesCompleted) return [3, 9];
226
- thunkApi.dispatch(retrieveChannels());
227
- thunkApi.dispatch(retrieveDataList());
228
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
229
- return [4, API.brandService.retrieveBrand(brandID)];
247
+ if (!(isIdentityAuthStep && isKW(countryIso2))) return [3, 8];
248
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
249
+ return [3, 20];
230
250
  case 8:
231
- brandInfo = _k.sent();
232
- return [3, 13];
251
+ if (!hasBusinessCompleted) return [3, 12];
252
+ if (!(board_id && board_info_id)) return [3, 10];
253
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
233
254
  case 9:
234
- if (!hasBusinessCRInfoCompleted) return [3, 12];
235
- return [4, thunkApi.dispatch(retrieveChannels())];
236
- case 10:
237
- _k.sent();
238
- return [4, API.brandService.retrieveBrand(brandID)];
255
+ boardResponse = _j.sent();
256
+ leadData = __assign(__assign({}, leadData), { flows: BUSINESS_FLOW_SUCCESS.concat((boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.info) || []) });
257
+ _j.label = 10;
258
+ case 10: return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
239
259
  case 11:
240
- brandInfo = _k.sent();
241
- thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
242
- return [3, 13];
260
+ _j.sent();
261
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
262
+ return [3, 20];
243
263
  case 12:
264
+ if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 13];
265
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
266
+ return [3, 20];
267
+ case 13:
268
+ if (!hasBusinessCustomersCompleted) return [3, 14];
269
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
270
+ return [3, 20];
271
+ case 14:
272
+ if (!hasBusinessCRActivitiesCompleted) return [3, 17];
273
+ return [4, thunkApi.dispatch(retrieveDataList())];
274
+ case 15:
275
+ _j.sent();
276
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
277
+ return [4, API.brandService.retrieveBrand(brandID)];
278
+ case 16:
279
+ brandData = _j.sent();
280
+ return [3, 20];
281
+ case 17:
282
+ if (!hasBusinessCRInfoCompleted) return [3, 19];
283
+ return [4, API.brandService.retrieveBrand(brandID)];
284
+ case 18:
285
+ brandData = _j.sent();
286
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
287
+ return [3, 20];
288
+ case 19:
244
289
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
245
- _k.label = 13;
246
- case 13: return [2, { data: data, formData: __assign(__assign({}, params), { isNID: isNID }), brandInfo: brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.brand }];
290
+ _j.label = 20;
291
+ case 20: return [2, { data: data, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
292
+ }
293
+ });
294
+ }); });
295
+ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
296
+ var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess;
297
+ var _b, _c, _d, _e;
298
+ return __generator(this, function (_f) {
299
+ switch (_f.label) {
300
+ case 0:
301
+ _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
302
+ responseBody = business.data.civilIdData.responseBody;
303
+ expiry = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.expiry) || 120;
304
+ interval = 5;
305
+ maxCalls = Math.floor(expiry / interval);
306
+ if (thunkApi.signal.aborted) {
307
+ return [2, { response: null }];
308
+ }
309
+ count = 1;
310
+ _f.label = 1;
311
+ case 1:
312
+ if (!(count <= maxCalls)) return [3, 7];
313
+ return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
314
+ case 2:
315
+ data = _f.sent();
316
+ isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
317
+ if (!isSuccess) return [3, 4];
318
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
319
+ return [4, ((_e = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params))];
320
+ case 3:
321
+ _f.sent();
322
+ thunkApi.dispatch(handleNextScreenStep());
323
+ return [2, { response: data }];
324
+ case 4: return [4, sleep(interval * 1000)];
325
+ case 5:
326
+ _f.sent();
327
+ _f.label = 6;
328
+ case 6:
329
+ count++;
330
+ return [3, 1];
331
+ case 7: throw new Error('paci_verification_failed');
332
+ }
333
+ });
334
+ }); });
335
+ export var createCivilIdAuth = createAsyncThunk('createCivilIdAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
336
+ var _a, settings, business, stepName, lead_id, requestBody, data;
337
+ var _b, _c;
338
+ return __generator(this, function (_d) {
339
+ switch (_d.label) {
340
+ case 0:
341
+ _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
342
+ stepName = BUSINESS_STEP_NAMES.CREATE_AUTH_CIVIL_ID;
343
+ lead_id = (business.data.verify.responseBody || {}).lead_id;
344
+ requestBody = {
345
+ id: lead_id || '',
346
+ identification: {
347
+ id: params.civilId,
348
+ issued_country_code: settings.data.businessCountry.iso2,
349
+ type: 'civil_id'
350
+ },
351
+ step_name: stepName,
352
+ encryption_contract: ['identification.id', 'identification.issued_country_code', 'identification.type']
353
+ };
354
+ return [4, API.leadService.updateLead(requestBody)];
355
+ case 1:
356
+ data = _d.sent();
357
+ thunkApi.dispatch(handleNextScreenStep());
358
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
359
+ return [2, { response: data, formData: params }];
247
360
  }
248
361
  });
249
362
  }); });
250
363
  export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
251
- var _a, settings, business, identification_id_type, stepName, requestBody, data;
252
- var _b, _c, _d;
253
- return __generator(this, function (_e) {
254
- switch (_e.label) {
364
+ var _a, settings, business, identification_id_type, stepName, lead_id, requestBody, data;
365
+ var _b, _c;
366
+ return __generator(this, function (_d) {
367
+ switch (_d.label) {
255
368
  case 0:
256
369
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
257
370
  identification_id_type = params.nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
258
371
  stepName = BUSINESS_STEP_NAMES.IDENTITY_AUTH;
372
+ lead_id = (business.data.verify.responseBody || {}).lead_id;
259
373
  requestBody = {
260
- id: ((_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
261
- identification_id: params.nid,
262
- identification_id_type: identification_id_type,
374
+ id: lead_id || '',
375
+ identification: {
376
+ id: params.nid,
377
+ issued_country_code: settings.data.businessCountry.iso2,
378
+ type: identification_id_type
379
+ },
263
380
  date_of_birth: params.dob,
264
- country_code: settings.data.businessCountry.iso2,
265
381
  step_name: stepName,
266
- encryption_contract: ['country_code', 'identification_id', 'identification_id_type', 'date_of_birth']
382
+ encryption_contract: [
383
+ 'identification.issued_country_code',
384
+ 'identification.id',
385
+ 'identification.type',
386
+ 'date_of_birth'
387
+ ]
267
388
  };
268
389
  return [4, API.leadService.updateLead(requestBody)];
269
390
  case 1:
270
- data = _e.sent();
271
- thunkApi.dispatch(updateStepName(stepName));
391
+ data = _d.sent();
272
392
  thunkApi.dispatch(handleNextScreenStep());
273
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody);
393
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
274
394
  return [2, { data: data, formData: __assign(__assign({}, params), { type: identification_id_type }) }];
275
395
  }
276
396
  });
277
397
  }); });
278
398
  export var resendOTPLeadIdentity = createAsyncThunk('resendOTPLeadIdentity', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
279
- var _a, settings, business, _b, nid, dob, type, stepName, requestBody, data;
280
- var _c;
281
- return __generator(this, function (_d) {
282
- switch (_d.label) {
399
+ var _a, settings, business, _b, nid, dob, type, stepName, lead_id, requestBody, data;
400
+ return __generator(this, function (_c) {
401
+ switch (_c.label) {
283
402
  case 0:
284
403
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
285
404
  _b = business.data.nidData, nid = _b.nid, dob = _b.dob, type = _b.type;
286
405
  stepName = BUSINESS_STEP_NAMES.IDENTITY_AUTH;
406
+ lead_id = (business.data.verify.responseBody || {}).lead_id;
287
407
  requestBody = {
288
- id: ((_c = business.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.id) || '',
289
- identification_id: nid,
290
- identification_id_type: type,
408
+ id: lead_id || '',
409
+ identification: {
410
+ id: nid,
411
+ issued_country_code: settings.data.businessCountry.iso2,
412
+ type: type
413
+ },
291
414
  date_of_birth: dob,
292
- country_code: settings.data.businessCountry.iso2,
293
415
  step_name: stepName,
294
- encryption_contract: ['country_code', 'identification_id', 'identification_id_type', 'date_of_birth']
416
+ encryption_contract: [
417
+ 'identification.issued_country_code',
418
+ 'identification.id',
419
+ 'identification.type',
420
+ 'date_of_birth'
421
+ ]
295
422
  };
296
423
  return [4, API.leadService.updateLead(requestBody)];
297
424
  case 1:
298
- data = _d.sent();
299
- thunkApi.dispatch(updateStepName(stepName));
300
- return [2, data];
301
- }
302
- });
303
- }); });
304
- export var retrieveChannels = createAsyncThunk('retrieveChannels', function () { return __awaiter(void 0, void 0, void 0, function () {
305
- var data;
306
- return __generator(this, function (_a) {
307
- switch (_a.label) {
308
- case 0: return [4, API.dataService.getChannelsOfServices()];
309
- case 1:
310
- data = (_a.sent()).data;
425
+ data = _c.sent();
311
426
  return [2, data];
312
427
  }
313
428
  });
@@ -332,31 +447,40 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
332
447
  case 1:
333
448
  data = _c.sent();
334
449
  return [2, {
335
- data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.name, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
450
+ 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 })
336
451
  }];
337
452
  }
338
453
  });
339
454
  }); });
340
455
  export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
341
- var _a, settings, business, payload, data, accountBody, accountData;
456
+ var _a, settings, business, payload, data, entity_activities, list, accountBody, accountData, documentData, documentBody;
342
457
  var _b, _c, _d, _e, _f, _g;
343
458
  return __generator(this, function (_h) {
344
459
  switch (_h.label) {
345
460
  case 0:
346
461
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
347
462
  payload = {
348
- id: ((_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
463
+ id: ((_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.lead_id) || '',
349
464
  license_number: params.licenseNumber,
350
465
  license_type: ((_c = params.selectedLicense) === null || _c === void 0 ? void 0 : _c.type) === BusinessType.FL ? 'freelance' : 'commercial_registration',
351
466
  business_type: (_d = params.selectedLicense) === null || _d === void 0 ? void 0 : _d.type,
352
467
  step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO,
468
+ business: { ar: params.entityLegalName, en: params.entityLegalName },
353
469
  encryption_contract: ['license_number', 'business_type', 'license_type']
354
470
  };
355
471
  return [4, API.leadService.updateLead(payload)];
356
472
  case 1:
357
473
  data = _h.sent();
474
+ entity_activities = data.entity_activities;
475
+ if (!!entity_activities) return [3, 3];
476
+ return [4, API.dataService.getActivities()];
477
+ case 2:
478
+ list = (_h.sent()).list;
479
+ data.entity_activities = list;
480
+ _h.label = 3;
481
+ case 3:
358
482
  accountBody = {
359
- lead_id: (_e = business.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.id,
483
+ lead_id: (_e = business.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.lead_id,
360
484
  notify: {
361
485
  email: false,
362
486
  phone: false
@@ -366,43 +490,75 @@ export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', f
366
490
  step_name: BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM
367
491
  };
368
492
  return [4, API.accountService.createAccount(accountBody)];
369
- case 2:
493
+ case 4:
370
494
  accountData = _h.sent();
371
- return [4, thunkApi.dispatch(retrieveChannels())];
372
- case 3:
373
- _h.sent();
495
+ documentData = undefined;
496
+ if (!!!business.data.businessTypeData.certificateId) return [3, 6];
497
+ documentBody = {
498
+ entity_id: (accountData === null || accountData === void 0 ? void 0 : accountData.entity_id) || '',
499
+ documents: [
500
+ {
501
+ images: [business.data.businessTypeData.certificateId]
502
+ }
503
+ ]
504
+ };
505
+ return [4, API.entityService.updateDocumentInfo(documentBody)];
506
+ case 5:
507
+ documentData = _h.sent();
508
+ _h.label = 6;
509
+ case 6:
374
510
  thunkApi.dispatch(handleNextScreenStep());
375
511
  (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
376
- return [2, { data: data, formData: params, accountData: accountData }];
512
+ return [2, { data: data, formData: params, accountData: accountData, documentData: documentData }];
377
513
  }
378
514
  });
379
515
  }); });
516
+ export var uploadLicenseCertificate = createAsyncThunk('uploadLicenseCertificate', function (_a) {
517
+ var file = _a.file, onProgress = _a.onProgress;
518
+ return __awaiter(void 0, void 0, void 0, function () {
519
+ var uploadPayload, onUploadProgress, data;
520
+ return __generator(this, function (_b) {
521
+ switch (_b.label) {
522
+ case 0:
523
+ uploadPayload = {
524
+ file_link_create: true,
525
+ title: file === null || file === void 0 ? void 0 : file.name,
526
+ purpose: 'identity_document',
527
+ file: file
528
+ };
529
+ onUploadProgress = function (progressEvent) {
530
+ var progress = ((progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.loaded) / (progressEvent === null || progressEvent === void 0 ? void 0 : progressEvent.total)) * 100;
531
+ onProgress === null || onProgress === void 0 ? void 0 : onProgress(Math.floor(progress));
532
+ };
533
+ return [4, API.entityService.uploadFileInfo(uploadPayload, { onUploadProgress: onUploadProgress })];
534
+ case 1:
535
+ data = _b.sent();
536
+ return [2, { data: data }];
537
+ }
538
+ });
539
+ });
540
+ });
380
541
  export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
381
- var _a, settings, business, channel, activities, stepName, id, requestBody, data;
542
+ var _a, settings, business, activities, stepName, id, requestBody, data;
382
543
  var _b, _c, _d, _e, _f;
383
544
  return __generator(this, function (_g) {
384
545
  switch (_g.label) {
385
546
  case 0:
386
547
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
387
- channel = params.salesChannels.map(function (_a) {
388
- var id = _a.id;
389
- return id;
390
- });
391
548
  activities = (_b = (params.activities || [])) === null || _b === void 0 ? void 0 : _b.map(function (_a) {
392
- var en = _a.en;
393
- return en;
549
+ var id = _a.id;
550
+ return ({ id: id });
394
551
  });
395
552
  stepName = BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES;
396
553
  id = (_d = (_c = business.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.id;
397
554
  requestBody = {
398
555
  id: id,
399
- brand: {
400
- activities: activities,
401
- channel_services: channel,
402
- business_operation_start_at: params.operationStartDate
556
+ activities: activities,
557
+ operations: {
558
+ start_date: params.operationStartDate
403
559
  },
404
560
  step_name: stepName,
405
- encryption_contract: ['brand.business_operation_start_at']
561
+ encryption_contract: ['operations.start_date']
406
562
  };
407
563
  return [4, API.brandService.updateBrandInfo(requestBody)];
408
564
  case 1:
@@ -415,49 +571,59 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
415
571
  }
416
572
  });
417
573
  }); });
418
- export var retrieveDataList = createAsyncThunk('bankRetrieveDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
419
- var _a, customerBases, expectedSales, expectedCustomerSales;
574
+ export var retrieveDataList = createAsyncThunk('businessRetrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
575
+ var settings, countryISO2, dataBody, salesDataBody, _a, customerBases, expectedSales, expectedCustomerSales;
420
576
  return __generator(this, function (_b) {
421
577
  switch (_b.label) {
422
- case 0: return [4, Promise.all([
423
- API.dataService.getCustomerBases(),
424
- API.dataService.getExpectedSales(),
425
- API.dataService.getExpectedCustomerSales()
426
- ])];
578
+ case 0:
579
+ settings = thunkApi.getState().settings;
580
+ countryISO2 = settings.data.businessCountry.iso2;
581
+ dataBody = {
582
+ page: 0
583
+ };
584
+ salesDataBody = {
585
+ page: 0,
586
+ country_code: [countryISO2]
587
+ };
588
+ return [4, Promise.all([
589
+ API.dataService.getCustomerBases(dataBody),
590
+ API.dataService.getExpectedSales(salesDataBody),
591
+ API.dataService.getExpectedCustomerSales(dataBody)
592
+ ])];
427
593
  case 1:
428
- _a = _b.sent(), customerBases = _a[0].data, expectedSales = _a[1].data, expectedCustomerSales = _a[2].data;
594
+ _a = _b.sent(), customerBases = _a[0].list, expectedSales = _a[1].list, expectedCustomerSales = _a[2].list;
429
595
  return [2, {
430
596
  customerBases: customerBases,
431
597
  expectedSales: expectedSales,
432
- expectedCustomerSales: expectedCustomerSales
598
+ expectedCustomerSales: expectedCustomerSales,
599
+ countryISO2: countryISO2
433
600
  }];
434
601
  }
435
602
  });
436
603
  }); });
437
604
  export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
438
- var _a, settings, business, id, customerBase, stepName, requestBody, data;
605
+ var _a, settings, business, id, customerLocation, customerBase, sales, stepName, requestBody, data;
439
606
  var _b, _c, _d, _e, _f, _g;
440
607
  return __generator(this, function (_h) {
441
608
  switch (_h.label) {
442
609
  case 0:
443
610
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
444
611
  id = (_c = (_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) === null || _c === void 0 ? void 0 : _c.id;
445
- customerBase = params.customerLocations.map(function (_a) {
446
- var id = _a.id;
447
- return id;
448
- });
612
+ customerLocation = params.customerLocations.map(function (location) { return ({
613
+ id: location === null || location === void 0 ? void 0 : location.id
614
+ }); });
615
+ customerBase = { id: ((_d = params.expectedCustomer) === null || _d === void 0 ? void 0 : _d.id) || '', period: 'monthly', locations: customerLocation };
616
+ sales = { id: ((_e = params.expectedSale) === null || _e === void 0 ? void 0 : _e.id) || '', period: 'monthly' };
449
617
  stepName = BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS;
450
618
  requestBody = {
451
- brand: {
452
- customers_base: customerBase,
453
- customers_served_monthly: parseInt(((_d = params.expectedCustomer) === null || _d === void 0 ? void 0 : _d.id) || '0'),
454
- monthly_sales_range: ((_e = params.expectedSale) === null || _e === void 0 ? void 0 : _e.id) || '',
455
- agree_refund: params.refundPolicy,
456
- agree_chargeback: params.transactionPolicy
619
+ operations: {
620
+ customer_base: customerBase,
621
+ sales: sales
457
622
  },
623
+ term: ['refund', 'chargeback'],
458
624
  id: id,
459
625
  step_name: stepName,
460
- encryption_contract: ['brand.customers_served_monthly', 'brand.monthly_sales_range']
626
+ encryption_contract: []
461
627
  };
462
628
  return [4, API.brandService.updateBrandInfo(requestBody)];
463
629
  case 1:
@@ -470,21 +636,21 @@ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', functio
470
636
  });
471
637
  }); });
472
638
  export var updateLeadSuccess = createAsyncThunk('businessUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
473
- var _a, settings, business, _b, steps, id, flowCompleted, boardResponse, payload, data, board_id, board_info_id;
639
+ var _a, settings, business, _b, steps, lead_id, flowCompleted, boardResponse, payload, data, board_id, board_info_id;
474
640
  var _c, _d, _e, _f;
475
641
  return __generator(this, function (_g) {
476
642
  switch (_g.label) {
477
643
  case 0:
478
644
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
479
- _b = business.data.verify.responseBody || {}, steps = _b.steps, id = _b.id;
645
+ _b = business.data.verify.responseBody || {}, steps = _b.steps, lead_id = _b.lead_id;
480
646
  flowCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
481
- if (flowCompleted || !id)
647
+ if (flowCompleted || !lead_id)
482
648
  return [2];
483
649
  boardResponse = undefined;
484
650
  payload = {
485
651
  lang: settings.data.language,
486
652
  step_name: BUSINESS_STEP_NAMES.BUSINESS_SUCCESS,
487
- id: id,
653
+ id: lead_id,
488
654
  encryption_contract: []
489
655
  };
490
656
  return [4, API.leadService.updateLead(payload)];
@@ -497,7 +663,9 @@ export var updateLeadSuccess = createAsyncThunk('businessUpdateLeadSuccess', fun
497
663
  case 2:
498
664
  boardResponse = _g.sent();
499
665
  _g.label = 3;
500
- case 3:
666
+ case 3: return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
667
+ case 4:
668
+ _g.sent();
501
669
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
502
670
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
503
671
  thunkApi.dispatch(handleNextScreenStep());
@@ -517,7 +685,7 @@ export var updateStepName = createAsyncThunk('updateStepName', function (stepNam
517
685
  business = thunkApi.getState().business;
518
686
  payload = {
519
687
  step_name: stepName,
520
- id: ((_a = business.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.id) || '',
688
+ id: ((_a = business.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.lead_id) || '',
521
689
  encryption_contract: []
522
690
  };
523
691
  return [4, API.leadService.updateLead(payload)];
@@ -531,6 +699,7 @@ var initialState = {
531
699
  error: null,
532
700
  loading: false,
533
701
  customLoading: false,
702
+ uploading: false,
534
703
  data: {
535
704
  flowName: FlowsTypes.BUSINESS,
536
705
  verify: {
@@ -540,18 +709,22 @@ var initialState = {
540
709
  otp: '',
541
710
  isNID: false
542
711
  },
712
+ civilIdData: {
713
+ civilId: ''
714
+ },
543
715
  nidData: {
544
716
  nid: '',
545
717
  dob: getEighteenYearsAgo(),
546
718
  type: ''
547
719
  },
548
720
  businessTypeData: {
549
- licenseNumber: ''
721
+ licenseNumber: '',
722
+ entityLegalName: '',
723
+ uploading: false
550
724
  },
551
725
  activitiesData: {
552
726
  activities: [],
553
- salesChannels: [],
554
- operationStartDate: '1998-08-22'
727
+ operationStartDate: moment(new Date()).format('YYYY-MM-DD')
555
728
  },
556
729
  customersData: {
557
730
  customerLocations: [],
@@ -583,68 +756,46 @@ export var businessSlice = createSlice({
583
756
  state.customLoading = true;
584
757
  })
585
758
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
586
- var _a, _b, _c, _d, _e, _f;
759
+ var _a, _b;
587
760
  state.error = null;
588
761
  state.customLoading = false;
589
- var _g = action.payload, data = _g.data, token = _g.token, leadData = _g.leadData, brandInfo = _g.brandInfo, boardId = _g.boardId;
590
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
591
- if (description) {
592
- state.error = description;
593
- return;
594
- }
595
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), leadData), state.data.verify.responseBody), { board_id: boardId });
596
- state.data.verify.token = token;
762
+ var _c = action.payload, data = _c.data, boardId = _c.boardId, brandData = _c.brandData, leadData = _c.leadData, token = _c.token, isRequireOTP = _c.isRequireOTP;
763
+ var responseBody = state.data.verify.responseBody;
764
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id });
765
+ if (token)
766
+ state.data.verify.token = token;
597
767
  state.data.otpData.isNID = false;
598
- var _h = state.data.verify.responseBody || {}, entity = _h.entity, entity_activities = _h.entity_activities, business_type = _h.business_type, brand = _h.brand;
599
- var issuingDate = (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_operation_start_at)
600
- ? brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_operation_start_at
601
- : (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
602
- if (!!issuingDate) {
603
- var formattedDate = moment(issuingDate).format('YYYY-MM-DD');
604
- state.data.activitiesData.operationStartDate = convertNumbers2English(formattedDate);
605
- }
606
- var channels = (_c = state.data.businessTypeData.responseBody) === null || _c === void 0 ? void 0 : _c.channelList;
607
- var selectedChannels = (!!(channels === null || channels === void 0 ? void 0 : channels[0]) && [channels === null || channels === void 0 ? void 0 : channels[0]]) || [];
608
- var _j = brand || {}, website = _j.website, social = _j.social;
609
- var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
610
- var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
611
- var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
612
- var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
613
- var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
614
- if (isHasWebsite && (isHasTwitter || isHasInstagram))
615
- selectedChannels = [websiteData, socialData];
616
- else if (isHasTwitter || isHasInstagram)
617
- selectedChannels = [socialData];
618
- else if (isHasWebsite)
619
- selectedChannels = [websiteData];
620
- if (((_d = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _d === void 0 ? void 0 : _d.length) > 0) {
621
- selectedChannels = channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
622
- var _a;
623
- return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.name_en.toLowerCase() === storedChannel.toLowerCase(); });
624
- });
625
- }
626
- state.data.activitiesData.salesChannels = selectedChannels;
768
+ if (isRequireOTP)
769
+ return;
770
+ var _d = state.data.verify.responseBody || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_type = _d.business_type, business_name = _d.business_name;
771
+ var issuingDate = (brandData === null || brandData === void 0 ? void 0 : brandData.business_operation_start_at) || ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.issuing_date);
772
+ if (issuingDate)
773
+ state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
627
774
  var activities = entity_activities || [];
628
775
  var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
629
- var _a;
630
- return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { var _a; return ((_a = activity.en) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === value.toLowerCase(); });
776
+ var activities = brandData.activities;
777
+ return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
631
778
  });
632
- state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]];
779
+ state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
633
780
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
634
- if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
635
- var licenseNumber_1 = (_e = entity === null || entity === void 0 ? void 0 : entity.license) === null || _e === void 0 ? void 0 : _e.number;
636
- var _k = state.data.businessTypeData || {}, responseBody = _k.responseBody, selectedLicense = _k.selectedLicense;
637
- var licenseList = (responseBody || {}).licenseList;
781
+ state.data.businessTypeData.entityLegalName = (business_name === null || business_name === void 0 ? void 0 : business_name.en) || '';
782
+ var license = (entity || {}).license;
783
+ if (license) {
784
+ var number_1 = license.number;
785
+ var _e = state.data.businessTypeData || {}, busResData = _e.responseBody, selectedLicense = _e.selectedLicense;
786
+ var licenseList = (busResData || {}).licenseList;
638
787
  var selectedLicenseData = selectedLicense;
639
- if (!!licenseNumber_1) {
640
- selectedLicenseData =
641
- ((_f = licenseList === null || licenseList === void 0 ? void 0 : licenseList.find) === null || _f === void 0 ? void 0 : _f.call(licenseList, function (_a) {
642
- var license = _a.license;
643
- return (license === null || license === void 0 ? void 0 : license.number) === licenseNumber_1;
644
- })) ||
645
- business_type === BusinessType.CR
646
- ? __assign(__assign({}, OTHER_CR_LICENSE), { license: { number: licenseNumber_1 } }) : __assign(__assign({}, OTHER_FL_LICENSE), { license: { number: licenseNumber_1 } });
647
- state.data.businessTypeData.licenseNumber = licenseNumber_1 || '';
788
+ if (number_1) {
789
+ var findFL = (_b = licenseList === null || licenseList === void 0 ? void 0 : licenseList.find) === null || _b === void 0 ? void 0 : _b.call(licenseList, function (_a) {
790
+ var license = _a.license;
791
+ return (license === null || license === void 0 ? void 0 : license.number) === number_1;
792
+ });
793
+ if (findFL || business_type === BusinessType.FL) {
794
+ selectedLicenseData = __assign(__assign({}, OTHER_FL_LICENSE), { license: { number: number_1 } });
795
+ }
796
+ else
797
+ selectedLicenseData = __assign(__assign({}, OTHER_CR_LICENSE), { license: { number: number_1 } });
798
+ state.data.businessTypeData.licenseNumber = number_1;
648
799
  }
649
800
  state.data.businessTypeData.selectedLicense = __assign(__assign({}, selectedLicenseData), { type: business_type });
650
801
  }
@@ -675,67 +826,42 @@ export var businessSlice = createSlice({
675
826
  state.error = null;
676
827
  })
677
828
  .addCase(verifyLeadOTP.fulfilled, function (state, action) {
678
- var _a, _b, _c, _d, _e, _f;
829
+ var _a, _b;
679
830
  state.loading = false;
680
831
  state.error = null;
681
- var _g = action.payload, data = _g.data, formData = _g.formData, brandInfo = _g.brandInfo;
682
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
683
- if (description) {
684
- state.error = description;
685
- return;
686
- }
832
+ var _c = action.payload, data = _c.data, formData = _c.formData, brand = _c.brand, leadData = _c.leadData;
687
833
  state.data.otpData = formData;
688
834
  state.data.otpData.responseBody = data;
689
- var _h = state.data.verify.responseBody || {}, entity = _h.entity, entity_activities = _h.entity_activities, business_type = _h.business_type, brand = _h.brand;
690
- var issuingDate = (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_operation_start_at)
691
- ? brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_operation_start_at
692
- : (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
693
- if (!!issuingDate) {
694
- var formattedDate = moment(issuingDate).format('YYYY-MM-DD');
695
- state.data.activitiesData.operationStartDate = convertNumbers2English(formattedDate);
696
- }
697
- var channels = (_c = state.data.businessTypeData.responseBody) === null || _c === void 0 ? void 0 : _c.channelList;
698
- var selectedChannels = (!!(channels === null || channels === void 0 ? void 0 : channels[0]) && [channels === null || channels === void 0 ? void 0 : channels[0]]) || [];
699
- var _j = brand || {}, website = _j.website, social = _j.social;
700
- var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
701
- var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
702
- var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
703
- var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
704
- var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
705
- if (isHasWebsite && (isHasTwitter || isHasInstagram))
706
- selectedChannels = [websiteData, socialData];
707
- else if (isHasTwitter || isHasInstagram)
708
- selectedChannels = [socialData];
709
- else if (isHasWebsite)
710
- selectedChannels = [websiteData];
711
- if (((_d = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _d === void 0 ? void 0 : _d.length) > 0) {
712
- selectedChannels = channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
713
- var _a;
714
- return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.name_en.toLowerCase() === storedChannel.toLowerCase(); });
715
- });
716
- }
717
- state.data.activitiesData.salesChannels = selectedChannels;
835
+ state.data.verify.responseBody = __assign(__assign(__assign({}, leadData), state.data.verify.responseBody), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
836
+ var _d = leadData || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_type = _d.business_type, business_name = _d.business_name;
837
+ var issuingDate = (brand === null || brand === void 0 ? void 0 : brand.business_operation_start_at) || ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.issuing_date);
838
+ if (issuingDate)
839
+ state.data.activitiesData.operationStartDate = convertNumbers2English(dateFormat(issuingDate));
718
840
  var activities = entity_activities || [];
719
841
  var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
720
- var _a;
721
- return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { var _a; return ((_a = activity.en) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === value.toLowerCase(); });
842
+ var activities = brand.activities;
843
+ return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return value.id === activity.id; });
722
844
  });
723
- state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]];
845
+ state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
724
846
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
725
- if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
726
- var licenseNumber_2 = (_e = entity === null || entity === void 0 ? void 0 : entity.license) === null || _e === void 0 ? void 0 : _e.number;
727
- var _k = state.data.businessTypeData || {}, responseBody = _k.responseBody, selectedLicense = _k.selectedLicense;
728
- var licenseList = (responseBody || {}).licenseList;
847
+ state.data.businessTypeData.entityLegalName = (business_name === null || business_name === void 0 ? void 0 : business_name.en) || '';
848
+ var license = (entity || {}).license;
849
+ if (license) {
850
+ var number_2 = license.number;
851
+ var _e = state.data.businessTypeData || {}, busResData = _e.responseBody, selectedLicense = _e.selectedLicense;
852
+ var licenseList = (busResData || {}).licenseList;
729
853
  var selectedLicenseData = selectedLicense;
730
- if (!!licenseNumber_2) {
731
- selectedLicenseData =
732
- ((_f = licenseList === null || licenseList === void 0 ? void 0 : licenseList.find) === null || _f === void 0 ? void 0 : _f.call(licenseList, function (_a) {
733
- var license = _a.license;
734
- return (license === null || license === void 0 ? void 0 : license.number) === licenseNumber_2;
735
- })) ||
736
- business_type === BusinessType.CR
737
- ? __assign(__assign({}, OTHER_CR_LICENSE), { license: { number: licenseNumber_2 } }) : __assign(__assign({}, OTHER_FL_LICENSE), { license: { number: licenseNumber_2 } });
738
- state.data.businessTypeData.licenseNumber = licenseNumber_2 || '';
854
+ if (number_2) {
855
+ var findFL = (_b = licenseList === null || licenseList === void 0 ? void 0 : licenseList.find) === null || _b === void 0 ? void 0 : _b.call(licenseList, function (_a) {
856
+ var license = _a.license;
857
+ return (license === null || license === void 0 ? void 0 : license.number) === number_2;
858
+ });
859
+ if (findFL || business_type === BusinessType.FL) {
860
+ selectedLicenseData = __assign(__assign({}, OTHER_FL_LICENSE), { license: { number: number_2 } });
861
+ }
862
+ else
863
+ selectedLicenseData = __assign(__assign({}, OTHER_CR_LICENSE), { license: { number: number_2 } });
864
+ state.data.businessTypeData.licenseNumber = number_2;
739
865
  }
740
866
  state.data.businessTypeData.selectedLicense = __assign(__assign({}, selectedLicenseData), { type: business_type });
741
867
  }
@@ -743,6 +869,42 @@ export var businessSlice = createSlice({
743
869
  .addCase(verifyLeadOTP.rejected, function (state, action) {
744
870
  state.loading = false;
745
871
  state.error = action.error.message;
872
+ })
873
+ .addCase(createCivilIdAuth.pending, function (state, action) {
874
+ state.loading = true;
875
+ state.error = null;
876
+ })
877
+ .addCase(createCivilIdAuth.fulfilled, function (state, action) {
878
+ var _a;
879
+ state.loading = false;
880
+ state.error = null;
881
+ var _b = action.payload, formData = _b.formData, response = _b.response;
882
+ var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
883
+ if (description) {
884
+ state.error = description;
885
+ return;
886
+ }
887
+ state.data.civilIdData = __assign(__assign({}, formData), { responseBody: response });
888
+ })
889
+ .addCase(createCivilIdAuth.rejected, function (state, action) {
890
+ state.loading = false;
891
+ state.error = action.error.message;
892
+ })
893
+ .addCase(verifyPACI.pending, function (state) {
894
+ state.loading = true;
895
+ state.error = null;
896
+ })
897
+ .addCase(verifyPACI.fulfilled, function (state, action) {
898
+ state.loading = false;
899
+ state.error = null;
900
+ state.data.otpData.responseBody = action.payload.response;
901
+ })
902
+ .addCase(verifyPACI.rejected, function (state, action) {
903
+ state.loading = false;
904
+ var error = action.error.message;
905
+ if (error !== 'Aborted') {
906
+ state.error = error;
907
+ }
746
908
  })
747
909
  .addCase(updateLeadIdentity.pending, function (state) {
748
910
  state.loading = true;
@@ -836,42 +998,6 @@ export var businessSlice = createSlice({
836
998
  .addCase(retrieveBoardDetails.rejected, function (state, action) {
837
999
  state.error = action.error.message;
838
1000
  state.loading = false;
839
- })
840
- .addCase(retrieveChannels.pending, function (state) {
841
- state.error = null;
842
- state.loading = true;
843
- })
844
- .addCase(retrieveChannels.fulfilled, function (state, action) {
845
- var _a;
846
- state.error = null;
847
- state.loading = false;
848
- var data = action.payload || {};
849
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
850
- if (description) {
851
- state.error = description;
852
- return;
853
- }
854
- var channels = data || [];
855
- state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { channelList: channels });
856
- var brand = (state.data.verify.responseBody || {}).brand;
857
- var selectedChannels = (!!(channels === null || channels === void 0 ? void 0 : channels[0]) && [channels === null || channels === void 0 ? void 0 : channels[0]]) || [];
858
- var _b = brand || {}, website = _b.website, social = _b.social;
859
- var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
860
- var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
861
- var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
862
- var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
863
- var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
864
- if (isHasWebsite && (isHasTwitter || isHasInstagram))
865
- selectedChannels = [websiteData, socialData];
866
- else if (isHasTwitter || isHasInstagram)
867
- selectedChannels = [socialData];
868
- else if (isHasWebsite)
869
- selectedChannels = [websiteData];
870
- state.data.activitiesData.salesChannels = selectedChannels;
871
- })
872
- .addCase(retrieveChannels.rejected, function (state, action) {
873
- state.error = action.error.message;
874
- state.loading = false;
875
1001
  })
876
1002
  .addCase(updateLeadBusinessType.pending, function (state) {
877
1003
  state.loading = true;
@@ -881,7 +1007,7 @@ export var businessSlice = createSlice({
881
1007
  var _a;
882
1008
  state.loading = false;
883
1009
  state.error = null;
884
- var _b = action.payload, data = _b.data, formData = _b.formData, accountData = _b.accountData;
1010
+ var _b = action.payload, data = _b.data, formData = _b.formData, accountData = _b.accountData, documentData = _b.documentData;
885
1011
  state.data.businessTypeData = __assign(__assign({}, state.data.businessTypeData), formData);
886
1012
  var entity = data.entity, entity_activities = data.entity_activities;
887
1013
  var issuingDate = (_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.issuing_date;
@@ -894,15 +1020,26 @@ export var businessSlice = createSlice({
894
1020
  state.data.activitiesData.operationStartDate = convertNumbers2English(formattedDate);
895
1021
  }
896
1022
  var activities = entity_activities || [];
897
- var selectedActivity = activities === null || activities === void 0 ? void 0 : activities[0];
898
- if (!!selectedActivity)
899
- state.data.activitiesData.activities = [selectedActivity];
900
- state.data.businessTypeData.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activities: activities }), accountData);
1023
+ state.data.businessTypeData.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activities: activities }), accountData), documentData);
901
1024
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity });
902
1025
  })
903
1026
  .addCase(updateLeadBusinessType.rejected, function (state, action) {
904
1027
  state.loading = false;
905
1028
  state.error = action.error.message;
1029
+ })
1030
+ .addCase(uploadLicenseCertificate.pending, function (state) {
1031
+ state.error = null;
1032
+ state.uploading = true;
1033
+ })
1034
+ .addCase(uploadLicenseCertificate.fulfilled, function (state, action) {
1035
+ state.error = null;
1036
+ state.uploading = false;
1037
+ var data = action.payload.data;
1038
+ state.data.businessTypeData.certificateId = data === null || data === void 0 ? void 0 : data.id;
1039
+ })
1040
+ .addCase(uploadLicenseCertificate.rejected, function (state) {
1041
+ state.uploading = false;
1042
+ state.error = 'file_upload_error';
906
1043
  })
907
1044
  .addCase(updateActivitiesInfo.pending, function (state) {
908
1045
  state.loading = true;
@@ -913,10 +1050,7 @@ export var businessSlice = createSlice({
913
1050
  state.error = null;
914
1051
  var _a = action.payload, data = _a.data, formData = _a.formData;
915
1052
  state.data.activitiesData = formData;
916
- console.log('updateActivitiesInfo', state.data.activitiesData.responseBody);
917
- console.log('updateActivitiesInfo', data);
918
1053
  state.data.activitiesData.responseBody = __assign(__assign({}, data), state.data.activitiesData.responseBody);
919
- console.log('updateActivitiesInfo', state.data.activitiesData.responseBody);
920
1054
  })
921
1055
  .addCase(updateActivitiesInfo.rejected, function (state, action) {
922
1056
  state.loading = false;
@@ -930,16 +1064,16 @@ export var businessSlice = createSlice({
930
1064
  var _a, _b;
931
1065
  state.loading = false;
932
1066
  state.error = null;
933
- var payload = action.payload;
934
- var customerBases = payload.customerBases || [];
935
- var customerBase = customerBases === null || customerBases === void 0 ? void 0 : customerBases[1];
936
- var expectedSales = payload.expectedSales || [];
937
- var expectedSale = (_b = (_a = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales[0]) === null || _a === void 0 ? void 0 : _a.sub) === null || _b === void 0 ? void 0 : _b[4];
938
- var expectedCustomerSales = payload.expectedCustomerSales || [];
939
- var expectedCustomerSale = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales[3];
1067
+ var _c = action.payload, customerBases = _c.customerBases, expectedSales = _c.expectedSales, expectedCustomerSales = _c.expectedCustomerSales, countryISO2 = _c.countryISO2;
1068
+ var regional = customerBases.at(1);
1069
+ var local = customerBases.at(0);
1070
+ var expectedSale = (_b = (_a = expectedSales.at(0)) === null || _a === void 0 ? void 0 : _a.sub) === null || _b === void 0 ? void 0 : _b.at(4);
1071
+ var expectedCustomerSale = expectedCustomerSales.at(3);
940
1072
  state.data.activitiesData.responseBody = __assign(__assign({}, state.data.activitiesData.responseBody), { customerBases: customerBases, expectedSales: expectedSales, expectedCustomerSales: expectedCustomerSales });
941
- if (!!customerBase)
942
- state.data.customersData.customerLocations = [customerBase];
1073
+ if (local && isKW(countryISO2))
1074
+ state.data.customersData.customerLocations = [local];
1075
+ if (regional && local && isSA(countryISO2))
1076
+ state.data.customersData.customerLocations = [regional, local];
943
1077
  if (!!expectedSale)
944
1078
  state.data.customersData.expectedSale = expectedSale;
945
1079
  if (!!expectedCustomerSale)
@@ -965,8 +1099,9 @@ export var businessSlice = createSlice({
965
1099
  state.error = action.error.message;
966
1100
  })
967
1101
  .addCase(updateLeadSuccess.fulfilled, function (state, action) {
968
- var _a;
1102
+ var _a, _b;
969
1103
  state.loading = false;
1104
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: false });
970
1105
  state.error = null;
971
1106
  var response = (action.payload || {}).response;
972
1107
  var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -974,14 +1109,16 @@ export var businessSlice = createSlice({
974
1109
  state.error = description;
975
1110
  return;
976
1111
  }
977
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
1112
+ state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), response), { name: (_b = state.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.name });
978
1113
  })
979
1114
  .addCase(updateLeadSuccess.pending, function (state) {
980
1115
  state.loading = true;
1116
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: true });
981
1117
  state.error = null;
982
1118
  })
983
1119
  .addCase(updateLeadSuccess.rejected, function (state, action) {
984
1120
  state.loading = false;
1121
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: false });
985
1122
  state.error = action.error.message;
986
1123
  });
987
1124
  }