@tap-payments/auth-jsconnect 2.8.44-test → 2.8.45-beta

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 (178) hide show
  1. package/build/@types/form.d.ts +0 -1
  2. package/build/@types/redux.d.ts +0 -1
  3. package/build/api/axios.js +1 -2
  4. package/build/api/entity.d.ts +2 -2
  5. package/build/api/entity.js +4 -12
  6. package/build/api/index.d.ts +2 -2
  7. package/build/constants/api.d.ts +1 -0
  8. package/build/constants/api.js +2 -0
  9. package/build/constants/app.d.ts +2 -0
  10. package/build/constants/app.js +11 -3
  11. package/build/features/app/bank/bankStore.d.ts +18 -13
  12. package/build/features/app/bank/bankStore.js +161 -173
  13. package/build/features/app/board/boardStore.js +30 -52
  14. package/build/features/app/brand/brandStore.d.ts +33 -16
  15. package/build/features/app/brand/brandStore.js +204 -173
  16. package/build/features/app/business/businessStore.d.ts +5 -0
  17. package/build/features/app/business/businessStore.js +86 -69
  18. package/build/features/app/connectExpress/connectExpressStore.js +10 -18
  19. package/build/features/app/entity/entityStore.d.ts +35 -15
  20. package/build/features/app/entity/entityStore.js +228 -159
  21. package/build/features/app/individual/individualStore.d.ts +37 -21
  22. package/build/features/app/individual/individualStore.js +265 -253
  23. package/build/features/app/password/passwordStore.d.ts +23 -40
  24. package/build/features/app/password/passwordStore.js +233 -226
  25. package/build/features/app/tax/taxStore.d.ts +7 -13
  26. package/build/features/app/tax/taxStore.js +147 -167
  27. package/build/features/bank/Bank.d.ts +0 -1
  28. package/build/features/bank/Bank.js +4 -7
  29. package/build/features/bank/screens/BankDetails/BankDetails.js +4 -12
  30. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  31. package/build/features/bank/screens/Verify/Verify.js +5 -5
  32. package/build/features/board/Board.js +4 -8
  33. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
  34. package/build/features/brand/Brand.d.ts +0 -1
  35. package/build/features/brand/Brand.js +4 -7
  36. package/build/features/brand/screens/BrandActivities/BrandActivities.js +1 -1
  37. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
  38. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  39. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  40. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  41. package/build/features/brand/screens/BrandInfo/BrandInfo.js +1 -1
  42. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +1 -1
  43. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  44. package/build/features/brand/screens/Verify/Verify.js +1 -1
  45. package/build/features/business/Business.js +4 -9
  46. package/build/features/business/screens/Activities/Activities.js +1 -1
  47. package/build/features/business/screens/BusinessType/BusinessType.js +1 -1
  48. package/build/features/business/screens/CivilID/CivilID.js +1 -1
  49. package/build/features/business/screens/Customers/Customers.js +1 -1
  50. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
  51. package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
  52. package/build/features/business/screens/OTP/OTP.js +1 -1
  53. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  54. package/build/features/business/screens/Verify/Verify.js +1 -1
  55. package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
  56. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +1 -2
  57. package/build/features/connect/screens/CivilID/CivilID.js +1 -1
  58. package/build/features/connect/screens/Individual/Email.js +1 -3
  59. package/build/features/connect/screens/Individual/Individual.js +1 -1
  60. package/build/features/connect/screens/Merchant/BrandList.js +3 -3
  61. package/build/features/connect/screens/Merchant/Merchant.js +1 -1
  62. package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
  63. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  64. package/build/features/connect/screens/NID/NID.js +1 -1
  65. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  66. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
  67. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
  68. package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
  69. package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
  70. package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
  71. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
  72. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
  73. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
  74. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  75. package/build/features/connectExpress/screens/Mobile/Mobile.js +1 -1
  76. package/build/features/connectExpress/screens/NID/NID.js +1 -1
  77. package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
  78. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  79. package/build/features/entity/Entity.d.ts +0 -1
  80. package/build/features/entity/Entity.js +4 -7
  81. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
  82. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
  83. package/build/features/entity/screens/EntityCapital/EntityCapital.js +1 -1
  84. package/build/features/entity/screens/EntityName/EntityName.js +1 -1
  85. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  86. package/build/features/entity/screens/Verify/Verify.js +1 -1
  87. package/build/features/featuresScreens.js +7 -62
  88. package/build/features/individual/Individual.d.ts +0 -1
  89. package/build/features/individual/Individual.js +4 -7
  90. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -14
  91. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
  92. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  93. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
  94. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
  95. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  96. package/build/features/individual/screens/IndividualList/IndividualList.js +5 -11
  97. package/build/features/individual/screens/IndividualList/UserList.js +9 -13
  98. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  99. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -4
  100. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  101. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  102. package/build/features/individual/screens/Verify/Verify.js +1 -1
  103. package/build/features/password/Password.d.ts +0 -1
  104. package/build/features/password/Password.js +28 -75
  105. package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
  106. package/build/features/password/screens/OTP/OTP.js +1 -1
  107. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  108. package/build/features/password/screens/Verify/Verify.js +5 -5
  109. package/build/features/shared/Button/FlowsButtons.js +3 -4
  110. package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
  111. package/build/features/shared/Containers/FeatureContainer.js +3 -3
  112. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
  113. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
  114. package/build/features/signIn/SignIn.js +3 -12
  115. package/build/features/tax/Tax.d.ts +0 -1
  116. package/build/features/tax/Tax.js +4 -7
  117. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  118. package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
  119. package/build/features/tax/screens/Verify/Verify.js +5 -5
  120. package/build/hooks/index.d.ts +0 -1
  121. package/build/hooks/index.js +0 -1
  122. package/build/hooks/useVerifyToken.d.ts +2 -5
  123. package/build/hooks/useVerifyToken.js +5 -10
  124. package/build/utils/common.js +4 -4
  125. package/build/utils/locale.js +1 -2
  126. package/build/utils/string.d.ts +2 -5
  127. package/build/utils/string.js +5 -34
  128. package/package.json +2 -2
  129. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
  130. package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
  131. package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
  132. package/build/features/bank/screens/OperatorError/index.js +0 -2
  133. package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
  134. package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
  135. package/build/features/board/screens/OperatorError/index.d.ts +0 -3
  136. package/build/features/board/screens/OperatorError/index.js +0 -2
  137. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
  138. package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
  139. package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
  140. package/build/features/brand/screens/OperatorError/index.js +0 -2
  141. package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
  142. package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
  143. package/build/features/business/screens/OperatorError/index.d.ts +0 -3
  144. package/build/features/business/screens/OperatorError/index.js +0 -2
  145. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -31
  146. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
  147. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
  148. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
  149. package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
  150. package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
  151. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
  152. package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
  153. package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
  154. package/build/features/entity/screens/OperatorError/index.js +0 -2
  155. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -36
  156. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
  157. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
  158. package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
  159. package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
  160. package/build/features/individual/screens/OperatorError/index.js +0 -2
  161. package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
  162. package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
  163. package/build/features/password/screens/OperatorError/index.d.ts +0 -3
  164. package/build/features/password/screens/OperatorError/index.js +0 -2
  165. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
  166. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
  167. package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
  168. package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
  169. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
  170. package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
  171. package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
  172. package/build/features/signIn/screens/OperatorError/index.js +0 -2
  173. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
  174. package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
  175. package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
  176. package/build/features/tax/screens/OperatorError/index.js +0 -2
  177. package/build/hooks/useFormDirtyCheck.d.ts +0 -6
  178. package/build/hooks/useFormDirtyCheck.js +0 -29
