@zeniai/client-epic-state 5.0.64-betaML1 → 5.0.64-betaSS1
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/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -2
- package/lib/entity/account/accountSelector.d.ts +0 -9
- package/lib/entity/account/accountSelector.js +1 -14
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +0 -4
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +0 -10
- package/lib/entity/transaction/stateTypes/transaction.d.ts +0 -3
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -3
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +0 -2
- package/lib/esm/entity/account/accountSelector.js +0 -11
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +0 -10
- package/lib/esm/epic.js +1 -3
- package/lib/esm/index.js +7 -6
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +6 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +11 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +1 -8
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +113 -78
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -31
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +17 -0
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +0 -5
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +0 -10
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +2 -24
- package/lib/index.d.ts +6 -5
- package/lib/index.js +39 -45
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +6 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +10 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +0 -7
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +21 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +10 -23
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +114 -79
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +15 -4
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +0 -2
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -32
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +10 -0
- package/lib/view/expenseAutomationView/types/completedSubTab.js +21 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +32 -15
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -6
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +1 -2
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +0 -10
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -6
- package/lib/view/transactionDetail/transactionDetailSelector.js +1 -23
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +0 -81
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +0 -30
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.d.ts +0 -9
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +0 -85
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.d.ts +0 -8
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +0 -34
package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
3
|
-
import { removeTransaction, updateTransaction } from '../../../../entity/transaction/transactionReducer';
|
|
4
|
-
import { RootState } from '../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
-
import { initializeTransactionDetailLocalData, removeTransactionDetail } from '../../../transactionDetail/transactionDetailReducer';
|
|
7
|
-
import { acknowledgeTransferEntryRouteReplacement, createTransferEntry, createTransferEntryFailure, createTransferEntryReplacedTransaction, createTransferEntrySuccess, removeTransactionFromAllTabs, resetCreateTransferEntryStatus } from '../../reducers/transactionsViewReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof openSnackbar> | ReturnType<typeof createTransferEntry> | ReturnType<typeof createTransferEntrySuccess> | ReturnType<typeof createTransferEntryFailure> | ReturnType<typeof removeTransactionFromAllTabs> | ReturnType<typeof resetCreateTransferEntryStatus> | ReturnType<typeof createTransferEntryReplacedTransaction> | ReturnType<typeof acknowledgeTransferEntryRouteReplacement> | ReturnType<typeof updateTransaction> | ReturnType<typeof initializeTransactionDetailLocalData> | ReturnType<typeof removeTransaction> | ReturnType<typeof removeTransactionDetail>;
|
|
9
|
-
export declare const createTransferEntryEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTransferEntryEpic = 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 transactionIDPayload_1 = require("../../../../entity/transaction/payloadTypes/transactionIDPayload");
|
|
8
|
-
const transactionType_1 = require("../../../../entity/transaction/stateTypes/transactionType");
|
|
9
|
-
const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
|
|
10
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
-
const transactionDetailReducer_1 = require("../../../transactionDetail/transactionDetailReducer");
|
|
12
|
-
const transactionDetailState_1 = require("../../../transactionDetail/transactionDetailState");
|
|
13
|
-
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
14
|
-
function transactionIdsAreEqual(a, b) {
|
|
15
|
-
return a.id === b.id && a.type === b.type;
|
|
16
|
-
}
|
|
17
|
-
const createTransferEntryEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.createTransferEntry.match), (0, operators_1.mergeMap)((action) => {
|
|
18
|
-
const { transactionId, creditAccountIntegrationId, debitAccountIntegrationId, memo, transactionType, sourceTransactionType, } = action.payload;
|
|
19
|
-
const url = `https://dev.api.zeni.ai/version/accounting/komal/1.0/transactions/transaction-type-update`;
|
|
20
|
-
return zeniAPI
|
|
21
|
-
.postAndGetJSON(url, {
|
|
22
|
-
transaction_type: transactionType,
|
|
23
|
-
transaction_id: transactionId,
|
|
24
|
-
to_account_integration_id: creditAccountIntegrationId,
|
|
25
|
-
from_account_integration_id: debitAccountIntegrationId,
|
|
26
|
-
memo,
|
|
27
|
-
})
|
|
28
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
29
|
-
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
30
|
-
const immediate = [];
|
|
31
|
-
const previousTransactionId = {
|
|
32
|
-
id: transactionId,
|
|
33
|
-
type: (0, transactionType_1.toTransactionType)(sourceTransactionType),
|
|
34
|
-
};
|
|
35
|
-
if (response.data?.transaction != null) {
|
|
36
|
-
const newTransactionId = (0, transactionIDPayload_1.toTransactionID)(response.data.transaction);
|
|
37
|
-
const replaced = !transactionIdsAreEqual(previousTransactionId, newTransactionId);
|
|
38
|
-
const newDetailKey = (0, transactionDetailState_1.getTransactionDetailKey)(newTransactionId);
|
|
39
|
-
immediate.push((0, transactionReducer_1.updateTransaction)(newDetailKey, response.data.transaction));
|
|
40
|
-
immediate.push((0, transactionDetailReducer_1.initializeTransactionDetailLocalData)({
|
|
41
|
-
transactionId: newTransactionId,
|
|
42
|
-
vendorId: response.data.vendors?.[0]?.vendor_id,
|
|
43
|
-
}));
|
|
44
|
-
immediate.push((0, transactionsViewReducer_1.createTransferEntrySuccess)(), (0, transactionsViewReducer_1.removeTransactionFromAllTabs)(transactionId), (0, snackbarReducer_1.openSnackbar)({
|
|
45
|
-
messageSection: 'create_transfer_entry',
|
|
46
|
-
messageText: 'success',
|
|
47
|
-
type: 'success',
|
|
48
|
-
}));
|
|
49
|
-
if (replaced) {
|
|
50
|
-
immediate.push((0, transactionsViewReducer_1.createTransferEntryReplacedTransaction)(previousTransactionId, newTransactionId));
|
|
51
|
-
}
|
|
52
|
-
return (0, rxjs_1.concat)((0, rxjs_1.from)(immediate), (0, rxjs_1.timer)(0).pipe((0, operators_1.map)(() => (0, transactionsViewReducer_1.resetCreateTransferEntryStatus)()), (0, operators_1.mergeMap)((resetAction) => replaced
|
|
53
|
-
? (0, rxjs_1.from)([
|
|
54
|
-
resetAction,
|
|
55
|
-
(0, transactionReducer_1.removeTransaction)((0, transactionDetailState_1.getTransactionDetailKey)(previousTransactionId)),
|
|
56
|
-
(0, transactionDetailReducer_1.removeTransactionDetail)(previousTransactionId),
|
|
57
|
-
(0, transactionsViewReducer_1.acknowledgeTransferEntryRouteReplacement)(),
|
|
58
|
-
])
|
|
59
|
-
: (0, rxjs_1.from)([resetAction]))));
|
|
60
|
-
}
|
|
61
|
-
immediate.push((0, transactionsViewReducer_1.createTransferEntrySuccess)(), (0, transactionsViewReducer_1.removeTransactionFromAllTabs)(transactionId), (0, snackbarReducer_1.openSnackbar)({
|
|
62
|
-
messageSection: 'create_transfer_entry',
|
|
63
|
-
messageText: 'success',
|
|
64
|
-
type: 'success',
|
|
65
|
-
}));
|
|
66
|
-
return (0, rxjs_1.concat)((0, rxjs_1.from)(immediate), (0, rxjs_1.timer)(0).pipe((0, operators_1.map)(() => (0, transactionsViewReducer_1.resetCreateTransferEntryStatus)())));
|
|
67
|
-
}
|
|
68
|
-
return (0, rxjs_1.from)([
|
|
69
|
-
(0, transactionsViewReducer_1.createTransferEntryFailure)(),
|
|
70
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
71
|
-
messageSection: 'create_transfer_entry',
|
|
72
|
-
messageText: 'failed',
|
|
73
|
-
type: 'error',
|
|
74
|
-
}),
|
|
75
|
-
]);
|
|
76
|
-
}), (0, operators_1.catchError)(() => (0, rxjs_1.from)([
|
|
77
|
-
(0, transactionsViewReducer_1.createTransferEntryFailure)(),
|
|
78
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
79
|
-
messageSection: 'create_transfer_entry',
|
|
80
|
-
messageText: 'failed',
|
|
81
|
-
type: 'error',
|
|
82
|
-
}),
|
|
83
|
-
])));
|
|
84
|
-
}));
|
|
85
|
-
exports.createTransferEntryEpic = createTransferEntryEpic;
|
|
@@ -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 { fetchAccountsForTransferFlow, updateAccountsForTransferFlow, updateAccountsForTransferFlowFailure } from '../../reducers/transactionsViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchAccountsForTransferFlow> | ReturnType<typeof updateAccountsForTransferFlow> | ReturnType<typeof updateAccountsForTransferFlowFailure> | ReturnType<typeof updateAccounts>;
|
|
8
|
-
export declare const fetchTransferAccountsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchTransferAccountsEpic = 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 transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
9
|
-
const REPORT_ID_BY_KIND = {
|
|
10
|
-
transfer_eligible: 'transfer_accounts',
|
|
11
|
-
credit_card_only: 'credit_card_transfer_accounts',
|
|
12
|
-
};
|
|
13
|
-
const QUERY_BY_KIND = {
|
|
14
|
-
transfer_eligible: { is_only_include_transfer_accounts: true },
|
|
15
|
-
credit_card_only: { is_include_only_credit_card_accounts: true },
|
|
16
|
-
};
|
|
17
|
-
const fetchTransferAccountsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.fetchAccountsForTransferFlow.match), (0, operators_1.switchMap)((action) => {
|
|
18
|
-
const { kind } = action.payload;
|
|
19
|
-
const queryValue = QUERY_BY_KIND[kind];
|
|
20
|
-
const reportId = REPORT_ID_BY_KIND[kind];
|
|
21
|
-
const url = `https://dev.api.zeni.ai/version/accounting/komal/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryValue))}`;
|
|
22
|
-
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
23
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
24
|
-
const accountIds = response.data.accounts.map((account) => account.account_id);
|
|
25
|
-
const actions = [
|
|
26
|
-
(0, accountReducer_1.updateAccounts)(response.data.accounts, reportId),
|
|
27
|
-
(0, transactionsViewReducer_1.updateAccountsForTransferFlow)({ accountIds, kind }),
|
|
28
|
-
];
|
|
29
|
-
return (0, rxjs_1.of)(...actions);
|
|
30
|
-
}
|
|
31
|
-
return (0, rxjs_1.of)((0, transactionsViewReducer_1.updateAccountsForTransferFlowFailure)({ kind }));
|
|
32
|
-
}), (0, operators_1.catchError)(() => (0, rxjs_1.of)((0, transactionsViewReducer_1.updateAccountsForTransferFlowFailure)({ kind }))));
|
|
33
|
-
}));
|
|
34
|
-
exports.fetchTransferAccountsEpic = fetchTransferAccountsEpic;
|