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

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