@@ -63,13 +63,13 @@ import { FlowsTypes } from '../../../@types';
63
63
  import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
64
64
  import { BRAND_STEP_NAMES, EXPECTED_SALES_LIST } from '../../../constants';
65
65
  import { hasNoneEditableValue, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sleep } from '../../../utils';
66
- export var verifyLeadToken = createAsyncThunk('brand/verifyLeadToken', function (_a, thunkApi) {
66
+ export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (_a, thunkApi) {
67
67
  var token = _a.token, isInternally = _a.isInternally;
68
68
  return __awaiter(void 0, void 0, void 0, function () {
69
- var payload, data, _b, config, brand_id, entity_id, board_id, country_code, publicKey, salesChannels, brandData, data_1;
70
- var _c, _d, _e;
71
- return __generator(this, function (_f) {
72
- switch (_f.label) {
69
+ var payload, data, countryIso2, _b, board_id, board_info_id, config, publicKey, salesChannels, boardData, boardInfoData, individualData, _c, id_1, type_1, serviceCallBack, _d, boardRes, individualRes;
70
+ var _e, _f, _g, _h;
71
+ return __generator(this, function (_j) {
72
+ switch (_j.label) {
73
73
  case 0:
74
74
  payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
75
75
  notification: {
@@ -78,47 +78,69 @@ export var verifyLeadToken = createAsyncThunk('brand/verifyLeadToken', function
78
78
  }));
79
79
  return [4, API.leadService.verifyLeadToken(payload)];
80
80
  case 1:
81
- data = (_f.sent()).data;
82
- if (((_c = data === null || data === void 0 ? void 0 : data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
83
- throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
84
- _b = data || {}, config = _b.config, brand_id = _b.brand_id, entity_id = _b.entity_id, board_id = _b.id, country_code = _b.country_code;
81
+ data = (_j.sent()).data;
82
+ if ((data === null || data === void 0 ? void 0 : data.errors) && (data === null || data === void 0 ? void 0 : data.mw_error)) {
83
+ throw new Error(data.errors[0].description);
84
+ }
85
+ countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
86
+ if (countryIso2)
87
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
88
+ _b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id, config = _b.config;
85
89
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
86
- if (country_code)
87
- thunkApi.dispatch(handleSetCountryByIso2(country_code));
88
- if (publicKey)
90
+ if (publicKey) {
89
91
  thunkApi.dispatch(handlePublicKey(publicKey));
90
- brandData = undefined;
92
+ }
93
+ if (!board_id) {
94
+ throw new Error('Internal server error');
95
+ }
96
+ individualData = undefined;
91
97
  if (isInternally)
92
98
  data.step_name = BRAND_STEP_NAMES.BRAND_INFO;
93
99
  if (!(data.step_name !== BRAND_STEP_NAMES.PHONE_AUTH || isInternally)) return [3, 7];
94
- if (!(!brand_id || !country_code)) return [3, 3];
95
- return [4, API.boardService.retrieveBoardDetails(board_id)];
100
+ if (!board_info_id) return [3, 3];
101
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
96
102
  case 2:
97
- data_1 = _f.sent();
98
- if (!country_code && ((_d = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _d === void 0 ? void 0 : _d.country))
99
- thunkApi.dispatch(handleSetCountryByIso2(data_1.entity.country));
100
- if (!((_e = data_1 === null || data_1 === void 0 ? void 0 : data_1.brand) === null || _e === void 0 ? void 0 : _e.id))
101
- throw new Error('brand_id_missing');
102
- brandData = data_1 === null || data_1 === void 0 ? void 0 : data_1.brand;
103
- return [3, 5];
104
- case 3: return [4, API.brandService.retrieveBrand(brand_id)];
103
+ boardInfoData = _j.sent();
104
+ _j.label = 3;
105
+ case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
105
106
  case 4:
106
- brandData = _f.sent();
107
- _f.label = 5;
108
- case 5: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
107
+ boardData = _j.sent();
108
+ _c = ((_e = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _e === void 0 ? void 0 : _e.recipient) || {}, id_1 = _c.id, type_1 = _c.type;
109
+ serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
110
+ return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
111
+ case 5:
112
+ _d = _j.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
113
+ boardData = boardRes;
114
+ individualData = individualRes;
115
+ if (!countryIso2 && ((_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country)) {
116
+ countryIso2 = boardData.entity.country;
117
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
118
+ }
119
+ return [4, API.dataService.getChannelsOfServices({ page: 0 })];
109
120
  case 6:
110
- salesChannels = _f.sent();
121
+ salesChannels = _j.sent();
111
122
  if (isInternally)
112
123
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP')); });
113
124
  else
114
125
  thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP'));
115
- _f.label = 7;
126
+ _j.label = 7;
116
127
  case 7: return [2, {
117
128
  data: data,
118
- brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
129
+ individualData: individualData,
130
+ boardResponse: {
131
+ user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
132
+ brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
133
+ entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
134
+ bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
135
+ merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
136
+ name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names,
137
+ contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact,
138
+ individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
139
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
140
+ notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
141
+ },
119
142
  salesChannels: salesChannels,
120
- token: token,
121
- entityInfoId: entity_id
143
+ token: token
122
144
  }];
123
145
  }
124
146
  });
@@ -141,58 +163,78 @@ export var resendOTP = createAsyncThunk('brandResendOTP', function (params, thun
141
163
  }
142
164
  });
143
165
  }); });
144
- export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
145
- var _a, brand, settings, responseBody, payload, data, publicKey, countryIso2, _b, brand_id, entity_id, boardId, brandData, data_2, salesChannels;
146
- var _c, _d, _e, _f, _g, _h, _j;
147
- return __generator(this, function (_k) {
148
- switch (_k.label) {
166
+ export var verifyBrandLeadOTP = createAsyncThunk('verifyBrandLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
167
+ var _a, brand, settings, responseBody, payload, data, countryIso2, publicKey, _b, board_id, board_info_id, boardInfoData, individualData, boardData, _c, id, type, serviceCallBack, _d, boardRes, individualRes, salesChannels;
168
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o;
169
+ return __generator(this, function (_p) {
170
+ switch (_p.label) {
149
171
  case 0:
150
172
  _a = thunkApi.getState(), brand = _a.brand, settings = _a.settings;
151
173
  responseBody = brand.data.verify.responseBody;
152
174
  payload = {
153
175
  data: params.otp,
154
- service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
176
+ service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
155
177
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
156
178
  step_name: BRAND_STEP_NAMES.PHONE_AUTH,
157
179
  encryption_contract: ['data']
158
180
  };
159
181
  return [4, API.leadService.verifyLeadOTP(payload)];
160
182
  case 1:
161
- data = (_k.sent()).data;
162
- if ((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length)
183
+ data = (_p.sent()).data;
184
+ if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
163
185
  throw new Error(data.errors[0].description);
164
- publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
165
- countryIso2 = (data === null || data === void 0 ? void 0 : data.country_code) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
166
- if (publicKey)
167
- thunkApi.dispatch(handlePublicKey(publicKey));
186
+ countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
168
187
  if (countryIso2)
169
188
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
170
- _b = data || {}, brand_id = _b.brand_id, entity_id = _b.entity_id, boardId = _b.id;
171
- brandData = undefined;
172
- if (!(!brand_id || !countryIso2)) return [3, 3];
173
- return [4, API.boardService.retrieveBoardDetails(boardId)];
189
+ publicKey = (_g = data === null || data === void 0 ? void 0 : data.config) === null || _g === void 0 ? void 0 : _g.public_key;
190
+ if (publicKey) {
191
+ thunkApi.dispatch(handlePublicKey(publicKey));
192
+ }
193
+ _b = responseBody || {}, board_id = _b.id, board_info_id = _b.board_info_id;
194
+ if (!board_id) {
195
+ throw new Error('Internal server error');
196
+ }
197
+ individualData = undefined;
198
+ if (!board_info_id) return [3, 3];
199
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
174
200
  case 2:
175
- data_2 = _k.sent();
176
- if (!countryIso2 && ((_f = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _f === void 0 ? void 0 : _f.country))
177
- thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
178
- if (!((_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.brand) === null || _g === void 0 ? void 0 : _g.id))
179
- throw new Error('brand_id_missing');
180
- brandData = data_2;
181
- return [3, 5];
182
- case 3: return [4, API.brandService.retrieveBrand(brand_id)];
201
+ boardInfoData = _p.sent();
202
+ _p.label = 3;
203
+ case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
183
204
  case 4:
184
- brandData = _k.sent();
185
- _k.label = 5;
186
- case 5: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
205
+ boardData = _p.sent();
206
+ _c = ((_h = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _h === void 0 ? void 0 : _h.recipient) || {}, id = _c.id, type = _c.type;
207
+ serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
208
+ return [4, retrieveIndividualData(type, boardData, serviceCallBack)];
209
+ case 5:
210
+ _d = _p.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
211
+ boardData = boardRes;
212
+ individualData = individualRes;
213
+ if (!countryIso2 && ((_j = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _j === void 0 ? void 0 : _j.country)) {
214
+ countryIso2 = boardData.entity.country;
215
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
216
+ }
217
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
218
+ return [4, API.dataService.getChannelsOfServices({ page: 0 })];
187
219
  case 6:
188
- salesChannels = _k.sent();
189
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { otp: params.otp });
220
+ salesChannels = _p.sent();
190
221
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP')); });
191
222
  return [2, {
192
223
  data: data,
193
- brandData: brandData === null || brandData === void 0 ? void 0 : brandData.brand,
224
+ individualData: individualData,
225
+ boardResponse: {
226
+ user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
227
+ brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
228
+ entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
229
+ bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
230
+ merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
231
+ name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
232
+ contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
233
+ individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
234
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
235
+ notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
236
+ },
194
237
  salesChannels: salesChannels,
195
- entityInfoId: entity_id,
196
238
  formData: params
197
239
  }];
198
240
  }
@@ -222,52 +264,35 @@ export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataL
222
264
  }
223
265
  });
224
266
  }); });
225
- export var retrieveBoardStatus = createAsyncThunk('brand/retrieveBoardStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
226
- var brand, _a, board_id, board_info_id, recipient, _b, id, type, data;
227
- return __generator(this, function (_c) {
228
- switch (_c.label) {
267
+ export var retrieveBoardStatus = createAsyncThunk('brand/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
268
+ var brand, board_id, data;
269
+ return __generator(this, function (_a) {
270
+ switch (_a.label) {
229
271
  case 0:
230
272
  brand = thunkApi.getState().brand;
231
- _a = brand.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
232
- if (!board_id || !board_info_id)
233
- throw new Error('Internal server error');
234
- _b = recipient || {}, id = _b.id, type = _b.type;
235
- return [4, Promise.all([
236
- API.boardService.retrieveBoardInfoStatus(board_id),
237
- thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
238
- ])];
273
+ board_id = (brand.data.verify.responseBody || {}).board_id;
274
+ return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
239
275
  case 1:
240
- data = (_c.sent())[0];
276
+ data = _a.sent();
241
277
  thunkApi.dispatch(handlePrevScreenStep());
242
278
  return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
243
279
  }
244
280
  });
245
281
  }); });
246
- export var retrieveBoardDetails = createAsyncThunk('brand/retrieveBoardDetails', function (_a) {
247
- var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
248
- return __awaiter(void 0, void 0, void 0, function () {
249
- var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
250
- var _c, _d, _e;
251
- return __generator(this, function (_f) {
252
- switch (_f.label) {
253
- case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
254
- case 1:
255
- data = _f.sent();
256
- individualData = data === null || data === void 0 ? void 0 : data.user;
257
- boardData = data;
258
- if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
259
- serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
260
- return [4, retrieveIndividualData(type, data, serviceCallBack)];
261
- case 2:
262
- _b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
263
- individualData = individualRes;
264
- boardData = boardRes;
265
- _f.label = 3;
266
- case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData })];
267
- }
268
- });
282
+ export var retrieveBoardDetails = createAsyncThunk('brandRetrieveBrandInfo', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
283
+ var data;
284
+ var _a, _b;
285
+ return __generator(this, function (_c) {
286
+ switch (_c.label) {
287
+ case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
288
+ case 1:
289
+ data = _c.sent();
290
+ return [2, {
291
+ 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, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
292
+ }];
293
+ }
269
294
  });
270
- });
295
+ }); });
271
296
  export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailability', function (_a, thunkApi) {
272
297
  var cancelToken = _a.cancelToken, name = _a.name, onSuccess = _a.onSuccess;
273
298
  return __awaiter(void 0, void 0, void 0, function () {
@@ -296,10 +321,10 @@ export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailabi
296
321
  export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thunkApi) {
297
322
  var formData = _a.formData, originalFormData = _a.originalFormData;
298
323
  return __awaiter(void 0, void 0, void 0, function () {
299
- var _b, settings, brand, brandRes, _c, id, data_status, isNameENNonEditable, isNameARNonEditable, isChannelServicesNonEditable, salesChannels, brandName, brandLogoId, getAddress, channel_services, brandNameIsEditable, requestBody, _d, brandData, teamSizeList, _e, segmentLocation, segmentProfit, segmentTech;
300
- var _f, _g;
301
- return __generator(this, function (_h) {
302
- switch (_h.label) {
324
+ var _b, settings, brand, brandRes, _c, id, data_status, isNameENNonEditable, isNameARNonEditable, isChannelServicesNonEditable, salesChannels, brandName, brandLogoId, getAddress, channel_services, brandNameIsEditable, requestBody, brandData, _d, segmentLocation, segmentProfit, segmentTech, teamSizeList;
325
+ var _e, _f;
326
+ return __generator(this, function (_g) {
327
+ switch (_g.label) {
303
328
  case 0:
304
329
  _b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
305
330
  brandRes = (brand.data.verify.responseBody || {}).brand;
@@ -334,17 +359,17 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
334
359
  ar: !isNameARNonEditable ? brandName : undefined
335
360
  }
336
361
  })), { logo: brandLogoId, channel_services: channel_services });
337
- return [4, Promise.all([
338
- API.brandService.updateBrandInfo(requestBody),
339
- API.dataService.getTeamSize({ page: 0 })
340
- ])];
362
+ return [4, API.brandService.updateBrandInfo(requestBody)];
341
363
  case 1:
342
- _d = _h.sent(), brandData = _d[0].brand, teamSizeList = _d[1];
364
+ brandData = (_g.sent()).brand;
343
365
  return [4, thunkApi.dispatch(retrieveSegmentDataList()).unwrap()];
344
366
  case 2:
345
- _e = _h.sent(), segmentLocation = _e.segmentLocation, segmentProfit = _e.segmentProfit, segmentTech = _e.segmentTech;
367
+ _d = _g.sent(), segmentLocation = _d.segmentLocation, segmentProfit = _d.segmentProfit, segmentTech = _d.segmentTech;
368
+ return [4, API.dataService.getTeamSize({ page: 0 })];
369
+ case 3:
370
+ teamSizeList = _g.sent();
346
371
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
347
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, id);
372
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
348
373
  return [2, {
349
374
  data: __assign({}, brandData),
350
375
  formData: originalFormData,
@@ -360,14 +385,14 @@ export var updateBrand = createAsyncThunk('brandUpdateBrand', function (_a, thun
360
385
  export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', function (_a, thunkApi) {
361
386
  var formData = _a.formData, originalFormData = _a.originalFormData;
362
387
  return __awaiter(void 0, void 0, void 0, function () {
363
- var _b, settings, brand, _c, brandRes, entityInfoId, _d, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, entityData, brandData, entity, activityList;
364
- var _e, _f;
388
+ var _b, settings, brand, brandRes, _c, id, data_status, isSegmentLocationNonEditable, isSegmentProfitNonEditable, isSegmentTechNonEditable, isSegmentTeamsNonEditable, segmentLocation, segmentProfit, segmentTech, teamSize, segmentLocationId, segmentProfitId, segmentTechId, teamSizeId, hasSegment, requestBody, brandData, currencyData, activities, activityList;
389
+ var _d, _e, _f;
365
390
  return __generator(this, function (_g) {
366
391
  switch (_g.label) {
367
392
  case 0:
368
393
  _b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
369
- _c = brand.data.verify.responseBody || {}, brandRes = _c.brand, entityInfoId = _c.entityInfoId;
370
- _d = brandRes || {}, id = _d.id, data_status = _d.data_status;
394
+ brandRes = (brand.data.verify.responseBody || {}).brand;
395
+ _c = brandRes || {}, id = _c.id, data_status = _c.data_status;
371
396
  isSegmentLocationNonEditable = hasNoneEditableValue(data_status, 'segment.location_type');
372
397
  isSegmentProfitNonEditable = hasNoneEditableValue(data_status, 'segment.profit_type');
373
398
  isSegmentTechNonEditable = hasNoneEditableValue(data_status, 'segment.tech_type');
@@ -381,32 +406,29 @@ export var updateSegmentBrand = createAsyncThunk('brandUpdateBrandSegment', func
381
406
  requestBody = __assign({ id: id }, (hasSegment && {
382
407
  segment: { location_type: segmentLocationId, profit_type: segmentProfitId, tech_type: segmentTechId, team: teamSizeId }
383
408
  }));
384
- entityData = undefined;
385
409
  return [4, API.brandService.updateBrandInfo(requestBody)];
386
410
  case 1:
387
411
  brandData = (_g.sent()).brand;
388
- if (!entityInfoId) return [3, 3];
389
- return [4, API.entityService.retrieveEntity(entityInfoId)];
412
+ return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
390
413
  case 2:
391
- entity = (_g.sent()).entity;
392
- entityData = entity;
393
- _g.label = 3;
414
+ currencyData = _g.sent();
415
+ activities = (((_d = brand.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}).activities;
416
+ return [4, thunkApi.dispatch(retrieveDataList())];
394
417
  case 3:
395
- if (entityData === null || entityData === void 0 ? void 0 : entityData.activities) {
396
- entityData = __assign(__assign({}, entityData), { entity_activities: entityData.activities });
418
+ _g.sent();
419
+ if (activities) {
420
+ brandData = __assign(__assign({}, brandData), { entity_activities: activities || {} });
397
421
  }
398
- if (!!(entityData === null || entityData === void 0 ? void 0 : entityData.activities)) return [3, 5];
422
+ if (!!activities) return [3, 5];
399
423
  return [4, API.dataService.getActivities()];
400
424
  case 4:
401
425
  activityList = (_g.sent()).list;
402
- entityData = __assign(__assign({}, entityData), { entity_activities: activityList });
426
+ brandData = __assign(__assign({}, brandData), { entity_activities: activityList || {} });
403
427
  _g.label = 5;
404
- case 5: return [4, thunkApi.dispatch(retrieveDataList())];
405
- case 6:
406
- _g.sent();
428
+ case 5:
407
429
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
408
430
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
409
- return [2, { data: __assign({}, brandData), entityData: entityData, formData: originalFormData }];
431
+ return [2, { data: __assign({}, brandData), formData: originalFormData, currencyData: currencyData }];
410
432
  }
411
433
  });
412
434
  });
@@ -425,13 +447,13 @@ export var retrieveEntityList = createAsyncThunk('retrieveEntityList', function
425
447
  export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities', function (_a, thunkApi) {
426
448
  var formData = _a.formData, originalFormData = _a.originalFormData;
427
449
  return __awaiter(void 0, void 0, void 0, function () {
428
- var _b, settings, brand, _c, brandRes, recipient, _d, data_status, id, brandActivities, terms, isActivitiesNonEditable, isCustomerBaseLocationNonEditable, isCustomerBaseNonEditable, isTermsNonEditable, isSalesRangeNonEditable, activities, customerLocations, expectedCustomer, expectedSale, termAndConditionChecked, refundPolicy, transactionPolicy, isTermsUndefined, isAllTermsAgreed, isTermsAvailable, removedActivities, payload, requestBody, customerLocation, customerBaseId, salesId, customerBase, brandData;
429
- var _e, _f, _g;
430
- return __generator(this, function (_h) {
431
- switch (_h.label) {
450
+ var _b, settings, brand, _c, brandRes, notification, _d, data_status, id, brandActivities, terms, isActivitiesNonEditable, isCustomerBaseLocationNonEditable, isCustomerBaseNonEditable, isTermsNonEditable, isSalesRangeNonEditable, activities, customerLocations, expectedCustomer, expectedSale, termAndConditionChecked, refundPolicy, transactionPolicy, isTermsUndefined, isAllTermsAgreed, isTermsAvailable, removedActivities, payload, requestBody, customerLocation, customerBaseId, salesId, customerBase, brandData;
451
+ var _e, _f, _g, _h;
452
+ return __generator(this, function (_j) {
453
+ switch (_j.label) {
432
454
  case 0:
433
455
  _b = thunkApi.getState(), settings = _b.settings, brand = _b.brand;
434
- _c = brand.data.verify.responseBody || {}, brandRes = _c.brand, recipient = _c.recipient;
456
+ _c = brand.data.verify.responseBody || {}, brandRes = _c.brand, notification = _c.notification;
435
457
  _d = brandRes || {}, data_status = _d.data_status, id = _d.id, brandActivities = _d.activities, terms = _d.terms;
436
458
  isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
437
459
  isCustomerBaseLocationNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.operations, 'customer_base_location');
@@ -453,11 +475,11 @@ export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities'
453
475
  };
454
476
  return [4, API.brandService.removeBrandActivity(payload)];
455
477
  case 1:
456
- _h.sent();
457
- _h.label = 2;
478
+ _j.sent();
479
+ _j.label = 2;
458
480
  case 2:
459
481
  requestBody = __assign(__assign({ id: id, activities: isActivitiesNonEditable ? undefined : (activities || []).map(function (a) { return ({ id: a.id }); }) }, (isTermsAvailable && {
460
- term_by: recipient === null || recipient === void 0 ? void 0 : recipient.id,
482
+ term_by: (_f = notification === null || notification === void 0 ? void 0 : notification.recipient) === null || _f === void 0 ? void 0 : _f.id,
461
483
  term: ['general', 'refund', 'chargeback']
462
484
  })), { step_name: BRAND_STEP_NAMES.BRAND_ACTIVITIES });
463
485
  customerLocation = (customerLocations || []).map(function (location) { return ({
@@ -473,9 +495,9 @@ export var updateBrandActivities = createAsyncThunk('brandUpdateBrandActivities'
473
495
  }
474
496
  return [4, API.brandService.updateBrandInfo(requestBody)];
475
497
  case 3:
476
- brandData = (_h.sent()).data;
498
+ brandData = (_j.sent()).data;
477
499
  thunkApi.dispatch(handleNextScreenStep());
478
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, id);
500
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, id);
479
501
  return [2, { data: __assign({}, brandData), formData: originalFormData }];
480
502
  }
481
503
  });
@@ -512,39 +534,39 @@ export var retrieveDataList = createAsyncThunk('brandRetrieveDataList', function
512
534
  });
513
535
  }); });
514
536
  export var updateBoardSuccess = createAsyncThunk('updateBoardBrandSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
515
- var _a, settings, brand, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
516
- var _e, _f, _g, _h, _j, _k, _l, _m, _o;
517
- return __generator(this, function (_p) {
518
- switch (_p.label) {
537
+ var _a, settings, brand, _b, id, infoId, _c, showBoard, mode, payload, data, boardInfoData;
538
+ var _d, _e, _f, _g, _h, _j, _k, _l;
539
+ return __generator(this, function (_m) {
540
+ switch (_m.label) {
519
541
  case 0:
520
542
  _a = thunkApi.getState(), settings = _a.settings, brand = _a.brand;
521
- _b = brand.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
543
+ _b = brand.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
522
544
  _c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
523
- if (!board_id)
545
+ if (!id)
524
546
  return [2];
525
547
  payload = {
526
548
  lang: settings.data.language,
527
- step_name: BRAND_STEP_NAMES.BRAND_SUCCESS
549
+ step_name: BRAND_STEP_NAMES.BRAND_SUCCESS,
550
+ id: id
528
551
  };
529
- return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
552
+ return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
530
553
  case 1:
531
- data = _p.sent();
554
+ data = _m.sent();
532
555
  if (!showBoard && mode === 'content') {
533
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
534
- (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
535
- return [2, { data: data }];
556
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
557
+ (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
558
+ return [2, { response: __assign({}, data), formData: params }];
536
559
  }
537
- _d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, type = _d.type;
538
- return [4, Promise.all([
539
- API.boardService.retrieveBoardInfoStatus(board_id),
540
- thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
541
- ])];
560
+ return [4, API.boardService.retrieveBoardInfoStatus(id)];
542
561
  case 2:
543
- boardInfoStatusData = (_p.sent())[0];
544
- (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
545
- (_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
562
+ boardInfoData = _m.sent();
563
+ return [4, thunkApi.dispatch(retrieveBoardDetails(id)).unwrap()];
564
+ case 3:
565
+ _m.sent();
566
+ (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
567
+ (_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
546
568
  thunkApi.dispatch(handleNextScreenStep());
547
- return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
569
+ return [2, { response: __assign(__assign({}, data), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] }), formData: params }];
548
570
  }
549
571
  });
550
572
  }); });
@@ -570,6 +592,7 @@ var initialState = {
570
592
  uploadingBrandLogo: false,
571
593
  data: {
572
594
  flowName: FlowsTypes.BRAND,
595
+ currency: '',
573
596
  verify: {
574
597
  token: ''
575
598
  },
@@ -628,7 +651,8 @@ export var brandSlice = createSlice({
628
651
  var _a, _b;
629
652
  state.error = null;
630
653
  state.customLoading = false;
631
- var _c = action.payload, data = _c.data, brand = _c.brandData, token = _c.token, salesChannels = _c.salesChannels, entityInfoId = _c.entityInfoId;
654
+ var _c = action.payload, data = _c.data, token = _c.token, boardResponse = _c.boardResponse, salesChannels = _c.salesChannels, individualData = _c.individualData;
655
+ var brand = boardResponse.brand, entity = boardResponse.entity;
632
656
  state.data.brandData.brandName = (((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en) || '').trim();
633
657
  (_b = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _b === void 0 ? void 0 : _b.forEach(function (element) {
634
658
  if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
@@ -639,7 +663,7 @@ export var brandSlice = createSlice({
639
663
  });
640
664
  var mappedSalesChannels = mapSalesChannel((brand === null || brand === void 0 ? void 0 : brand.channel_services) || []);
641
665
  state.data.brandData.salesChannels = mappedSalesChannels;
642
- state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { brand: brand, board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: mappedSalesChannels, entityInfoId: entityInfoId });
666
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: mappedSalesChannels, activities: entity === null || entity === void 0 ? void 0 : entity.activities, individualData: individualData });
643
667
  state.data.verify.token = token;
644
668
  })
645
669
  .addCase(verifyLeadToken.rejected, function (state, action) {
@@ -665,7 +689,8 @@ export var brandSlice = createSlice({
665
689
  var _a, _b;
666
690
  state.loading = false;
667
691
  state.error = null;
668
- var _c = action.payload, data = _c.data, brand = _c.brandData, formData = _c.formData, salesChannels = _c.salesChannels, entityInfoId = _c.entityInfoId;
692
+ var _c = action.payload, data = _c.data, boardResponse = _c.boardResponse, formData = _c.formData, salesChannels = _c.salesChannels, individualData = _c.individualData;
693
+ var brand = boardResponse.brand, entity = boardResponse.entity;
669
694
  state.data.otpData = formData;
670
695
  state.data.otpData.responseBody = data;
671
696
  state.data.brandData.brandName = (((_a = brand === null || brand === void 0 ? void 0 : brand.name) === null || _a === void 0 ? void 0 : _a.en) || '').trim();
@@ -678,7 +703,7 @@ export var brandSlice = createSlice({
678
703
  state.data.brandActivities.refundPolicy = element.agree;
679
704
  }
680
705
  });
681
- state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { brand: brand, board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: mappedSalesChannels, entityInfoId: entityInfoId });
706
+ state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], activities: entity === null || entity === void 0 ? void 0 : entity.activities, salesChannels: mappedSalesChannels, individualData: individualData });
682
707
  })
683
708
  .addCase(verifyBrandLeadOTP.rejected, function (state, action) {
684
709
  state.loading = false;
@@ -738,18 +763,20 @@ export var brandSlice = createSlice({
738
763
  state.error = null;
739
764
  })
740
765
  .addCase(updateSegmentBrand.fulfilled, function (state, action) {
766
+ var _a;
741
767
  state.loading = false;
742
768
  state.error = null;
743
- var _a = action.payload, data = _a.data, entityData = _a.entityData, formData = _a.formData;
744
- var activities = data.activities, operations = data.operations, terms = data.terms;
745
- var entity_activities = (entityData || {}).entity_activities;
769
+ var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
770
+ var entity_activities = data.entity_activities, activities = data.activities, operations = data.operations, terms = data.terms;
746
771
  var selectedActivity = entity_activities === null || entity_activities === void 0 ? void 0 : entity_activities.filter(function (activity) {
747
772
  return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
748
773
  });
749
774
  state.data.brandSegmentData = formData;
775
+ if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
776
+ state.data.currency = currencyData.code.english;
750
777
  state.data.brandActivities.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
751
- var _b = operations || {}, customer_base = _b.customer_base, sales = _b.sales;
752
- var _c = customer_base || {}, locations = _c.locations, customerBase = __rest(_c, ["locations"]);
778
+ var _c = operations || {}, customer_base = _c.customer_base, sales = _c.sales;
779
+ var _d = customer_base || {}, locations = _d.locations, customerBase = __rest(_d, ["locations"]);
753
780
  if (locations && locations.length)
754
781
  state.data.brandActivities.customerLocations = locations;
755
782
  if (!!sales)
@@ -763,7 +790,7 @@ export var brandSlice = createSlice({
763
790
  state.data.brandActivities.refundPolicy = element.agree;
764
791
  }
765
792
  });
766
- state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { activities: entity_activities }), (entityData && { entity: entityData }));
793
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { activities: entity_activities });
767
794
  })
768
795
  .addCase(updateSegmentBrand.rejected, function (state, action) {
769
796
  state.loading = false;
@@ -817,7 +844,7 @@ export var brandSlice = createSlice({
817
844
  .addCase(retrieveBoardDetails.fulfilled, function (state, action) {
818
845
  state.error = null;
819
846
  state.loading = false;
820
- var data = action.payload || {};
847
+ var data = (action.payload || {}).data;
821
848
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
822
849
  })
823
850
  .addCase(retrieveBoardDetails.rejected, function (state, action) {
@@ -831,7 +858,7 @@ export var brandSlice = createSlice({
831
858
  .addCase(retrieveBoardStatus.fulfilled, function (state, action) {
832
859
  state.error = null;
833
860
  state.loading = false;
834
- var flows = (action.payload || {}).flows;
861
+ var flows = action.payload.flows;
835
862
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
836
863
  })
837
864
  .addCase(retrieveBoardStatus.rejected, function (state, action) {
@@ -842,8 +869,12 @@ export var brandSlice = createSlice({
842
869
  var _a;
843
870
  state.loading = false;
844
871
  state.error = null;
845
- var _b = action.payload || {}, flows = _b.flows, data = _b.data;
846
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
872
+ var flows = (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.response) || {}).flows;
873
+ var _b = state.data.verify.responseBody || {}, individuals = _b.individuals, individualData = _b.individualData;
874
+ var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
875
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
876
+ individuals: __assign(__assign({}, individuals), { data_state: data_state })
877
+ }));
847
878
  })
848
879
  .addCase(updateBoardSuccess.pending, function (state) {
849
880
  state.loading = true;