@zeniai/client-epic-state 4.14.76 → 4.14.77
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/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/index.d.ts +13 -14
- package/lib/index.js +29 -32
- package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.d.ts +1 -2
- package/lib/view/commonVendorView/transactionVendorView/epics/saveTransactionVendorEpic.js +15 -43
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +0 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +1 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +0 -6
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -19
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -153
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -5
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -10
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +0 -3
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +0 -27
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +0 -2
- package/package.json +2 -2
- package/lib/view/accountMappingView/accountMappingTypeHelper.d.ts +0 -17
- package/lib/view/accountMappingView/accountMappingTypeHelper.js +0 -2
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchAccountSettingsListForAccountTypesEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchAccountSettingsListForAccountTypesEpic.js +0 -41
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchRecommendationForAccountSettingsEpic.d.ts +0 -7
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/fetchRecommendationForAccountSettingsEpic.js +0 -27
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/initializeAccountSettingsViewEpic.d.ts +0 -4
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/initializeAccountSettingsViewEpic.js +0 -13
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/saveAccountSettingsViewEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/jeSchedule/accountSettings/saveAccountSettingsViewEpic.js +0 -50
- package/lib/view/expenseAutomationView/helpers/jeAccountSettingHelper.d.ts +0 -3
- package/lib/view/expenseAutomationView/helpers/jeAccountSettingHelper.js +0 -50
- package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +0 -19
- package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.js +0 -2
- package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.d.ts +0 -3
- package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +0 -41
|
@@ -1,46 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.retryJeScheduleSuccess = exports.retryJeScheduleFailure = exports.retryJeSchedule = exports.removeJeScheduleTransactionKey = exports.removeJeScheduleLocalDataById = exports.removeFailedJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.ignoreRecommendedJeScheduleSuccess = exports.ignoreRecommendedJeScheduleFailure = exports.ignoreRecommendedJeSchedule = exports.fetchJeSchedulesSuccess = exports.fetchJeSchedulesPage = exports.fetchJeSchedulesFailure = exports.fetchJeSchedules = exports.clearJeScheduleLocalData = exports.clearExpenseAutomationJESchedulesView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const getNestedAccountIDHierarchyForReport_1 = require("../../../commonStateTypes/accountView/getNestedAccountIDHierarchyForReport");
|
|
7
6
|
const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
8
|
-
const accountPayload_1 = require("../../../entity/account/accountPayload");
|
|
9
7
|
const jeSchedulesPayload_1 = require("../../../entity/jeSchedules/jeSchedulesPayload");
|
|
10
8
|
const transactionIDPayload_1 = require("../../../entity/transaction/payloadTypes/transactionIDPayload");
|
|
11
|
-
const accountTypeRecommendationPayload_1 = require("../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload");
|
|
12
9
|
const transactionDetailState_1 = require("../../transactionDetail/transactionDetailState");
|
|
13
|
-
exports.accountSettingsInitialState = {
|
|
14
|
-
localData: {
|
|
15
|
-
selectedPrepaidExpensesAccountIds: [],
|
|
16
|
-
selectedFixedAssetsAccountIds: [],
|
|
17
|
-
selectedAccruedExpensesAccountIds: [],
|
|
18
|
-
previousPrepaidExpensesAccount: [],
|
|
19
|
-
previousFixedAssetsAccount: [],
|
|
20
|
-
previousAccruedExpensesAccount: [],
|
|
21
|
-
},
|
|
22
|
-
accountListFetchState: {
|
|
23
|
-
error: undefined,
|
|
24
|
-
fetchState: 'Not-Started',
|
|
25
|
-
},
|
|
26
|
-
recommendationFetchState: {
|
|
27
|
-
error: undefined,
|
|
28
|
-
fetchState: 'Not-Started',
|
|
29
|
-
},
|
|
30
|
-
updateFetchState: {
|
|
31
|
-
error: undefined,
|
|
32
|
-
fetchState: 'Not-Started',
|
|
33
|
-
},
|
|
34
|
-
prepaidExpensesAccountIdList: [], // list of prepaid expenses accounts
|
|
35
|
-
prepaidExpensesNestedAccountListHierarchy: [],
|
|
36
|
-
prepaidExpensesRecommendations: [],
|
|
37
|
-
fixedAssetsAccountIdList: [], // list of fixed assets accounts
|
|
38
|
-
fixedAssetsNestedAccountListHierarchy: [],
|
|
39
|
-
fixedAssetsRecommendations: [],
|
|
40
|
-
accruedExpensesAccountIdList: [], // list of accrued expenses accounts
|
|
41
|
-
accruedExpensesNestedAccountListHierarchy: [],
|
|
42
|
-
accruedExpensesRecommendations: [],
|
|
43
|
-
};
|
|
44
10
|
exports.initialState = {
|
|
45
11
|
jeScheduleTransactionKeysByPeriod: {},
|
|
46
12
|
failedJeScheduleTransactionKeysByPeriod: {},
|
|
@@ -57,7 +23,6 @@ exports.initialState = {
|
|
|
57
23
|
fetchState: 'Not-Started',
|
|
58
24
|
error: undefined,
|
|
59
25
|
},
|
|
60
|
-
accountSettings: exports.accountSettingsInitialState,
|
|
61
26
|
fetchState: 'Not-Started',
|
|
62
27
|
error: undefined,
|
|
63
28
|
hasValidState() {
|
|
@@ -291,126 +256,10 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
291
256
|
const { scheduledJournalEntryID } = action.payload;
|
|
292
257
|
delete draft.jeScheduleLocalDataById[scheduledJournalEntryID];
|
|
293
258
|
},
|
|
294
|
-
initializeAccountSettingsView(draft) {
|
|
295
|
-
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
296
|
-
},
|
|
297
|
-
fetchRecommendationForAccountSettings(draft) {
|
|
298
|
-
draft.accountSettings.recommendationFetchState = {
|
|
299
|
-
error: undefined,
|
|
300
|
-
fetchState: 'In-Progress',
|
|
301
|
-
};
|
|
302
|
-
},
|
|
303
|
-
fetchAccountSettingsListForAccountTypes(draft) {
|
|
304
|
-
draft.accountSettings.accountListFetchState = {
|
|
305
|
-
error: undefined,
|
|
306
|
-
fetchState: 'In-Progress',
|
|
307
|
-
};
|
|
308
|
-
},
|
|
309
|
-
updateRecommendationForAccountSettings(draft, action) {
|
|
310
|
-
doUpdateRecommendationForAccountSettings(draft.accountSettings, action.payload);
|
|
311
|
-
},
|
|
312
|
-
updateRecommendationForAccountSettingsFailure(draft, action) {
|
|
313
|
-
const { status } = action.payload;
|
|
314
|
-
draft.accountSettings.recommendationFetchState = {
|
|
315
|
-
error: status,
|
|
316
|
-
fetchState: 'Error',
|
|
317
|
-
};
|
|
318
|
-
},
|
|
319
|
-
updateAccountSettingsListForAccountTypesFailure(draft, action) {
|
|
320
|
-
const { status } = action.payload;
|
|
321
|
-
draft.accountSettings.accountListFetchState = {
|
|
322
|
-
error: status,
|
|
323
|
-
fetchState: 'Error',
|
|
324
|
-
};
|
|
325
|
-
},
|
|
326
|
-
updateAccountSettingsListForAccountTypes(draft, action) {
|
|
327
|
-
doUpdateAccountSettingsListForAccountTypes(draft.accountSettings, action.payload.accountPayload);
|
|
328
|
-
},
|
|
329
|
-
saveAccountSettings(draft) {
|
|
330
|
-
draft.accountSettings.updateFetchState = {
|
|
331
|
-
error: undefined,
|
|
332
|
-
fetchState: 'In-Progress',
|
|
333
|
-
};
|
|
334
|
-
},
|
|
335
|
-
saveAccountSettingsSuccess(draft) {
|
|
336
|
-
draft.accountSettings.updateFetchState = {
|
|
337
|
-
error: undefined,
|
|
338
|
-
fetchState: 'Completed',
|
|
339
|
-
};
|
|
340
|
-
},
|
|
341
|
-
saveAccountSettingsLocalData(draft, action) {
|
|
342
|
-
const { data } = action.payload;
|
|
343
|
-
draft.accountSettings.localData = Object.assign(Object.assign({}, draft.accountSettings.localData), data);
|
|
344
|
-
},
|
|
345
|
-
saveAccountSettingsFailure(draft, action) {
|
|
346
|
-
const { status } = action.payload;
|
|
347
|
-
draft.accountSettings.updateFetchState = {
|
|
348
|
-
error: status,
|
|
349
|
-
fetchState: 'Error',
|
|
350
|
-
};
|
|
351
|
-
},
|
|
352
|
-
clearJeAccountSettingsLocalData(draft) {
|
|
353
|
-
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
354
|
-
},
|
|
355
259
|
clearExpenseAutomationJESchedulesView(draft) {
|
|
356
260
|
Object.assign(draft, exports.initialState);
|
|
357
261
|
},
|
|
358
262
|
},
|
|
359
263
|
});
|
|
360
|
-
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.
|
|
264
|
+
_a = expenseAutomationJESchedulesView.actions, exports.clearExpenseAutomationJESchedulesView = _a.clearExpenseAutomationJESchedulesView, exports.clearJeScheduleLocalData = _a.clearJeScheduleLocalData, exports.fetchJeSchedules = _a.fetchJeSchedules, exports.fetchJeSchedulesFailure = _a.fetchJeSchedulesFailure, exports.fetchJeSchedulesPage = _a.fetchJeSchedulesPage, exports.fetchJeSchedulesSuccess = _a.fetchJeSchedulesSuccess, exports.ignoreRecommendedJeSchedule = _a.ignoreRecommendedJeSchedule, exports.ignoreRecommendedJeScheduleFailure = _a.ignoreRecommendedJeScheduleFailure, exports.ignoreRecommendedJeScheduleSuccess = _a.ignoreRecommendedJeScheduleSuccess, exports.initializeJeScheduleLocalData = _a.initializeJeScheduleLocalData, exports.removeFailedJeScheduleTransactionKey = _a.removeFailedJeScheduleTransactionKey, exports.removeJeScheduleLocalDataById = _a.removeJeScheduleLocalDataById, exports.removeJeScheduleTransactionKey = _a.removeJeScheduleTransactionKey, exports.retryJeSchedule = _a.retryJeSchedule, exports.retryJeScheduleFailure = _a.retryJeScheduleFailure, exports.retryJeScheduleSuccess = _a.retryJeScheduleSuccess, exports.updateJeScheduleLocalDataById = _a.updateJeScheduleLocalDataById, exports.updateJeScheduleTransactionKeys = _a.updateJeScheduleTransactionKeys;
|
|
361
265
|
exports.default = expenseAutomationJESchedulesView.reducer;
|
|
362
|
-
const doUpdateRecommendationForAccountSettings = (draft, payload) => {
|
|
363
|
-
const { prepaidExpensesRecommendations, fixedAssetsRecommendations, accruedExpensesRecommendations, } = (0, accountTypeRecommendationPayload_1.mapAccountTypeRecommendationPayloadToAccountRecommendationByType)(payload);
|
|
364
|
-
draft.prepaidExpensesRecommendations = prepaidExpensesRecommendations;
|
|
365
|
-
draft.fixedAssetsRecommendations = fixedAssetsRecommendations;
|
|
366
|
-
draft.accruedExpensesRecommendations = accruedExpensesRecommendations;
|
|
367
|
-
draft.recommendationFetchState = {
|
|
368
|
-
error: undefined,
|
|
369
|
-
fetchState: 'Completed',
|
|
370
|
-
};
|
|
371
|
-
};
|
|
372
|
-
const doUpdateAccountSettingsListForAccountTypes = (draft, accountPayloadList) => {
|
|
373
|
-
const prepaidExpensesList = [];
|
|
374
|
-
const fixedAssetsList = [];
|
|
375
|
-
const accruedExpensesList = [];
|
|
376
|
-
accountPayloadList.forEach((account) => {
|
|
377
|
-
if (account.account_type === 'other_current_assets') {
|
|
378
|
-
prepaidExpensesList.push(account); // list of prepaid expenses
|
|
379
|
-
}
|
|
380
|
-
else if (account.account_type === 'fixed_assets' ||
|
|
381
|
-
account.account_type === 'other_assets') {
|
|
382
|
-
fixedAssetsList.push(account); // list for fixed assets
|
|
383
|
-
}
|
|
384
|
-
else if (account.account_type === 'other_current_liabilities') {
|
|
385
|
-
accruedExpensesList.push(account); // list for accrued expenses
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
draft.prepaidExpensesAccountIdList = prepaidExpensesList.map((account) => account.account_id);
|
|
389
|
-
draft.fixedAssetsAccountIdList = fixedAssetsList.map((account) => account.account_id);
|
|
390
|
-
draft.accruedExpensesAccountIdList = accruedExpensesList.map((account) => account.account_id);
|
|
391
|
-
// Prepaid expenses
|
|
392
|
-
const prepaidExpensesAccountMetadata = prepaidExpensesList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
393
|
-
const prepaidExpensesAccountBase = prepaidExpensesList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
394
|
-
const prepaidExpensesAccountsIdentified = prepaidExpensesAccountBase.filter((account) => account.labels.includes('prepaid_expenses'));
|
|
395
|
-
draft.localData = Object.assign(Object.assign({}, draft.localData), { selectedPrepaidExpensesAccountIds: prepaidExpensesAccountsIdentified.map((account) => account.accountId), previousPrepaidExpensesAccount: prepaidExpensesAccountsIdentified });
|
|
396
|
-
draft.prepaidExpensesNestedAccountListHierarchy =
|
|
397
|
-
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(prepaidExpensesAccountMetadata);
|
|
398
|
-
// Fixed assets
|
|
399
|
-
const fixedAssetsAccountMetadata = fixedAssetsList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
400
|
-
const fixedAssetsAccountBase = fixedAssetsList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
401
|
-
const fixedAssetsAccountsIdentified = fixedAssetsAccountBase.filter((account) => account.labels.includes('fixed_assets'));
|
|
402
|
-
draft.localData = Object.assign(Object.assign({}, draft.localData), { selectedFixedAssetsAccountIds: fixedAssetsAccountsIdentified.map((account) => account.accountId), previousFixedAssetsAccount: fixedAssetsAccountsIdentified });
|
|
403
|
-
draft.fixedAssetsNestedAccountListHierarchy =
|
|
404
|
-
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(fixedAssetsAccountMetadata);
|
|
405
|
-
// Accrued expenses
|
|
406
|
-
const accruedExpensesAccountMetadata = accruedExpensesList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
407
|
-
const accruedExpensesAccountBase = accruedExpensesList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
408
|
-
const accruedExpensesAccountsIdentified = accruedExpensesAccountBase.filter((account) => account.labels.includes('accrued_expenses'));
|
|
409
|
-
draft.localData = Object.assign(Object.assign({}, draft.localData), { selectedAccruedExpensesAccountIds: accruedExpensesAccountsIdentified.map((account) => account.accountId), previousAccruedExpensesAccount: accruedExpensesAccountsIdentified });
|
|
410
|
-
draft.accruedExpensesNestedAccountListHierarchy =
|
|
411
|
-
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(accruedExpensesAccountMetadata);
|
|
412
|
-
draft.accountListFetchState = {
|
|
413
|
-
error: undefined,
|
|
414
|
-
fetchState: 'Completed',
|
|
415
|
-
};
|
|
416
|
-
};
|
|
@@ -116,10 +116,6 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
116
116
|
amount: number;
|
|
117
117
|
recommendationByLineId: RecommendationByLineId;
|
|
118
118
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
119
|
-
}, "expenseAutomationTransactionsView/setEntityRecommendationForLineIdsForCategorization", never, never
|
|
120
|
-
selectedTab: TransactionsTab;
|
|
121
|
-
transactionId: ID;
|
|
122
|
-
lineId: ID;
|
|
123
|
-
}, "expenseAutomationTransactionsView/updateSelectedTransactionId">;
|
|
119
|
+
}, "expenseAutomationTransactionsView/setEntityRecommendationForLineIdsForCategorization", never, never>;
|
|
124
120
|
declare const _default: import("redux").Reducer<TransactionsViewState>;
|
|
125
121
|
export default _default;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdate = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -42,8 +42,6 @@ exports.initialTransactionTabViewState = {
|
|
|
42
42
|
transactionReviewLocalDataById: {},
|
|
43
43
|
transactionIdsBySelectedPeriod: {},
|
|
44
44
|
selectedCheckBoxTransactionIds: [],
|
|
45
|
-
selectedTransactionId: undefined,
|
|
46
|
-
selectedTransactionLineId: undefined,
|
|
47
45
|
};
|
|
48
46
|
exports.initialState = {
|
|
49
47
|
selectedTransactionCategorizationTab: 'review',
|
|
@@ -412,12 +410,6 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
412
410
|
}
|
|
413
411
|
}
|
|
414
412
|
},
|
|
415
|
-
updateSelectedTransactionId(draft, action) {
|
|
416
|
-
const { selectedTab, transactionId, lineId } = action.payload;
|
|
417
|
-
draft.transactionCategorizationView[selectedTab].selectedTransactionId =
|
|
418
|
-
transactionId;
|
|
419
|
-
draft.transactionCategorizationView[selectedTab].selectedTransactionLineId = lineId;
|
|
420
|
-
},
|
|
421
413
|
updateTransactionCategorizationSaveStatus: {
|
|
422
414
|
reducer(draft, action) {
|
|
423
415
|
const selectedTab = action.payload.selectedTab;
|
|
@@ -502,5 +494,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
502
494
|
},
|
|
503
495
|
},
|
|
504
496
|
});
|
|
505
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdate = _a.updateStatusForTransactionNotMiscategorizedUpdate, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization
|
|
497
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdate = _a.updateStatusForTransactionNotMiscategorizedUpdate, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization;
|
|
506
498
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -7,7 +7,6 @@ import { ClassBase } from '../../../entity/class/classState';
|
|
|
7
7
|
import { JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
8
8
|
import { JEScheduleTransactionKey } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
9
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
10
|
-
import { JEAccountSettingsView } from '../selectorTypes/jeAccountSettingsViewSelectorTypes';
|
|
11
10
|
import { JEScheduledTransactionWithFailedEntries } from '../selectors/jeSchedulesViewSelector';
|
|
12
11
|
import { JEScheduleLocalData, JESchedulesViewUIState } from '../types/jeSchedulesViewState';
|
|
13
12
|
export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
@@ -20,7 +19,6 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
|
|
|
20
19
|
allAccountList: AccountBase[];
|
|
21
20
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
22
21
|
accountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
23
|
-
accountSettingsView: JEAccountSettingsView;
|
|
24
22
|
allClassList: ClassBase[];
|
|
25
23
|
classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
|
|
26
24
|
allDepreciationAccountList: AccountBase[];
|
|
@@ -27,6 +27,4 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
27
27
|
saveStatus: FetchStateAndError;
|
|
28
28
|
completionStatus: CompletionStatusType;
|
|
29
29
|
fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
|
|
30
|
-
selectedTransactionId?: ID;
|
|
31
|
-
selectedTransactionLineId?: ID;
|
|
32
30
|
}
|
|
@@ -12,14 +12,12 @@ const scheduleDetailLocalDataHelper_1 = require("../../scheduleView/scheduleDeta
|
|
|
12
12
|
const scheduleDetailSelector_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailSelector");
|
|
13
13
|
const scheduleListHelper_1 = require("../../scheduleView/scheduleListView/scheduleListHelper");
|
|
14
14
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
15
|
-
const jeAccountSettingsViewSelector_1 = require("./jeAccountSettingsViewSelector");
|
|
16
15
|
function getExpenseAutomationJESchedulesView(state) {
|
|
17
16
|
var _a;
|
|
18
17
|
const jeScheduledTransaction = [];
|
|
19
18
|
const failedJeScheduledTransaction = [];
|
|
20
19
|
const { accountState, accountListState, classState, classListState, expenseAutomationJESchedulesViewState, expenseAutomationViewState, monthEndCloseChecksState, } = state;
|
|
21
20
|
const { jeScheduleTransactionKeysByPeriod, failedJeScheduleTransactionKeysByPeriod, jeScheduleLocalDataById, postStatusById, ignoreStatusById, uiState, error, fetchState, refreshStatus, } = expenseAutomationJESchedulesViewState;
|
|
22
|
-
const accountSettingsView = (0, jeAccountSettingsViewSelector_1.getJEAccountSettingsView)(state);
|
|
23
21
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
24
22
|
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
25
23
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
@@ -85,7 +83,6 @@ function getExpenseAutomationJESchedulesView(state) {
|
|
|
85
83
|
allClassList: allClasses,
|
|
86
84
|
draftSchedules,
|
|
87
85
|
resolveSchedules: resolveSchedules,
|
|
88
|
-
accountSettingsView,
|
|
89
86
|
postStatusById: postStatusById,
|
|
90
87
|
ignoreStatusById: ignoreStatusById,
|
|
91
88
|
fetchState: fetchState,
|
|
@@ -16,7 +16,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
16
16
|
var _a;
|
|
17
17
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
18
18
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
19
|
-
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds,
|
|
19
|
+
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
20
20
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
21
21
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
22
22
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
@@ -104,7 +104,5 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
104
104
|
completionStatus,
|
|
105
105
|
totalCountByTab,
|
|
106
106
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
107
|
-
selectedTransactionId,
|
|
108
|
-
selectedTransactionLineId,
|
|
109
107
|
};
|
|
110
108
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
|
-
import { Recommendation } from '../../../commonStateTypes/recommendationBase';
|
|
4
2
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
5
|
-
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
3
|
import { JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
7
4
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
8
5
|
export interface JESchedulesViewUIState {
|
|
@@ -27,32 +24,8 @@ export interface JESchedulesViewState extends FetchedState {
|
|
|
27
24
|
jeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
|
|
28
25
|
failedJeScheduleTransactionKeysByPeriod: Record<MonthYearPeriodId, JEScheduleTransactionKey[]>;
|
|
29
26
|
jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
|
|
30
|
-
accountSettings: AccountSettingsState;
|
|
31
27
|
postStatusById: Record<ID, FetchStateAndError>;
|
|
32
28
|
ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
|
|
33
29
|
refreshStatus: FetchStateAndError;
|
|
34
30
|
uiState: JESchedulesViewUIState;
|
|
35
31
|
}
|
|
36
|
-
export interface AccountSettingsLocalData {
|
|
37
|
-
selectedFixedAssetsAccountIds: ID[];
|
|
38
|
-
selectedPrepaidExpensesAccountIds: ID[];
|
|
39
|
-
selectedAccruedExpensesAccountIds: ID[];
|
|
40
|
-
previousPrepaidExpensesAccount: AccountBase[];
|
|
41
|
-
previousFixedAssetsAccount: AccountBase[];
|
|
42
|
-
previousAccruedExpensesAccount: AccountBase[];
|
|
43
|
-
}
|
|
44
|
-
export interface AccountSettingsState {
|
|
45
|
-
localData: AccountSettingsLocalData;
|
|
46
|
-
accountListFetchState: FetchStateAndError;
|
|
47
|
-
recommendationFetchState: FetchStateAndError;
|
|
48
|
-
updateFetchState: FetchStateAndError;
|
|
49
|
-
prepaidExpensesAccountIdList: ID[];
|
|
50
|
-
prepaidExpensesNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
|
|
51
|
-
prepaidExpensesRecommendations: Recommendation[];
|
|
52
|
-
fixedAssetsAccountIdList: ID[];
|
|
53
|
-
fixedAssetsNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
|
|
54
|
-
fixedAssetsRecommendations: Recommendation[];
|
|
55
|
-
accruedExpensesAccountIdList: ID[];
|
|
56
|
-
accruedExpensesNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
|
|
57
|
-
accruedExpensesRecommendations: Recommendation[];
|
|
58
|
-
}
|
|
@@ -84,8 +84,6 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
84
84
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
85
85
|
refreshStatus: FetchStateAndError;
|
|
86
86
|
uiState: TransactionsViewUIState;
|
|
87
|
-
selectedTransactionId?: ID;
|
|
88
|
-
selectedTransactionLineId?: ID;
|
|
89
87
|
}
|
|
90
88
|
export type TransactionsViewState = {
|
|
91
89
|
selectedTransactionCategorizationTab: TransactionsTab;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.77",
|
|
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",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/zeni-ai/client-epic-state#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@liveblocks/client": "^2.
|
|
28
|
+
"@liveblocks/client": "^2.20.0",
|
|
29
29
|
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
|
30
30
|
"@types/chai": "^5.0.1",
|
|
31
31
|
"@types/jest": "^29.5.14",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
|
-
import { Recommendation } from '../../commonStateTypes/recommendationBase';
|
|
3
|
-
import { AccountBase } from '../../entity/account/accountState';
|
|
4
|
-
export interface VendorAccountMappingView {
|
|
5
|
-
prepaidExpensesAccountList: AccountBase[];
|
|
6
|
-
fixedAssetsAccountList: AccountBase[];
|
|
7
|
-
accruedExpensesAccountList: AccountBase[];
|
|
8
|
-
prepaidExpensesRecommendations: Recommendation[];
|
|
9
|
-
fixedAssetsRecommendations: Recommendation[];
|
|
10
|
-
accruedExpensesRecommendations: Recommendation[];
|
|
11
|
-
prepaidExpensesAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
12
|
-
fixedAssetsAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
13
|
-
accruedExpensesAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
14
|
-
selectedPrepaidExpensesAccountIds: string[];
|
|
15
|
-
selectedFixedAssetsAccountIds: string[];
|
|
16
|
-
selectedAccruedExpensesAccountIds: string[];
|
|
17
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateAccounts } from '../../../../../entity/account/accountReducer';
|
|
4
|
-
import { RootState } from '../../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
-
import { fetchAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypes, updateAccountSettingsListForAccountTypesFailure } from '../../../reducers/jeSchedulesViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchAccountSettingsListForAccountTypes> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAccountSettingsListForAccountTypes> | ReturnType<typeof updateAccountSettingsListForAccountTypesFailure>;
|
|
8
|
-
export declare const fetchAccountSettingsListForAccountTypesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAccountSettingsListForAccountTypesEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const accountReducer_1 = require("../../../../../entity/account/accountReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
-
const jeSchedulesViewReducer_1 = require("../../../reducers/jeSchedulesViewReducer");
|
|
9
|
-
const fetchAccountSettingsListForAccountTypesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchAccountSettingsListForAccountTypes.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
const queryParam = {
|
|
11
|
-
is_bookkeeping_admin: false,
|
|
12
|
-
is_include_tax_1099_config: false,
|
|
13
|
-
};
|
|
14
|
-
return zeniAPI
|
|
15
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
16
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
18
|
-
const actions = [];
|
|
19
|
-
const accountListPayload = [];
|
|
20
|
-
response.data.accounts.forEach((account) => {
|
|
21
|
-
accountListPayload.push(account);
|
|
22
|
-
});
|
|
23
|
-
actions.push((0, accountReducer_1.updateAccounts)([...accountListPayload], 'account_list_by_type'));
|
|
24
|
-
actions.push((0, jeSchedulesViewReducer_1.updateAccountSettingsListForAccountTypes)({
|
|
25
|
-
accountPayload: accountListPayload,
|
|
26
|
-
}));
|
|
27
|
-
return (0, rxjs_1.from)(actions);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.updateAccountSettingsListForAccountTypesFailure)({
|
|
31
|
-
status: response.status,
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
}), (0, operators_1.catchError)((error) => {
|
|
35
|
-
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.updateAccountSettingsListForAccountTypesFailure)({
|
|
36
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Accounts For Account Type REST API call errored out' +
|
|
37
|
-
JSON.stringify(error)),
|
|
38
|
-
}));
|
|
39
|
-
}));
|
|
40
|
-
}));
|
|
41
|
-
exports.fetchAccountSettingsListForAccountTypesEpic = fetchAccountSettingsListForAccountTypesEpic;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
-
import { fetchRecommendationForAccountSettings, updateRecommendationForAccountSettings, updateRecommendationForAccountSettingsFailure } from '../../../reducers/jeSchedulesViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof updateRecommendationForAccountSettings> | ReturnType<typeof fetchRecommendationForAccountSettings> | ReturnType<typeof updateRecommendationForAccountSettingsFailure>;
|
|
7
|
-
export declare const fetchRecommendationForAccountSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchRecommendationForAccountSettingsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
-
const jeSchedulesViewReducer_1 = require("../../../reducers/jeSchedulesViewReducer");
|
|
8
|
-
const fetchRecommendationForAccountSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchRecommendationForAccountSettings.match), (0, operators_1.switchMap)(() => {
|
|
9
|
-
return zeniAPI
|
|
10
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/account-recommendations`)
|
|
11
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
12
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
13
|
-
const actions = [];
|
|
14
|
-
actions.push((0, jeSchedulesViewReducer_1.updateRecommendationForAccountSettings)(response.data));
|
|
15
|
-
return (0, rxjs_1.from)(actions);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.updateRecommendationForAccountSettingsFailure)({
|
|
19
|
-
status: response.status,
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.updateRecommendationForAccountSettingsFailure)({
|
|
23
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch account recommendations REST API call errored out' +
|
|
24
|
-
JSON.stringify(error)),
|
|
25
|
-
}))));
|
|
26
|
-
}));
|
|
27
|
-
exports.fetchRecommendationForAccountSettingsEpic = fetchRecommendationForAccountSettingsEpic;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable } from 'redux-observable';
|
|
2
|
-
import { fetchAccountSettingsListForAccountTypes, fetchRecommendationForAccountSettings, initializeAccountSettingsView } from '../../../reducers/jeSchedulesViewReducer';
|
|
3
|
-
export type ActionType = ReturnType<typeof fetchAccountSettingsListForAccountTypes> | ReturnType<typeof fetchRecommendationForAccountSettings> | ReturnType<typeof initializeAccountSettingsView>;
|
|
4
|
-
export declare const initializeAccountSettingsViewEpic: (actions$: ActionsObservable<ActionType>) => import("rxjs").Observable<ActionType>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initializeAccountSettingsViewEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const jeSchedulesViewReducer_1 = require("../../../reducers/jeSchedulesViewReducer");
|
|
7
|
-
const initializeAccountSettingsViewEpic = (actions$) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.initializeAccountSettingsView.match), (0, operators_1.mergeMap)(() => {
|
|
8
|
-
const fetchActions = [];
|
|
9
|
-
fetchActions.push((0, jeSchedulesViewReducer_1.fetchAccountSettingsListForAccountTypes)());
|
|
10
|
-
fetchActions.push((0, jeSchedulesViewReducer_1.fetchRecommendationForAccountSettings)());
|
|
11
|
-
return (0, rxjs_1.from)(fetchActions);
|
|
12
|
-
}));
|
|
13
|
-
exports.initializeAccountSettingsViewEpic = initializeAccountSettingsViewEpic;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
4
|
-
import { RootState } from '../../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
6
|
-
import { saveAccountSettings, saveAccountSettingsFailure, saveAccountSettingsSuccess } from '../../../reducers/jeSchedulesViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof saveAccountSettings> | ReturnType<typeof saveAccountSettingsFailure> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveAccountSettingsSuccess>;
|
|
8
|
-
export declare const saveAccountSettingsViewEpic: (actions$: ActionsObservable<ActionType>, state: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveAccountSettingsViewEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
8
|
-
const jeAccountSettingHelper_1 = require("../../../helpers/jeAccountSettingHelper");
|
|
9
|
-
const jeSchedulesViewReducer_1 = require("../../../reducers/jeSchedulesViewReducer");
|
|
10
|
-
const saveAccountSettingsViewEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.saveAccountSettings.match), (0, operators_1.mergeMap)(() => {
|
|
11
|
-
const accountMappingState = state.value.expenseAutomationJESchedulesViewState.accountSettings;
|
|
12
|
-
const payload = (0, jeAccountSettingHelper_1.toSaveJeAccountSettingsMappingPayload)(accountMappingState.localData);
|
|
13
|
-
if (payload.length === 0) {
|
|
14
|
-
const action = [
|
|
15
|
-
(0, jeSchedulesViewReducer_1.saveAccountSettingsFailure)({
|
|
16
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('No Account Mapping Data to Save'),
|
|
17
|
-
}),
|
|
18
|
-
];
|
|
19
|
-
return (0, rxjs_1.from)(action);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return zeniAPI
|
|
23
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts`, { accounts: payload })
|
|
24
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
-
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
26
|
-
const actionsSuccess = [
|
|
27
|
-
(0, jeSchedulesViewReducer_1.saveAccountSettingsSuccess)(),
|
|
28
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
29
|
-
messageSection: 'settings_accounting_accounts_updated',
|
|
30
|
-
messageText: 'success',
|
|
31
|
-
type: 'success',
|
|
32
|
-
}),
|
|
33
|
-
];
|
|
34
|
-
return (0, rxjs_1.from)(actionsSuccess);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
const actionsFailure = [
|
|
38
|
-
(0, jeSchedulesViewReducer_1.saveAccountSettingsFailure)({
|
|
39
|
-
status: response.status,
|
|
40
|
-
}),
|
|
41
|
-
];
|
|
42
|
-
return (0, rxjs_1.from)(actionsFailure);
|
|
43
|
-
}
|
|
44
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, jeSchedulesViewReducer_1.saveAccountSettingsFailure)({
|
|
45
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Save Account Mapping REST API call errored out' +
|
|
46
|
-
JSON.stringify(error)),
|
|
47
|
-
}))));
|
|
48
|
-
}
|
|
49
|
-
}));
|
|
50
|
-
exports.saveAccountSettingsViewEpic = saveAccountSettingsViewEpic;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { AccountBasePayload } from '../../../entity/account/accountPayload';
|
|
2
|
-
import { AccountSettingsLocalData } from '../types/jeSchedulesViewState';
|
|
3
|
-
export declare const toSaveJeAccountSettingsMappingPayload: (accountingLocalData: AccountSettingsLocalData) => Partial<AccountBasePayload>[];
|