@zeniai/client-epic-state 5.0.50-betaSS1 → 5.0.51-betaML1
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 +1 -0
- package/lib/entity/account/accountSelector.d.ts +5 -0
- package/lib/entity/account/accountSelector.js +8 -1
- 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 +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- package/lib/esm/entity/account/accountSelector.js +6 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +10 -0
- package/lib/esm/epic.js +3 -1
- package/lib/esm/index.js +6 -7
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -4
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +81 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -6
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +5 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +25 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +66 -71
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -2
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +1 -0
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +13 -2
- package/lib/index.d.ts +5 -6
- package/lib/index.js +44 -37
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- 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/searchTransactionsForManualMatchEpic.js +0 -4
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/createTransferEntryEpic.js +85 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -6
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +4 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransferAccountsEpic.js +29 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -8
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +16 -4
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +67 -72
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +3 -3
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +21 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +11 -25
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -0
- 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 +2 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +4 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +12 -1
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -9
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -2
- package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -13
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { NestedClassHierarchyForReport } from '../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
-
import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
3
|
+
import { FetchState, FetchStateAndError } from '../../commonStateTypes/common';
|
|
4
4
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
+
import { AccountBase } from '../../entity/account/accountState';
|
|
5
6
|
import { TransactionID } from '../../entity/transaction/stateTypes/transaction';
|
|
6
7
|
import { SupportedTransactionWithCOT } from '../../entity/transaction/transactionState';
|
|
7
8
|
import { Vendor } from '../../entity/vendor/vendorState';
|
|
@@ -17,6 +18,7 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
17
18
|
allVendors: Vendor[];
|
|
18
19
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
19
20
|
classList: ClassListSelectorView;
|
|
21
|
+
createTransferEntryStatus: FetchState;
|
|
20
22
|
deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
|
|
21
23
|
isAccountingClassesEnabled: boolean;
|
|
22
24
|
isAccountingProjectsEnabled: boolean;
|
|
@@ -24,6 +26,7 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
24
26
|
projectList: ProjectListSelectorView;
|
|
25
27
|
transactionDetailLocalData: TransactionDetailLocalData;
|
|
26
28
|
transactionDetailUpdateStatus: FetchStateAndError;
|
|
29
|
+
transferAccounts: AccountBase[];
|
|
27
30
|
isUpdateNotAllowed?: boolean;
|
|
28
31
|
transaction?: SupportedTransactionWithCOT;
|
|
29
32
|
}
|
|
@@ -7,6 +7,7 @@ exports.getInitialUpdatablePeriodsForTransactionRecommendations = exports.getTra
|
|
|
7
7
|
exports.getTransactionDetailForTransaction = getTransactionDetailForTransaction;
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
10
|
+
const accountSelector_1 = require("../../entity/account/accountSelector");
|
|
10
11
|
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
11
12
|
const transactionType_1 = require("../../entity/transaction/stateTypes/transactionType");
|
|
12
13
|
const transactionHelper_1 = require("../../entity/transaction/transactionHelper");
|
|
@@ -18,7 +19,7 @@ const classListSelector_1 = require("../classList/classListSelector");
|
|
|
18
19
|
const projectListSelector_1 = require("../projectList/projectListSelector");
|
|
19
20
|
const transactionDetailState_1 = require("./transactionDetailState");
|
|
20
21
|
const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
|
|
21
|
-
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
|
|
22
|
+
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, projectState, projectListState, } = state;
|
|
22
23
|
const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
23
24
|
const transactionDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, detailKey);
|
|
24
25
|
let fetchState = {
|
|
@@ -79,6 +80,14 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
79
80
|
: [];
|
|
80
81
|
const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
|
|
81
82
|
const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, vendorListState.vendorIds);
|
|
83
|
+
const transferAccountsFromApi = expenseAutomationTransactionsViewState.transferAccounts.accountIds
|
|
84
|
+
.map((id) => (0, accountSelector_1.getAccountBaseForTransferAccounts)(accountState, id))
|
|
85
|
+
.filter((account) => account != null);
|
|
86
|
+
const transferAccountsList = transferAccountsFromApi.length > 0
|
|
87
|
+
? transferAccountsFromApi
|
|
88
|
+
: accountsList.accounts
|
|
89
|
+
.map((a) => (0, accountSelector_1.getAccountBase)(accountState, a.accountId, 'account_list'))
|
|
90
|
+
.filter((account) => account != null);
|
|
82
91
|
return {
|
|
83
92
|
reportId: 'transaction_detail',
|
|
84
93
|
reportTitle: 'Transaction Detail',
|
|
@@ -95,6 +104,8 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
95
104
|
accountsHierarchyList,
|
|
96
105
|
classList: classList,
|
|
97
106
|
isAccountingClassesEnabled,
|
|
107
|
+
createTransferEntryStatus: expenseAutomationTransactionsViewState.createTransferEntryStatus,
|
|
108
|
+
transferAccounts: transferAccountsList,
|
|
98
109
|
isAccountingProjectsEnabled,
|
|
99
110
|
projectList,
|
|
100
111
|
isUpdateNotAllowed: transactionDetail?.isUpdateNotAllowed,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.51-betaML1",
|
|
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
|
"module": "lib/esm/index.js",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
|
|
2
|
-
/**
|
|
3
|
-
* Sub-tabs that can appear under any "Completed" tab in the Expense Automation
|
|
4
|
-
* surface (Transaction Categorization Completed and Missing Receipts Completed
|
|
5
|
-
* both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
|
|
6
|
-
* / `match_type`. `'all'` preserves parent-tab semantics on the backend.
|
|
7
|
-
*/
|
|
8
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
9
|
-
export const toCompletedSubTab = (v) => stringToUnion(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCompletedSubTab = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
-
/**
|
|
6
|
-
* Sub-tabs that can appear under any "Completed" tab in the Expense Automation
|
|
7
|
-
* surface (Transaction Categorization Completed and Missing Receipts Completed
|
|
8
|
-
* both use this exact union). Forwarded verbatim to listing APIs as `sub_tab`
|
|
9
|
-
* / `match_type`. `'all'` preserves parent-tab semantics on the backend.
|
|
10
|
-
*/
|
|
11
|
-
const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
|
|
12
|
-
const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
|
|
13
|
-
exports.toCompletedSubTab = toCompletedSubTab;
|