@zeniai/client-epic-state 4.10.47 → 4.10.48
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.
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.js +5 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/epic.d.ts +6 -6
- package/lib/epic.js +6 -6
- package/lib/index.d.ts +3 -6
- package/lib/index.js +15 -18
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/onboardingView/customerView/epic/plaidConnection/getOnboardingPlaidLinkTokenEpic.js +1 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +1 -2
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/fetchBankConnectionsViewEpic.js +2 -2
- package/lib/view/settingsView/settingsViewSelector.js +3 -3
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +2 -3
- package/lib/view/spendManagement/billPay/billPaySetupView/billPaySetupViewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.d.ts +2 -3
- package/lib/view/spendManagement/billPay/billPaySetupView/epic/billPaySetup/fetchBillPaySetupViewEpic.js +4 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +5 -5
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/internationalWire/epics/initializeInternationalWireLocalDataEpic.js +2 -2
- package/lib/view/spendManagement/billPay/internationalWire/internationalWireSelector.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.d.ts +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/fetchChargeCardSetupViewEpic.js +4 -5
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/getPaymentAccountsEpic.d.ts +1 -1
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/getPaymentAccountsEpic.js +6 -6
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountEpic.d.ts +1 -1
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountEpic.js +6 -6
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.d.ts +1 -1
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +7 -7
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountStatusEpic.d.ts +1 -1
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +7 -7
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -2
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/establishPlaidConnectionEpic.js +7 -7
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/getPlaidLinkTokenEpic.d.ts +2 -2
- package/lib/view/spendManagement/{plaidAccount → commonSetup}/epic/plaidConnection/getPlaidLinkTokenEpic.js +6 -6
- package/lib/view/spendManagement/commonSetup/setupViewPayload.d.ts +1 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +59 -3
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +334 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -3
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -12
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +14 -0
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.d.ts +2 -3
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/fetchRemiSetupViewEpic.js +4 -5
- package/lib/view/spendManagement/reimbursement/remiSetupView/epic/remiSetup/updateMileageDetailsEpic.d.ts +2 -3
- package/lib/view/spendManagement/reimbursement/remiSetupView/remiSetupViewSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListPayload.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +2 -2
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.d.ts +2 -3
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js +4 -5
- package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js +1 -1
- package/package.json +1 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +0 -85
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +0 -332
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.d.ts +0 -2
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewSelector.js +0 -7
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +0 -21
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.js +0 -29
- /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/paymentAccount.d.ts +0 -0
- /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/paymentAccount.js +0 -0
- /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/plaidConnection.d.ts +0 -0
- /package/lib/view/spendManagement/{plaidAccount → commonSetup}/types/plaidConnection.js +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
4
|
+
exports.clearSetupView = exports.clearSetupViewDataInLocalStore = exports.saveIndustryAndIncDateInLocalStore = exports.verifyOtpFailureSpendManagementSetUp = exports.verifyOtpSuccessSpendManagementSetUp = exports.verifyOtpSpendManagementSetUp = exports.sendOtpFailureSpendManagementSetUp = exports.sendOtpSuccessSpendManagementSetUp = exports.resendOtpSpendManagementSetUp = exports.sendOtpSpendManagementSetUp = exports.updateSetupViewAccountDetails = exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = exports.saveCompnayOfficerPhoneInLocalStore = exports.saveSetupViewDataInLocalStore = exports.updateSetupViewLocalStoreData = exports.updateSelectedCompanyOfficer = exports.establishPlaidConnectionFailure = exports.establishPlaidConnectionSuccess = exports.establishPlaidConnection = exports.getPlaidLinkTokenFailure = exports.getPlaidLinkTokenSuccess = exports.getPlaidLinkToken = exports.updatePaymentAccountLoginStatusFailure = exports.updatePaymentAccountLoginStatusSuccess = exports.updatePaymentAccountLoginStatus = exports.updatePaymentAccountStatusFailure = exports.updatePaymentAccountStatusSuccess = exports.updatePaymentAccountStatus = exports.updatePaymentAccountFailure = exports.updatePaymentAccountSuccess = exports.updatePaymentAccount = exports.getPaymentAccountsFailure = exports.getPaymentAccountsSuccess = exports.getPaymentAccounts = exports.updateBusinessVerificationDetailsFailure = exports.updateBusinessVerificationDetailsSuccess = exports.updateBusinessVerificationDetails = exports.enableSetupFailure = exports.enableSetupSuccess = exports.enableSetup = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
const initialFetchStatus = {
|
|
7
8
|
fetchState: 'Not-Started',
|
|
8
9
|
error: undefined,
|
|
@@ -63,6 +64,30 @@ exports.initialState = {
|
|
|
63
64
|
},
|
|
64
65
|
},
|
|
65
66
|
primaryContactDetails: {},
|
|
67
|
+
accountDetails: {
|
|
68
|
+
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
69
|
+
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
70
|
+
paymentAccountIds: [],
|
|
71
|
+
allBankAccountIds: [],
|
|
72
|
+
},
|
|
73
|
+
plaidConnectionDetails: {
|
|
74
|
+
link_account: {
|
|
75
|
+
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
76
|
+
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
77
|
+
},
|
|
78
|
+
update_account: {
|
|
79
|
+
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
80
|
+
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
81
|
+
},
|
|
82
|
+
link_account_no_microdeposit: {
|
|
83
|
+
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
84
|
+
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
85
|
+
},
|
|
86
|
+
link_external_account: {
|
|
87
|
+
fetchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
88
|
+
updateStatus: { fetchState: 'Not-Started', error: undefined },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
66
91
|
};
|
|
67
92
|
const setupView = (0, toolkit_1.createSlice)({
|
|
68
93
|
name: 'setupView',
|
|
@@ -119,6 +144,299 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
119
144
|
};
|
|
120
145
|
},
|
|
121
146
|
},
|
|
147
|
+
getPaymentAccounts: {
|
|
148
|
+
reducer(draft) {
|
|
149
|
+
draft.accountDetails.fetchStatus = {
|
|
150
|
+
fetchState: 'In-Progress',
|
|
151
|
+
error: undefined,
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
prepare(setupViewType, includeBalances = true) {
|
|
155
|
+
return { payload: { setupViewType, includeBalances } };
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
getPaymentAccountsSuccess: {
|
|
159
|
+
reducer(draft, action) {
|
|
160
|
+
const { paymentAccountIds } = action.payload;
|
|
161
|
+
draft.accountDetails.fetchStatus = {
|
|
162
|
+
fetchState: 'Completed',
|
|
163
|
+
error: undefined,
|
|
164
|
+
};
|
|
165
|
+
draft.accountDetails.paymentAccountIds = paymentAccountIds;
|
|
166
|
+
},
|
|
167
|
+
prepare(paymentAccountIds) {
|
|
168
|
+
return {
|
|
169
|
+
payload: { paymentAccountIds },
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
getPaymentAccountsFailure: {
|
|
174
|
+
reducer(draft, action) {
|
|
175
|
+
draft.accountDetails.fetchStatus = {
|
|
176
|
+
fetchState: 'Error',
|
|
177
|
+
error: action.payload,
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
prepare(error) {
|
|
181
|
+
return {
|
|
182
|
+
payload: error,
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
updatePaymentAccount: {
|
|
187
|
+
reducer(draft) {
|
|
188
|
+
draft.accountDetails.updateStatus = {
|
|
189
|
+
fetchState: 'In-Progress',
|
|
190
|
+
error: undefined,
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
prepare(accountId, paymentAccountId, setupViewType) {
|
|
194
|
+
return { payload: { accountId, paymentAccountId, setupViewType } };
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
updatePaymentAccountSuccess: {
|
|
198
|
+
reducer(draft, action) {
|
|
199
|
+
const { paymentAccountIds } = action.payload;
|
|
200
|
+
draft.accountDetails.updateStatus = {
|
|
201
|
+
fetchState: 'Completed',
|
|
202
|
+
error: undefined,
|
|
203
|
+
};
|
|
204
|
+
draft.accountDetails.paymentAccountIds = paymentAccountIds;
|
|
205
|
+
},
|
|
206
|
+
prepare(paymentAccountIds) {
|
|
207
|
+
return {
|
|
208
|
+
payload: { paymentAccountIds },
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
updatePaymentAccountFailure: {
|
|
213
|
+
reducer(draft, action) {
|
|
214
|
+
draft.accountDetails.updateStatus = {
|
|
215
|
+
fetchState: 'Error',
|
|
216
|
+
error: action.payload,
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
prepare(error) {
|
|
220
|
+
return {
|
|
221
|
+
payload: error,
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
updatePaymentAccountStatus: {
|
|
226
|
+
reducer(draft, action) {
|
|
227
|
+
const { linkTokenType } = action.payload;
|
|
228
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
229
|
+
updateStatus: {
|
|
230
|
+
fetchState: 'In-Progress',
|
|
231
|
+
error: undefined,
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
prepare(verificationStatusCode, paymentAccountId, setupViewType, linkTokenType) {
|
|
236
|
+
return {
|
|
237
|
+
payload: {
|
|
238
|
+
verificationStatusCode,
|
|
239
|
+
paymentAccountId,
|
|
240
|
+
setupViewType,
|
|
241
|
+
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
updatePaymentAccountStatusSuccess: {
|
|
247
|
+
reducer(draft, action) {
|
|
248
|
+
const { paymentAccountIds, linkTokenType } = action.payload;
|
|
249
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
250
|
+
updateStatus: {
|
|
251
|
+
fetchState: 'Completed',
|
|
252
|
+
error: undefined,
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
draft.accountDetails.paymentAccountIds = paymentAccountIds;
|
|
256
|
+
},
|
|
257
|
+
prepare(paymentAccountIds, linkTokenType) {
|
|
258
|
+
return {
|
|
259
|
+
payload: { paymentAccountIds, linkTokenType },
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
updatePaymentAccountStatusFailure: {
|
|
264
|
+
reducer(draft, action) {
|
|
265
|
+
const { error, linkTokenType } = action.payload;
|
|
266
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
267
|
+
updateStatus: {
|
|
268
|
+
fetchState: 'Error',
|
|
269
|
+
error,
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
},
|
|
273
|
+
prepare(error, linkTokenType) {
|
|
274
|
+
return {
|
|
275
|
+
payload: { error, linkTokenType },
|
|
276
|
+
};
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
updatePaymentAccountLoginStatus: {
|
|
280
|
+
reducer(draft, action) {
|
|
281
|
+
const { linkTokenType } = action.payload;
|
|
282
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
283
|
+
updateStatus: {
|
|
284
|
+
fetchState: 'In-Progress',
|
|
285
|
+
error: undefined,
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
prepare(isLoginRequired, paymentAccountId, setupViewType, linkTokenType) {
|
|
290
|
+
return {
|
|
291
|
+
payload: {
|
|
292
|
+
isLoginRequired,
|
|
293
|
+
paymentAccountId,
|
|
294
|
+
setupViewType,
|
|
295
|
+
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
updatePaymentAccountLoginStatusSuccess: {
|
|
301
|
+
reducer(draft, action) {
|
|
302
|
+
const { paymentAccountIds, linkTokenType } = action.payload;
|
|
303
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
304
|
+
updateStatus: {
|
|
305
|
+
fetchState: 'Completed',
|
|
306
|
+
error: undefined,
|
|
307
|
+
},
|
|
308
|
+
});
|
|
309
|
+
draft.accountDetails.paymentAccountIds = paymentAccountIds;
|
|
310
|
+
},
|
|
311
|
+
prepare(paymentAccountIds, linkTokenType) {
|
|
312
|
+
return {
|
|
313
|
+
payload: { paymentAccountIds, linkTokenType },
|
|
314
|
+
};
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
updatePaymentAccountLoginStatusFailure: {
|
|
318
|
+
reducer(draft, action) {
|
|
319
|
+
const { error, linkTokenType } = action.payload;
|
|
320
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
321
|
+
updateStatus: {
|
|
322
|
+
fetchState: 'Error',
|
|
323
|
+
error,
|
|
324
|
+
},
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
prepare(error, linkTokenType) {
|
|
328
|
+
return {
|
|
329
|
+
payload: { error, linkTokenType },
|
|
330
|
+
};
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
getPlaidLinkToken: {
|
|
334
|
+
reducer(draft, action) {
|
|
335
|
+
const { linkTokenType, paymentAccountId } = action.payload;
|
|
336
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
337
|
+
fetchStatus: {
|
|
338
|
+
fetchState: 'In-Progress',
|
|
339
|
+
error: undefined,
|
|
340
|
+
},
|
|
341
|
+
});
|
|
342
|
+
if (paymentAccountId != null) {
|
|
343
|
+
draft.accountDetails.paymentAccountIds = [paymentAccountId];
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
prepare(linkTokenType, paymentAccountId) {
|
|
347
|
+
return {
|
|
348
|
+
payload: {
|
|
349
|
+
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
350
|
+
paymentAccountId: paymentAccountId,
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
getPlaidLinkTokenSuccess: {
|
|
356
|
+
prepare(linkToken, expiration, linkTokenType) {
|
|
357
|
+
return { payload: { linkToken, expiration, linkTokenType } };
|
|
358
|
+
},
|
|
359
|
+
reducer(draft, action) {
|
|
360
|
+
const { linkToken, expiration, linkTokenType } = action.payload;
|
|
361
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
362
|
+
fetchStatus: {
|
|
363
|
+
fetchState: 'Completed',
|
|
364
|
+
error: undefined,
|
|
365
|
+
},
|
|
366
|
+
linkToken,
|
|
367
|
+
expiration: (0, zeniDayJS_1.date)(expiration),
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
getPlaidLinkTokenFailure: {
|
|
372
|
+
reducer(draft, action) {
|
|
373
|
+
const { error, linkTokenType } = action.payload;
|
|
374
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
375
|
+
fetchStatus: {
|
|
376
|
+
fetchState: 'Error',
|
|
377
|
+
error,
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
prepare(error, linkTokenType) {
|
|
382
|
+
return {
|
|
383
|
+
payload: { error, linkTokenType },
|
|
384
|
+
};
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
establishPlaidConnection: {
|
|
388
|
+
reducer(draft, action) {
|
|
389
|
+
const { linkTokenType } = action.payload;
|
|
390
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
391
|
+
updateStatus: {
|
|
392
|
+
fetchState: 'In-Progress',
|
|
393
|
+
error: undefined,
|
|
394
|
+
},
|
|
395
|
+
});
|
|
396
|
+
},
|
|
397
|
+
prepare(publicToken, setupViewType, linkTokenType) {
|
|
398
|
+
return {
|
|
399
|
+
payload: {
|
|
400
|
+
publicToken,
|
|
401
|
+
setupViewType,
|
|
402
|
+
linkTokenType: linkTokenType !== null && linkTokenType !== void 0 ? linkTokenType : 'link_account',
|
|
403
|
+
},
|
|
404
|
+
};
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
establishPlaidConnectionSuccess: {
|
|
408
|
+
reducer(draft, action) {
|
|
409
|
+
const { paymentAccountIds, linkTokenType } = action.payload;
|
|
410
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
411
|
+
updateStatus: {
|
|
412
|
+
fetchState: 'Completed',
|
|
413
|
+
error: undefined,
|
|
414
|
+
},
|
|
415
|
+
});
|
|
416
|
+
draft.accountDetails.paymentAccountIds = paymentAccountIds;
|
|
417
|
+
},
|
|
418
|
+
prepare(paymentAccountIds, linkTokenType) {
|
|
419
|
+
return {
|
|
420
|
+
payload: { paymentAccountIds, linkTokenType },
|
|
421
|
+
};
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
establishPlaidConnectionFailure: {
|
|
425
|
+
reducer(draft, action) {
|
|
426
|
+
const { linkTokenType, error } = action.payload;
|
|
427
|
+
draft.plaidConnectionDetails[linkTokenType] = Object.assign({}, draft.plaidConnectionDetails[linkTokenType], {
|
|
428
|
+
updateStatus: {
|
|
429
|
+
fetchState: 'Error',
|
|
430
|
+
error,
|
|
431
|
+
},
|
|
432
|
+
});
|
|
433
|
+
},
|
|
434
|
+
prepare(error, linkTokenType) {
|
|
435
|
+
return {
|
|
436
|
+
payload: { error, linkTokenType },
|
|
437
|
+
};
|
|
438
|
+
},
|
|
439
|
+
},
|
|
122
440
|
updateSelectedCompanyOfficer: {
|
|
123
441
|
reducer(draft, action) {
|
|
124
442
|
const { selectedOfficerType } = action.payload;
|
|
@@ -173,6 +491,20 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
173
491
|
phone: action.payload.phone,
|
|
174
492
|
});
|
|
175
493
|
},
|
|
494
|
+
updateSetupViewAccountDetails: {
|
|
495
|
+
prepare(allBankAccountIds, paymentAccountIds) {
|
|
496
|
+
return { payload: { allBankAccountIds, paymentAccountIds } };
|
|
497
|
+
},
|
|
498
|
+
reducer(draft, action) {
|
|
499
|
+
const { allBankAccountIds, paymentAccountIds } = action.payload;
|
|
500
|
+
draft.accountDetails.allBankAccountIds = allBankAccountIds;
|
|
501
|
+
draft.accountDetails.paymentAccountIds = paymentAccountIds;
|
|
502
|
+
draft.accountDetails.fetchStatus = {
|
|
503
|
+
fetchState: 'Completed',
|
|
504
|
+
error: undefined,
|
|
505
|
+
};
|
|
506
|
+
},
|
|
507
|
+
},
|
|
176
508
|
sendOtp(draft) {
|
|
177
509
|
Object.keys(draft.companyOfficerUpdateStatus).forEach((officerType) => {
|
|
178
510
|
var _a;
|
|
@@ -287,5 +619,5 @@ const setupView = (0, toolkit_1.createSlice)({
|
|
|
287
619
|
},
|
|
288
620
|
},
|
|
289
621
|
});
|
|
290
|
-
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
|
|
622
|
+
_a = setupView.actions, exports.enableSetup = _a.enableSetup, exports.enableSetupSuccess = _a.enableSetupSuccess, exports.enableSetupFailure = _a.enableSetupFailure, exports.updateBusinessVerificationDetails = _a.updateBusinessVerificationDetails, exports.updateBusinessVerificationDetailsSuccess = _a.updateBusinessVerificationDetailsSuccess, exports.updateBusinessVerificationDetailsFailure = _a.updateBusinessVerificationDetailsFailure, exports.getPaymentAccounts = _a.getPaymentAccounts, exports.getPaymentAccountsSuccess = _a.getPaymentAccountsSuccess, exports.getPaymentAccountsFailure = _a.getPaymentAccountsFailure, exports.updatePaymentAccount = _a.updatePaymentAccount, exports.updatePaymentAccountSuccess = _a.updatePaymentAccountSuccess, exports.updatePaymentAccountFailure = _a.updatePaymentAccountFailure, exports.updatePaymentAccountStatus = _a.updatePaymentAccountStatus, exports.updatePaymentAccountStatusSuccess = _a.updatePaymentAccountStatusSuccess, exports.updatePaymentAccountStatusFailure = _a.updatePaymentAccountStatusFailure, exports.updatePaymentAccountLoginStatus = _a.updatePaymentAccountLoginStatus, exports.updatePaymentAccountLoginStatusSuccess = _a.updatePaymentAccountLoginStatusSuccess, exports.updatePaymentAccountLoginStatusFailure = _a.updatePaymentAccountLoginStatusFailure, exports.getPlaidLinkToken = _a.getPlaidLinkToken, exports.getPlaidLinkTokenSuccess = _a.getPlaidLinkTokenSuccess, exports.getPlaidLinkTokenFailure = _a.getPlaidLinkTokenFailure, exports.establishPlaidConnection = _a.establishPlaidConnection, exports.establishPlaidConnectionSuccess = _a.establishPlaidConnectionSuccess, exports.establishPlaidConnectionFailure = _a.establishPlaidConnectionFailure, exports.updateSelectedCompanyOfficer = _a.updateSelectedCompanyOfficer, exports.updateSetupViewLocalStoreData = _a.updateSetupViewLocalStoreData, exports.saveSetupViewDataInLocalStore = _a.saveSetupViewDataInLocalStore, exports.saveCompnayOfficerPhoneInLocalStore = _a.saveCompnayOfficerPhoneInLocalStore, exports.saveCompnayOfficerAdditionalDocumentsInLocalStore = _a.saveCompnayOfficerAdditionalDocumentsInLocalStore, exports.updateSetupViewAccountDetails = _a.updateSetupViewAccountDetails, exports.sendOtpSpendManagementSetUp = _a.sendOtp, exports.resendOtpSpendManagementSetUp = _a.resendOtp, exports.sendOtpSuccessSpendManagementSetUp = _a.sendOtpSuccess, exports.sendOtpFailureSpendManagementSetUp = _a.sendOtpFailure, exports.verifyOtpSpendManagementSetUp = _a.verifyOtp, exports.verifyOtpSuccessSpendManagementSetUp = _a.verifyOtpSuccess, exports.verifyOtpFailureSpendManagementSetUp = _a.verifyOtpFailure, exports.saveIndustryAndIncDateInLocalStore = _a.saveIndustryAndIncDateInLocalStore, exports.clearSetupViewDataInLocalStore = _a.clearSetupViewDataInLocalStore, exports.clearSetupView = _a.clearSetupView;
|
|
291
623
|
exports.default = setupView.reducer;
|
|
@@ -9,8 +9,7 @@ import { AccountBase } from '../../../entity/account/accountState';
|
|
|
9
9
|
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
10
10
|
import { CompanyView } from '../../companyView/types/companyView';
|
|
11
11
|
import { NewAddressData } from '../../addressView/addressViewState';
|
|
12
|
-
import { CompanyAndIdentityDetails, CompanyOfficerLocalData, PrimaryContactLocalData, SetupViewType } from './setupViewState';
|
|
13
|
-
import { PlaidAccountKeyType, PlaidConnectionDetails } from '../plaidAccount/plaidAccountViewState';
|
|
12
|
+
import { CompanyAndIdentityDetails, CompanyOfficerLocalData, PlaidConnectionDetails, PrimaryContactLocalData, SetupViewType } from './setupViewState';
|
|
14
13
|
export interface SetupView {
|
|
15
14
|
companyBillPayInfo?: CompanyBillPayInfo;
|
|
16
15
|
paymentAccount?: PaymentAccount;
|
|
@@ -54,6 +53,6 @@ export interface BusinessVerificationDetails extends CompanyAndOfficerLocalData
|
|
|
54
53
|
companyView?: CompanyView;
|
|
55
54
|
updateStatus: FetchStateAndError;
|
|
56
55
|
}
|
|
57
|
-
export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType
|
|
56
|
+
export declare function getCommonSetupViewDetails(state: RootState, companyId: ID, setupViewType: SetupViewType): SetupView;
|
|
58
57
|
export declare function getBusinessVerificationDetails(state: RootState, companyId: ID): BusinessVerificationDetails;
|
|
59
58
|
export declare const getCompanyAndIdentityDetails: (state: RootState, companyId: ID, companyAndIdentityDetails: CompanyAndIdentityDetails) => CompanyAndOfficerLocalData;
|
|
@@ -3,24 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getCompanyAndIdentityDetails = exports.getBusinessVerificationDetails = exports.getCommonSetupViewDetails = void 0;
|
|
4
4
|
const accountSelector_1 = require("../../../entity/account/accountSelector");
|
|
5
5
|
const fileSelector_1 = require("../../../entity/file/fileSelector");
|
|
6
|
+
const paymentAccountSelector_1 = require("../../../entity/paymentAccount/paymentAccountSelector");
|
|
6
7
|
const fileViewSelector_1 = require("../../fileView/fileViewSelector");
|
|
7
8
|
const getCompanyView_1 = require("../../companyView/selectorHelpers/getCompanyView");
|
|
8
|
-
|
|
9
|
-
const paymentAccountSelector_1 = require("../../../entity/paymentAccount/paymentAccountSelector");
|
|
10
|
-
function getCommonSetupViewDetails(state, companyId, setupViewType, plaidAccountKeyType) {
|
|
9
|
+
function getCommonSetupViewDetails(state, companyId, setupViewType) {
|
|
11
10
|
var _a;
|
|
12
|
-
const { accountState, setupViewState, paymentAccountState
|
|
13
|
-
const { updateStatus } = setupViewState;
|
|
14
|
-
const {
|
|
15
|
-
const { allBankAccountIds, paymentAccountIds } = accountDetails;
|
|
11
|
+
const { accountState, setupViewState, paymentAccountState } = state;
|
|
12
|
+
const { accountDetails, plaidConnectionDetails, updateStatus } = setupViewState;
|
|
13
|
+
const { allBankAccountIds } = accountDetails;
|
|
16
14
|
const allBankAccounts = (_a = allBankAccountIds === null || allBankAccountIds === void 0 ? void 0 : allBankAccountIds.map((accountId) => (0, accountSelector_1.getAccountBase)(accountState, accountId, setupViewType)).filter((account) => account != null)) !== null && _a !== void 0 ? _a : [];
|
|
17
15
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
18
16
|
const companyBillPayInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo;
|
|
19
|
-
|
|
20
|
-
if ((paymentAccountIds === null || paymentAccountIds === void 0 ? void 0 : paymentAccountIds.length) > 0) {
|
|
21
|
-
const paymentAccountId = paymentAccountIds[0];
|
|
22
|
-
paymentAccount = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, paymentAccountId);
|
|
23
|
-
}
|
|
17
|
+
const paymentAccount = (0, paymentAccountSelector_1.getSpendManagementPrimaryPaymentAccount)(paymentAccountState);
|
|
24
18
|
return {
|
|
25
19
|
companyBillPayInfo,
|
|
26
20
|
paymentAccount,
|
|
@@ -61,6 +61,13 @@ export interface SetupViewLocalData {
|
|
|
61
61
|
/**
|
|
62
62
|
* Setup View State
|
|
63
63
|
*/
|
|
64
|
+
export declare type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
65
|
+
export declare type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
66
|
+
linkToken?: string;
|
|
67
|
+
expiration?: ZeniDate;
|
|
68
|
+
fetchStatus: FetchStateAndError;
|
|
69
|
+
updateStatus: FetchStateAndError;
|
|
70
|
+
}>;
|
|
64
71
|
export interface CompanyAndIdentityDetails {
|
|
65
72
|
companyDetails: {
|
|
66
73
|
localData?: CompanyDetailsLocalData;
|
|
@@ -76,4 +83,11 @@ export interface CompanyAndIdentityDetails {
|
|
|
76
83
|
}
|
|
77
84
|
export interface SetupViewState extends CompanyAndIdentityDetails {
|
|
78
85
|
updateStatus: FetchStateAndError;
|
|
86
|
+
accountDetails: {
|
|
87
|
+
fetchStatus: FetchStateAndError;
|
|
88
|
+
updateStatus: FetchStateAndError;
|
|
89
|
+
paymentAccountIds: ID[];
|
|
90
|
+
allBankAccountIds: ID[];
|
|
91
|
+
};
|
|
92
|
+
plaidConnectionDetails: PlaidConnectionDetails;
|
|
79
93
|
}
|
|
@@ -10,8 +10,7 @@ import { updateAddresses } from '../../../../../../entity/address/addressReducer
|
|
|
10
10
|
import { updateAccounts } from '../../../../../../entity/account/accountReducer';
|
|
11
11
|
import { updatePaymentAccounts } from '../../../../../../entity/paymentAccount/paymentAccountReducer';
|
|
12
12
|
import { openSnackbar } from '../../../../../../entity/snackbar/snackbarReducer';
|
|
13
|
-
import { updateSetupViewLocalStoreData } from '../../../../commonSetup/setupViewReducer';
|
|
13
|
+
import { updateSetupViewAccountDetails, updateSetupViewLocalStoreData } from '../../../../commonSetup/setupViewReducer';
|
|
14
14
|
import { fetchRemiSetupView, fetchRemiSetupViewSuccess, fetchRemiSetupViewFailure, updateRemiSetupViewLocalStoreData } from '../../remiSetupViewReducer';
|
|
15
|
-
|
|
16
|
-
export declare type ActionType = ReturnType<typeof fetchRemiSetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof updateRemiSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchRemiSetupViewSuccess> | ReturnType<typeof fetchRemiSetupViewFailure>;
|
|
15
|
+
export declare type ActionType = ReturnType<typeof fetchRemiSetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateSetupViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof updateRemiSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchRemiSetupViewSuccess> | ReturnType<typeof fetchRemiSetupViewFailure>;
|
|
17
16
|
export declare const fetchRemiSetupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -15,11 +15,10 @@ const companySelector_1 = require("../../../../../../entity/company/companySelec
|
|
|
15
15
|
const snackbarReducer_1 = require("../../../../../../entity/snackbar/snackbarReducer");
|
|
16
16
|
const setupViewReducer_1 = require("../../../../commonSetup/setupViewReducer");
|
|
17
17
|
const remiSetupViewReducer_1 = require("../../remiSetupViewReducer");
|
|
18
|
-
const plaidAccountViewReducer_1 = require("../../../../plaidAccount/plaidAccountViewReducer");
|
|
19
18
|
const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupViewReducer_1.fetchRemiSetupView.match), (0, operators_1.switchMap)((action) => {
|
|
20
19
|
var _a;
|
|
21
20
|
const { companyId, cacheOverride, refreshViewInBackground } = action.payload;
|
|
22
|
-
const { remiSetupViewState,
|
|
21
|
+
const { remiSetupViewState, setupViewState, companyState } = state$.value;
|
|
23
22
|
const company = (_a = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId)) === null || _a === void 0 ? void 0 : _a.company;
|
|
24
23
|
if (cacheOverride === true ||
|
|
25
24
|
refreshViewInBackground === true ||
|
|
@@ -49,7 +48,7 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
49
48
|
(0, remiSetupViewReducer_1.updateRemiSetupViewLocalStoreData)({
|
|
50
49
|
companyId: response.data.companies[0].company_id,
|
|
51
50
|
}),
|
|
52
|
-
(0,
|
|
51
|
+
(0, setupViewReducer_1.updateSetupViewAccountDetails)(allBankAccountIds, paymentAccountIds),
|
|
53
52
|
(0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)(),
|
|
54
53
|
];
|
|
55
54
|
return (0, rxjs_1.from)(actions);
|
|
@@ -64,10 +63,10 @@ const fetchRemiSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
64
63
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, remiSetupViewReducer_1.fetchRemiSetupViewFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Remi Setup view errored out' + JSON.stringify(error))))));
|
|
65
64
|
}
|
|
66
65
|
else {
|
|
67
|
-
const { allBankAccountIds, paymentAccountIds } =
|
|
66
|
+
const { allBankAccountIds, paymentAccountIds } = setupViewState.accountDetails;
|
|
68
67
|
return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
69
68
|
companyId,
|
|
70
|
-
}), (0,
|
|
69
|
+
}), (0, setupViewReducer_1.updateSetupViewAccountDetails)(allBankAccountIds, paymentAccountIds), (0, remiSetupViewReducer_1.fetchRemiSetupViewSuccess)());
|
|
71
70
|
}
|
|
72
71
|
}));
|
|
73
72
|
exports.fetchRemiSetupViewEpic = fetchRemiSetupViewEpic;
|
|
@@ -9,9 +9,8 @@ import { updateFiles } from '../../../../../../entity/file/fileReducer';
|
|
|
9
9
|
import { updateAddresses } from '../../../../../../entity/address/addressReducer';
|
|
10
10
|
import { updateAccounts } from '../../../../../../entity/account/accountReducer';
|
|
11
11
|
import { updatePaymentAccounts } from '../../../../../../entity/paymentAccount/paymentAccountReducer';
|
|
12
|
-
import { updateSetupViewLocalStoreData } from '../../../../commonSetup/setupViewReducer';
|
|
12
|
+
import { updateSetupViewAccountDetails, updateSetupViewLocalStoreData } from '../../../../commonSetup/setupViewReducer';
|
|
13
13
|
import { updateMileageDetails, updateMileageDetailsSuccess, updateMileageDetailsFailure, updateRemiSetupViewLocalStoreData } from '../../remiSetupViewReducer';
|
|
14
14
|
import { openSnackbar } from '../../../../../../entity/snackbar/snackbarReducer';
|
|
15
|
-
|
|
16
|
-
export declare type ActionType = ReturnType<typeof updateMileageDetails> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof updateRemiSetupViewLocalStoreData> | ReturnType<typeof updateMileageDetailsSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateMileageDetailsFailure>;
|
|
15
|
+
export declare type ActionType = ReturnType<typeof updateMileageDetails> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateSetupViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof updateRemiSetupViewLocalStoreData> | ReturnType<typeof updateMileageDetailsSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateMileageDetailsFailure>;
|
|
17
16
|
export declare const updateMileageDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,7 +5,7 @@ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
|
5
5
|
const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompanyView");
|
|
6
6
|
const helpers_1 = require("../../helpers");
|
|
7
7
|
function getRemiSetupViewDetails(state, companyId) {
|
|
8
|
-
const remiSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'reimbursement'
|
|
8
|
+
const remiSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'reimbursement');
|
|
9
9
|
const { remiSetupViewState, setupViewState } = state;
|
|
10
10
|
const { mileageDetails, isRefreshingViewInBackground } = remiSetupViewState;
|
|
11
11
|
const { remiTermsDetails } = remiSetupViewState;
|
package/lib/view/spendManagement/zeniAccounts/paymentAccountList/paymentAccountListPayload.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
2
|
-
import { PaymentAccountsPayload } from '../../
|
|
2
|
+
import { PaymentAccountsPayload } from '../../commonSetup/types/paymentAccount';
|
|
3
3
|
export declare type FetchPaymentAccountListResponse = ZeniAPIResponse<PaymentAccountsPayload>;
|
|
@@ -3,7 +3,7 @@ import { ID } from '../../../../commonStateTypes/common';
|
|
|
3
3
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState';
|
|
5
5
|
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { PlaidConnectionDetails } from '../../
|
|
6
|
+
import { PlaidConnectionDetails } from '../../commonSetup/setupViewState';
|
|
7
7
|
import { DepositAccountListSelectorView } from '../depositAccountList/depositAccountListSelector';
|
|
8
8
|
import { PaymentAccountListSelectorView } from '../paymentAccountList/paymentAccountListSelector';
|
|
9
9
|
import { ZeniAccountsConfigSelectorView } from '../zeniAccountsConfig/zeniAccountsConfigSelector';
|
|
@@ -8,8 +8,8 @@ const depositAccountListSelector_1 = require("../depositAccountList/depositAccou
|
|
|
8
8
|
const paymentAccountListSelector_1 = require("../paymentAccountList/paymentAccountListSelector");
|
|
9
9
|
const zeniAccountsConfigSelector_1 = require("../zeniAccountsConfig/zeniAccountsConfigSelector");
|
|
10
10
|
const getZeniAccountList = (state, companyId) => {
|
|
11
|
-
const { zeniAccountListState, depositAccountState, paymentAccountState,
|
|
12
|
-
const { accountDetails, plaidConnectionDetails } =
|
|
11
|
+
const { zeniAccountListState, depositAccountState, paymentAccountState, setupViewState, depositAccountListState, paymentAccountListState, } = state;
|
|
12
|
+
const { accountDetails, plaidConnectionDetails } = setupViewState;
|
|
13
13
|
const depositAccountsSelectorView = (0, depositAccountListSelector_1.getAllDepostAccounts)(depositAccountState, depositAccountListState);
|
|
14
14
|
const zeniAccountsConfig = (0, zeniAccountsConfigSelector_1.getZeniAccountsConfigDetail)(state);
|
|
15
15
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
@@ -10,8 +10,7 @@ import { updateAllUsers } from '../../../../../entity/user/userReducer';
|
|
|
10
10
|
import { updateUserRoles } from '../../../../../entity/userRole/userRoleReducer';
|
|
11
11
|
import { RootState } from '../../../../../reducer';
|
|
12
12
|
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
13
|
-
import { updateSetupViewLocalStoreData } from '../../../commonSetup/setupViewReducer';
|
|
13
|
+
import { updateSetupViewAccountDetails, updateSetupViewLocalStoreData } from '../../../commonSetup/setupViewReducer';
|
|
14
14
|
import { fetchZeniAccountSetupView, fetchZeniAccountSetupViewFailure, fetchZeniAccountSetupViewSuccess } from '../zeniAccountSetupViewReducer';
|
|
15
|
-
|
|
16
|
-
export declare type ActionType = ReturnType<typeof fetchZeniAccountSetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updatePlaidAccountViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchZeniAccountSetupViewSuccess> | ReturnType<typeof fetchZeniAccountSetupViewFailure>;
|
|
15
|
+
export declare type ActionType = ReturnType<typeof fetchZeniAccountSetupView> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateFiles> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAddresses> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateSetupViewAccountDetails> | ReturnType<typeof updateSetupViewLocalStoreData> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchZeniAccountSetupViewSuccess> | ReturnType<typeof fetchZeniAccountSetupViewFailure>;
|
|
17
16
|
export declare const fetchZeniAccountSetupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/epic/fetchZeniAccountSetupViewEpic.js
CHANGED
|
@@ -15,11 +15,10 @@ const userRoleReducer_1 = require("../../../../../entity/userRole/userRoleReduce
|
|
|
15
15
|
const responsePayload_1 = require("../../../../../responsePayload");
|
|
16
16
|
const setupViewReducer_1 = require("../../../commonSetup/setupViewReducer");
|
|
17
17
|
const zeniAccountSetupViewReducer_1 = require("../zeniAccountSetupViewReducer");
|
|
18
|
-
const plaidAccountViewReducer_1 = require("../../../plaidAccount/plaidAccountViewReducer");
|
|
19
18
|
const fetchZeniAccountSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(zeniAccountSetupViewReducer_1.fetchZeniAccountSetupView.match), (0, operators_1.switchMap)((action) => {
|
|
20
19
|
var _a;
|
|
21
20
|
const { companyId, cacheOverride, refreshViewInBackground } = action.payload;
|
|
22
|
-
const { zeniAccountSetupViewState,
|
|
21
|
+
const { zeniAccountSetupViewState, setupViewState, companyState } = state$.value;
|
|
23
22
|
const company = (_a = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId)) === null || _a === void 0 ? void 0 : _a.company;
|
|
24
23
|
if (cacheOverride === true ||
|
|
25
24
|
refreshViewInBackground === true ||
|
|
@@ -47,7 +46,7 @@ const fetchZeniAccountSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
47
46
|
(0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
48
47
|
companyId: response.data.companies[0].company_id,
|
|
49
48
|
}),
|
|
50
|
-
(0,
|
|
49
|
+
(0, setupViewReducer_1.updateSetupViewAccountDetails)(allBankAccountIds, paymentAccountIds),
|
|
51
50
|
(0, zeniAccountSetupViewReducer_1.fetchZeniAccountSetupViewSuccess)(),
|
|
52
51
|
];
|
|
53
52
|
return (0, rxjs_1.from)(actions);
|
|
@@ -63,10 +62,10 @@ const fetchZeniAccountSetupViewEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
63
62
|
JSON.stringify(error))))));
|
|
64
63
|
}
|
|
65
64
|
else {
|
|
66
|
-
const { allBankAccountIds, paymentAccountIds } =
|
|
65
|
+
const { allBankAccountIds, paymentAccountIds } = setupViewState.accountDetails;
|
|
67
66
|
return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
68
67
|
companyId,
|
|
69
|
-
}), (0,
|
|
68
|
+
}), (0, setupViewReducer_1.updateSetupViewAccountDetails)(allBankAccountIds, paymentAccountIds), (0, zeniAccountSetupViewReducer_1.fetchZeniAccountSetupViewSuccess)());
|
|
70
69
|
}
|
|
71
70
|
}));
|
|
72
71
|
exports.fetchZeniAccountSetupViewEpic = fetchZeniAccountSetupViewEpic;
|
package/lib/view/spendManagement/zeniAccounts/zeniAccountSetUp/zeniAccountSetupViewSelector.js
CHANGED
|
@@ -5,7 +5,7 @@ const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompan
|
|
|
5
5
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
6
6
|
const helpers_1 = require("../../helpers");
|
|
7
7
|
function getZeniAccountSetupViewDetails(state, companyId) {
|
|
8
|
-
const zeniAccountSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'zeni_accounts'
|
|
8
|
+
const zeniAccountSetupViewDetails = (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'zeni_accounts');
|
|
9
9
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
10
10
|
const companyZeniAccountInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyZeniAccountInfo;
|
|
11
11
|
const { zeniAccountSetupViewState, setupViewState } = state;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.48",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|