@zeniai/client-epic-state 5.0.81 → 5.0.82-betaAK1
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/amount.d.ts +2 -1
- package/lib/commonStateTypes/amount.js +5 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/commonStateTypes/workingDayHelper.d.ts +11 -0
- package/lib/commonStateTypes/workingDayHelper.js +31 -1
- package/lib/entity/account/accountSelector.d.ts +9 -0
- package/lib/entity/account/accountSelector.js +14 -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 +1 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +4 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +18 -10
- package/lib/entity/transaction/stateTypes/transaction.d.ts +3 -0
- package/lib/epic.d.ts +7 -1
- package/lib/epic.js +7 -1
- package/lib/esm/commonStateTypes/amount.js +3 -1
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/commonStateTypes/workingDayHelper.js +29 -0
- package/lib/esm/entity/account/accountSelector.js +11 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +18 -10
- package/lib/esm/epic.js +7 -1
- package/lib/esm/index.js +12 -6
- package/lib/esm/reducer.js +9 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryReducer.js +82 -0
- package/lib/esm/view/createTransferEntry/createTransferEntrySelector.js +64 -0
- package/lib/esm/view/createTransferEntry/createTransferEntryState.js +17 -0
- package/lib/esm/view/createTransferEntry/epics/createTransferEntryEpic.js +130 -0
- package/lib/esm/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +36 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +13 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +24 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +55 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +15 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +45 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +28 -0
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +27 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +37 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +49 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +179 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +5 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +28 -0
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +39 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +6 -1
- package/lib/index.d.ts +15 -6
- package/lib/index.js +62 -33
- package/lib/reducer.d.ts +9 -0
- package/lib/reducer.js +9 -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/createTransferEntry/createTransferEntryReducer.d.ts +32 -0
- package/lib/view/createTransferEntry/createTransferEntryReducer.js +86 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.d.ts +39 -0
- package/lib/view/createTransferEntry/createTransferEntrySelector.js +69 -0
- package/lib/view/createTransferEntry/createTransferEntryState.d.ts +30 -0
- package/lib/view/createTransferEntry/createTransferEntryState.js +20 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.d.ts +11 -0
- package/lib/view/createTransferEntry/epics/createTransferEntryEpic.js +134 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.d.ts +14 -0
- package/lib/view/createTransferEntry/epics/fetchTransferAccountsEpic.js +40 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +4 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +11 -2
- 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/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +52 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +29 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +21 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +59 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +16 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +19 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +44 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +51 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +16 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +32 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +14 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +31 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +32 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +42 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +15 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +53 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +41 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +184 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +71 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +8 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +16 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +32 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +10 -0
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +43 -0
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailPayload.d.ts +1 -1
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +6 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +6 -1
- package/package.json +34 -62
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
+
import { fetchCashManagementBanner, updateCashManagementBanner, updateCashManagementBannerFetchStatus } from '../cashManagementOverviewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchCashManagementBanner> | ReturnType<typeof updateCashManagementBanner> | ReturnType<typeof updateCashManagementBannerFetchStatus>;
|
|
7
|
+
/**
|
|
8
|
+
* Hits the cash agent's recommend endpoint and stores the full response on
|
|
9
|
+
* the banner state — `inflows[]`, `outflows[]`, and `money_movements[]` all
|
|
10
|
+
* live there, so consumers can read them directly without an entity-bucket
|
|
11
|
+
* lookup.
|
|
12
|
+
*
|
|
13
|
+
* TODO: switch the endpoint to a base URL constant once the prod endpoint
|
|
14
|
+
* lands; right now this hits the dev environment directly.
|
|
15
|
+
*/
|
|
16
|
+
export declare const fetchCashManagementBannerEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCashManagementBannerEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const cashManagementOverviewReducer_1 = require("../cashManagementOverviewReducer");
|
|
8
|
+
/**
|
|
9
|
+
* Hits the cash agent's recommend endpoint and stores the full response on
|
|
10
|
+
* the banner state — `inflows[]`, `outflows[]`, and `money_movements[]` all
|
|
11
|
+
* live there, so consumers can read them directly without an entity-bucket
|
|
12
|
+
* lookup.
|
|
13
|
+
*
|
|
14
|
+
* TODO: switch the endpoint to a base URL constant once the prod endpoint
|
|
15
|
+
* lands; right now this hits the dev environment directly.
|
|
16
|
+
*/
|
|
17
|
+
const fetchCashManagementBannerEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(cashManagementOverviewReducer_1.fetchCashManagementBanner.match), (0, operators_1.switchMap)(() => zeniAPI
|
|
18
|
+
.getJSON(`https://dev.api.zeni.ai/cash-management-agent/1.0/cash-agent/recommend?horizon_days=30`)
|
|
19
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
21
|
+
return (0, rxjs_1.of)((0, cashManagementOverviewReducer_1.updateCashManagementBanner)({ data: response.data }));
|
|
22
|
+
}
|
|
23
|
+
return (0, rxjs_1.of)((0, cashManagementOverviewReducer_1.updateCashManagementBannerFetchStatus)({
|
|
24
|
+
fetchState: 'Error',
|
|
25
|
+
error: response.status,
|
|
26
|
+
}));
|
|
27
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cashManagementOverviewReducer_1.updateCashManagementBannerFetchStatus)({
|
|
28
|
+
fetchState: 'Error',
|
|
29
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch cash management banner REST API call errored out' +
|
|
30
|
+
JSON.stringify(error)),
|
|
31
|
+
}))))));
|
|
32
|
+
exports.fetchCashManagementBannerEpic = fetchCashManagementBannerEpic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { fetchAutoTransferRules } from '../../../autotransferRules/autoTransferRulesReducer';
|
|
5
|
+
import { fetchCashManagementSettings } from '../../autoSweepFlow/autoSweepFlowReducer';
|
|
6
|
+
import { fetchTreasuryOverviewDetail } from '../../../treasury/treasuryList/treasuryDetailReducer';
|
|
7
|
+
import { fetchZeniAccountList } from '../../../zeniAccounts/zeniAccountList/zeniAccountListReducer';
|
|
8
|
+
import { fetchCashManagementBanner, fetchCashManagementOverviewPage } from '../cashManagementOverviewReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchCashManagementOverviewPage> | ReturnType<typeof fetchTreasuryOverviewDetail> | ReturnType<typeof fetchZeniAccountList> | ReturnType<typeof fetchCashManagementBanner> | ReturnType<typeof fetchCashManagementSettings> | ReturnType<typeof fetchAutoTransferRules>;
|
|
10
|
+
export declare const fetchCashManagementOverviewPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCashManagementOverviewPageEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const autoTransferRulesReducer_1 = require("../../../autotransferRules/autoTransferRulesReducer");
|
|
7
|
+
const autoSweepFlowReducer_1 = require("../../autoSweepFlow/autoSweepFlowReducer");
|
|
8
|
+
const treasuryDetailReducer_1 = require("../../../treasury/treasuryList/treasuryDetailReducer");
|
|
9
|
+
const zeniAccountListReducer_1 = require("../../../zeniAccounts/zeniAccountList/zeniAccountListReducer");
|
|
10
|
+
const cashManagementOverviewReducer_1 = require("../cashManagementOverviewReducer");
|
|
11
|
+
const fetchCashManagementOverviewPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(cashManagementOverviewReducer_1.fetchCashManagementOverviewPage.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
+
const { cacheOverride } = action.payload;
|
|
13
|
+
const state = state$.value;
|
|
14
|
+
const pageActions = [];
|
|
15
|
+
if (cacheOverride === true) {
|
|
16
|
+
pageActions.push((0, treasuryDetailReducer_1.fetchTreasuryOverviewDetail)(true), (0, zeniAccountListReducer_1.fetchZeniAccountList)(true), (0, cashManagementOverviewReducer_1.fetchCashManagementBanner)(), (0, autoSweepFlowReducer_1.fetchCashManagementSettings)(), (0, autoTransferRulesReducer_1.fetchAutoTransferRules)(true));
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const treasuryDetailState = state.treasuryDetailState;
|
|
20
|
+
if (treasuryDetailState.hasValidState() === false &&
|
|
21
|
+
treasuryDetailState.fetchState !== 'In-Progress') {
|
|
22
|
+
pageActions.push((0, treasuryDetailReducer_1.fetchTreasuryOverviewDetail)(false));
|
|
23
|
+
}
|
|
24
|
+
pageActions.push((0, zeniAccountListReducer_1.fetchZeniAccountList)(false));
|
|
25
|
+
const banner = state.cashManagementOverviewState.banner;
|
|
26
|
+
if (banner.fetchState !== 'Completed' &&
|
|
27
|
+
banner.fetchState !== 'In-Progress') {
|
|
28
|
+
pageActions.push((0, cashManagementOverviewReducer_1.fetchCashManagementBanner)());
|
|
29
|
+
}
|
|
30
|
+
const autoSweep = state.autoSweepFlowState;
|
|
31
|
+
if (autoSweep.fetchState !== 'Completed' &&
|
|
32
|
+
autoSweep.fetchState !== 'In-Progress') {
|
|
33
|
+
pageActions.push((0, autoSweepFlowReducer_1.fetchCashManagementSettings)());
|
|
34
|
+
}
|
|
35
|
+
const autoTransferRules = state.autotransferRulesState;
|
|
36
|
+
if (autoTransferRules.fetchState !== 'Completed' &&
|
|
37
|
+
autoTransferRules.fetchState !== 'In-Progress') {
|
|
38
|
+
pageActions.push((0, autoTransferRulesReducer_1.fetchAutoTransferRules)(false));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return (0, rxjs_1.concat)((0, rxjs_1.from)(pageActions));
|
|
42
|
+
}));
|
|
43
|
+
exports.fetchCashManagementOverviewPageEpic = fetchCashManagementOverviewPageEpic;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation";
|
|
7
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
|
@@ -3,7 +3,7 @@ import { TransactionPayload } from '../../entity/transaction/payloadTypes/transa
|
|
|
3
3
|
import { SupportedTransactionPayload } from '../../entity/transaction/transactionState';
|
|
4
4
|
import { VendorPayload } from '../../entity/vendor/vendorPayload';
|
|
5
5
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
6
|
-
interface TransactionDetailPayload {
|
|
6
|
+
export interface TransactionDetailPayload {
|
|
7
7
|
query: {
|
|
8
8
|
transaction_id: string;
|
|
9
9
|
transaction_type: string;
|
|
@@ -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,9 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
17
18
|
allVendors: Vendor[];
|
|
18
19
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
19
20
|
classList: ClassListSelectorView;
|
|
21
|
+
createTransferEntryStatus: FetchState;
|
|
22
|
+
/** Resolved credit-card pool for credit_card_payment transfer drawer. */
|
|
23
|
+
creditCardTransferAccountsList: AccountBase[];
|
|
20
24
|
deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
|
|
21
25
|
hasInFlightCategoryClassRecommendations: boolean;
|
|
22
26
|
isAccountingClassesEnabled: boolean;
|
|
@@ -25,6 +29,7 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
25
29
|
projectList: ProjectListSelectorView;
|
|
26
30
|
transactionDetailLocalData: TransactionDetailLocalData;
|
|
27
31
|
transactionDetailUpdateStatus: FetchStateAndError;
|
|
32
|
+
transferAccounts: AccountBase[];
|
|
28
33
|
isUpdateNotAllowed?: boolean;
|
|
29
34
|
transaction?: SupportedTransactionWithCOT;
|
|
30
35
|
}
|
|
@@ -15,6 +15,7 @@ const vendorSelector_1 = require("../../entity/vendor/vendorSelector");
|
|
|
15
15
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
16
16
|
const accountListSelector_1 = require("../accountList/accountListSelector");
|
|
17
17
|
const classListSelector_1 = require("../classList/classListSelector");
|
|
18
|
+
const createTransferEntrySelector_1 = require("../createTransferEntry/createTransferEntrySelector");
|
|
18
19
|
const projectListSelector_1 = require("../projectList/projectListSelector");
|
|
19
20
|
const transactionDetailState_1 = require("./transactionDetailState");
|
|
20
21
|
// "Any line on this transaction is fetching category/class recommendations?"
|
|
@@ -39,7 +40,7 @@ const getDetailInFlightRecommendations = (state, transactionId) => {
|
|
|
39
40
|
};
|
|
40
41
|
exports.getDetailInFlightRecommendations = getDetailInFlightRecommendations;
|
|
41
42
|
const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
|
|
42
|
-
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
|
|
43
|
+
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, createTransferEntryState, projectState, projectListState, } = state;
|
|
43
44
|
const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
44
45
|
const transactionDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, detailKey);
|
|
45
46
|
let fetchState = {
|
|
@@ -106,6 +107,7 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
106
107
|
: [];
|
|
107
108
|
const transactionDetailAnyUpdateStatus = reduceUpdateFetchStates(transactionDetail);
|
|
108
109
|
const vendors = (0, vendorSelector_1.getVendorsByVendorIds)(vendorState, vendorListState.vendorIds);
|
|
110
|
+
const { transferAccountsList, creditCardTransferAccountsList } = (0, createTransferEntrySelector_1.getResolvedTransferAccounts)(state);
|
|
109
111
|
const hasInFlightCategoryClassRecommendations = (0, exports.getDetailInFlightRecommendations)(state, transactionId);
|
|
110
112
|
return {
|
|
111
113
|
reportId: 'transaction_detail',
|
|
@@ -124,6 +126,9 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
124
126
|
classList: classList,
|
|
125
127
|
hasInFlightCategoryClassRecommendations,
|
|
126
128
|
isAccountingClassesEnabled,
|
|
129
|
+
createTransferEntryStatus: createTransferEntryState.createTransferEntryStatus,
|
|
130
|
+
creditCardTransferAccountsList,
|
|
131
|
+
transferAccounts: transferAccountsList,
|
|
127
132
|
isAccountingProjectsEnabled,
|
|
128
133
|
projectList,
|
|
129
134
|
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.82-betaAK1",
|
|
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",
|
|
@@ -33,39 +33,6 @@
|
|
|
33
33
|
"require": "./lib/view/*.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"clean": "rimraf lib",
|
|
38
|
-
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
39
|
-
"test:typecheck-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh master tsconfig.typecheck.json",
|
|
40
|
-
"test": "pnpm lint-modified-files && pnpm test:typecheck-modified-files && vitest run --typecheck",
|
|
41
|
-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
|
|
42
|
-
"lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
|
|
43
|
-
"lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
|
|
44
|
-
"tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
|
|
45
|
-
"typecheck": "tsc --noEmit",
|
|
46
|
-
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
47
|
-
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
48
|
-
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
49
|
-
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck (incl. lint-modified-files)...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
50
|
-
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
51
|
-
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
52
|
-
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
53
|
-
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
54
|
-
"check-version": "node ./scripts/check_version.js",
|
|
55
|
-
"prepublishOnly": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm run check-version && pnpm clean && pnpm build",
|
|
56
|
-
"version": "git add -A src",
|
|
57
|
-
"postversion": "git push && git push --tags",
|
|
58
|
-
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
59
|
-
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
60
|
-
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
61
|
-
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
62
|
-
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
63
|
-
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
64
|
-
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
65
|
-
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
66
|
-
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
67
|
-
"test:file": "scripts/test-file.sh"
|
|
68
|
-
},
|
|
69
36
|
"files": [
|
|
70
37
|
"lib/**/*"
|
|
71
38
|
],
|
|
@@ -136,32 +103,37 @@
|
|
|
136
103
|
"dayjs": "^1.10.7",
|
|
137
104
|
"url-parse": "^1.5.10"
|
|
138
105
|
},
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
106
|
+
"scripts": {
|
|
107
|
+
"clean": "rimraf lib",
|
|
108
|
+
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
109
|
+
"test:typecheck-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh master tsconfig.typecheck.json",
|
|
110
|
+
"test": "pnpm lint-modified-files && pnpm test:typecheck-modified-files && vitest run --typecheck",
|
|
111
|
+
"test:full": "vitest run --typecheck",
|
|
112
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
|
|
113
|
+
"lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
|
|
114
|
+
"lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
|
|
115
|
+
"tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
|
|
116
|
+
"typecheck": "tsc --noEmit",
|
|
117
|
+
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
118
|
+
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
119
|
+
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
120
|
+
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck (incl. lint-modified-files)...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
121
|
+
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
122
|
+
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
123
|
+
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
124
|
+
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
125
|
+
"check-version": "node ./scripts/check_version.js",
|
|
126
|
+
"version": "git add -A src",
|
|
127
|
+
"postversion": "git push && git push --tags",
|
|
128
|
+
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
129
|
+
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
130
|
+
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
131
|
+
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
132
|
+
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
133
|
+
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
134
|
+
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
135
|
+
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
136
|
+
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
137
|
+
"test:file": "scripts/test-file.sh"
|
|
166
138
|
}
|
|
167
|
-
}
|
|
139
|
+
}
|