@zeniai/client-epic-state 5.1.50 → 5.1.51-beta0RR
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 +0 -1
- package/lib/commonStateTypes/amount.js +1 -9
- package/lib/commonStateTypes/workingDayHelper.d.ts +3 -4
- package/lib/commonStateTypes/workingDayHelper.js +3 -4
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -3
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/epic.d.ts +1 -7
- package/lib/epic.js +1 -7
- package/lib/esm/commonStateTypes/amount.js +0 -7
- package/lib/esm/commonStateTypes/workingDayHelper.js +3 -4
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -4
- package/lib/esm/epic.js +1 -7
- package/lib/esm/index.js +0 -5
- package/lib/esm/reducer.js +0 -6
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +2 -22
- package/lib/esm/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +87 -39
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +26 -67
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +4 -1
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +2 -1
- package/lib/index.d.ts +1 -10
- package/lib/index.js +1 -20
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +1 -8
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +1 -21
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +0 -22
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +86 -38
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +25 -66
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +4 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +2 -1
- package/lib/view/transactionDetail/transactionDetailReducer.js +2 -1
- package/lib/zeniAPI.d.ts +0 -1
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -29
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -78
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -49
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -47
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -54
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -92
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -212
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -10
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -23
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -36
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -27
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -28
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +0 -47
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -34
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +0 -23
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -82
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +0 -40
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +0 -37
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +0 -14
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +0 -56
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -60
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +0 -22
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -96
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +0 -59
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -217
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +0 -122
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -13
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -27
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +0 -9
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -40
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -31
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.d.ts +0 -15
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -32
package/lib/reducer.d.ts
CHANGED
|
@@ -157,8 +157,6 @@ import { InternationalWireVerificationState } from './view/spendManagement/billP
|
|
|
157
157
|
import { MagicLinkViewState } from './view/spendManagement/billPay/magicLinkView/magicLinkViewState';
|
|
158
158
|
import { PreviousBillsState } from './view/spendManagement/billPay/previousBills/previousBillsState';
|
|
159
159
|
import { WiseRedirectState } from './view/spendManagement/billPay/wiseRedirectView/wiseRedirectState';
|
|
160
|
-
import { AutoSweepFlowState } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
161
|
-
import { CashManagementOverviewState } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState';
|
|
162
160
|
import { CardPolicyDetailState } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState';
|
|
163
161
|
import { CardPolicyListState } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState';
|
|
164
162
|
import { CreateCardPolicyState } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState';
|
|
@@ -312,7 +310,6 @@ type ViewsState = {
|
|
|
312
310
|
arAgingState: ArAgingState;
|
|
313
311
|
auditReportViewState: AuditReportViewState;
|
|
314
312
|
authenticationViewState: AuthenticationViewState;
|
|
315
|
-
autoSweepFlowState: AutoSweepFlowState;
|
|
316
313
|
autotransferRulesState: AutoTransferRulesState;
|
|
317
314
|
balanceSheetState: BalanceSheetState;
|
|
318
315
|
bankAccountViewState: BankAccountViewState;
|
|
@@ -334,7 +331,6 @@ type ViewsState = {
|
|
|
334
331
|
cashBalanceState: CashBalanceState;
|
|
335
332
|
cashFlowState: CashFlowState;
|
|
336
333
|
cashInCashOutState: CashInCashOutState;
|
|
337
|
-
cashManagementOverviewState: CashManagementOverviewState;
|
|
338
334
|
cashPositionState: CashPositionState;
|
|
339
335
|
chargeCardConfigState: ChargeCardConfigState;
|
|
340
336
|
chargeCardDetailState: ChargeCardDetailState;
|
|
@@ -480,7 +476,6 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
480
476
|
arAgingState: ArAgingState;
|
|
481
477
|
auditReportViewState: AuditReportViewState;
|
|
482
478
|
authenticationViewState: AuthenticationViewState;
|
|
483
|
-
autoSweepFlowState: AutoSweepFlowState;
|
|
484
479
|
autotransferRulesState: AutoTransferRulesState;
|
|
485
480
|
balanceSheetState: BalanceSheetState;
|
|
486
481
|
bankAccountViewState: BankAccountViewState;
|
|
@@ -500,7 +495,6 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
500
495
|
cashBalanceState: CashBalanceState;
|
|
501
496
|
cashFlowState: CashFlowState;
|
|
502
497
|
cashInCashOutState: CashInCashOutState;
|
|
503
|
-
cashManagementOverviewState: CashManagementOverviewState;
|
|
504
498
|
cashPositionState: CashPositionState;
|
|
505
499
|
chargeCardConfigState: ChargeCardConfigState;
|
|
506
500
|
chargeCardDetailState: ChargeCardDetailState;
|
package/lib/reducer.js
CHANGED
|
@@ -198,8 +198,6 @@ const internationalWireVerificationReducer_1 = __importStar(require("./view/spen
|
|
|
198
198
|
const magicLinkViewReducer_1 = __importStar(require("./view/spendManagement/billPay/magicLinkView/magicLinkViewReducer"));
|
|
199
199
|
const previousBillsReducer_1 = __importStar(require("./view/spendManagement/billPay/previousBills/previousBillsReducer"));
|
|
200
200
|
const wiseRedirectReducer_1 = __importStar(require("./view/spendManagement/billPay/wiseRedirectView/wiseRedirectReducer"));
|
|
201
|
-
const autoSweepFlowReducer_1 = __importStar(require("./view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer"));
|
|
202
|
-
const cashManagementOverviewReducer_1 = __importStar(require("./view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer"));
|
|
203
201
|
const cardPolicyDetailReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer"));
|
|
204
202
|
const cardPolicyListReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer"));
|
|
205
203
|
const createCardPolicyReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer"));
|
|
@@ -355,7 +353,6 @@ const initialViewsState = {
|
|
|
355
353
|
arAgingState: arAgingReducer_1.initialState,
|
|
356
354
|
auditReportViewState: auditReportViewReducer_1.initialState,
|
|
357
355
|
authenticationViewState: authenticationViewReducer_1.initialState,
|
|
358
|
-
autoSweepFlowState: autoSweepFlowReducer_1.initialState,
|
|
359
356
|
autotransferRulesState: autoTransferRulesReducer_1.initialState,
|
|
360
357
|
balanceSheetState: balanceSheetReducer_1.initialState,
|
|
361
358
|
bankAccountViewState: bankAccountViewReducer_1.initialState,
|
|
@@ -376,7 +373,6 @@ const initialViewsState = {
|
|
|
376
373
|
cashBalanceState: cashBalanceReducer_1.initialState,
|
|
377
374
|
cashFlowState: cashFlowReducer_1.initialState,
|
|
378
375
|
cashInCashOutState: cashInCashOutReducer_1.initialState,
|
|
379
|
-
cashManagementOverviewState: cashManagementOverviewReducer_1.initialState,
|
|
380
376
|
cashPositionState: cashPositionReducer_1.initialState,
|
|
381
377
|
chargeCardConfigState: chargeCardConfigReducer_1.initialState,
|
|
382
378
|
chargeCardDetailState: chargeCardDetailReducer_1.initialState,
|
|
@@ -598,7 +594,6 @@ const viewReducers = {
|
|
|
598
594
|
arAgingState: arAgingReducer_1.default,
|
|
599
595
|
auditReportViewState: auditReportViewReducer_1.default,
|
|
600
596
|
authenticationViewState: authenticationViewReducer_1.default,
|
|
601
|
-
autoSweepFlowState: autoSweepFlowReducer_1.default,
|
|
602
597
|
autotransferRulesState: autoTransferRulesReducer_1.default,
|
|
603
598
|
balanceSheetState: balanceSheetReducer_1.default,
|
|
604
599
|
bankAccountViewState: bankAccountViewReducer_1.default,
|
|
@@ -618,7 +613,6 @@ const viewReducers = {
|
|
|
618
613
|
cashBalanceState: cashBalanceReducer_1.default,
|
|
619
614
|
cashFlowState: cashFlowReducer_1.default,
|
|
620
615
|
cashInCashOutState: cashInCashOutReducer_1.default,
|
|
621
|
-
cashManagementOverviewState: cashManagementOverviewReducer_1.default,
|
|
622
616
|
cashPositionState: cashPositionReducer_1.default,
|
|
623
617
|
chargeCardConfigState: chargeCardConfigReducer_1.default,
|
|
624
618
|
chargeCardDetailState: chargeCardDetailReducer_1.default,
|
|
@@ -6,7 +6,7 @@ import { FundingAccount } from '../commonSetup/setupViewSelector';
|
|
|
6
6
|
import { TreasuryAccount } from '../treasury/treasuryTransferMoney/treasuryTransferMoneyState';
|
|
7
7
|
import { ReviewTransferDetail } from '../zeniAccounts/transferDetail/transferDetailState';
|
|
8
8
|
import { AutoTransferRuleLocalData } from './autoTransferRulesPayload';
|
|
9
|
-
import { AutoTransferRule
|
|
9
|
+
import { AutoTransferRule } from './autoTransferRulesState';
|
|
10
10
|
export interface AutoTransferRulesSelectorView extends SelectorView {
|
|
11
11
|
autoTransferReviewDetail: ReviewTransferDetail;
|
|
12
12
|
createRuleFetchState: FetchStateAndError;
|
|
@@ -17,13 +17,6 @@ export interface AutoTransferRulesSelectorView extends SelectorView {
|
|
|
17
17
|
transferMoneyParties: FundingAccount[];
|
|
18
18
|
transferMoneyPartiesFetchState: FetchState;
|
|
19
19
|
treasuryAccount: TreasuryAccount;
|
|
20
|
-
/**
|
|
21
|
-
* The user's saved auto-sweep cash-management config, surfaced here so the
|
|
22
|
-
* rules list page can render it alongside the auto-transfer rules.
|
|
23
|
-
* `undefined` when the user hasn't saved auto-sweep settings yet
|
|
24
|
-
* (i.e. `autoSweepFlowState.settingsId == null`).
|
|
25
|
-
*/
|
|
26
|
-
cashManagementRule?: CashManagementRule;
|
|
27
20
|
ruleHistory?: Record<string, CommonHistoryView>;
|
|
28
21
|
}
|
|
29
22
|
export declare const getAutoTransferRules: (state: RootState) => AutoTransferRulesSelectorView;
|
|
@@ -6,30 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
9
|
-
const depositAccountSelector_1 = require("../../../entity/depositAccount/depositAccountSelector");
|
|
10
9
|
const setupViewSelector_1 = require("../commonSetup/setupViewSelector");
|
|
11
10
|
const depositAccountListSelector_1 = require("../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
12
11
|
const paymentAccountListSelector_1 = require("../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
13
|
-
const buildCashManagementRule = (autoSweepFlowState, depositAccountState, treasuryDetailState) => {
|
|
14
|
-
const { settingsId, bufferAmount, frequency, memo, primaryFundingAccountId, nextTransferDate, } = autoSweepFlowState;
|
|
15
|
-
if (settingsId == null || primaryFundingAccountId == null) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
const depositAccount = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, primaryFundingAccountId);
|
|
19
|
-
return {
|
|
20
|
-
bufferAmount,
|
|
21
|
-
frequency,
|
|
22
|
-
memo,
|
|
23
|
-
settingsId,
|
|
24
|
-
primaryFundingAccount: depositAccount != null
|
|
25
|
-
? (0, setupViewSelector_1.mapDepositAccToFundingAccount)(depositAccount)
|
|
26
|
-
: undefined,
|
|
27
|
-
treasurySummary: treasuryDetailState.accountSummary,
|
|
28
|
-
nextTransferDate,
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
12
|
const getAutoTransferRules = (state) => {
|
|
32
|
-
const { autotransferRulesState,
|
|
13
|
+
const { autotransferRulesState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, treasuryDetailState, } = state;
|
|
33
14
|
const { rules, error, historyByRuleId, ruleUpdateLocalData, ruleUpdateStatusById, ruleDeleteStatusById, createRuleFetchState, autoTransferReviewDetail, } = autotransferRulesState;
|
|
34
15
|
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
35
16
|
const paymentAccountsView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
@@ -64,7 +45,6 @@ const getAutoTransferRules = (state) => {
|
|
|
64
45
|
transferMoneyParties,
|
|
65
46
|
transferMoneyPartiesFetchState,
|
|
66
47
|
createRuleFetchState,
|
|
67
|
-
cashManagementRule: buildCashManagementRule(autoSweepFlowState, depositAccountState, treasuryDetailState),
|
|
68
48
|
fetchState,
|
|
69
49
|
error,
|
|
70
50
|
version: 0,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
|
-
import { AutoSweepFrequency } from '../cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
5
3
|
import { CommonHistoryView } from '../commonHistoryView/commonHistory';
|
|
6
|
-
import { FundingAccount } from '../commonSetup/setupViewSelector';
|
|
7
|
-
import { TreasurySummaryWithBalance } from '../treasury/treasuryList/treasuryDetailState';
|
|
8
4
|
import { ReviewTransferDetail } from '../zeniAccounts/transferDetail/transferDetailState';
|
|
9
5
|
import { AutoTransferRuleFrequency, AutoTransferRuleLocalData, AutoTransferRuleType } from './autoTransferRulesPayload';
|
|
10
6
|
export interface AutoTransferRule {
|
|
@@ -31,24 +27,6 @@ export interface DestinationBankAccountMetadata {
|
|
|
31
27
|
accountType: string;
|
|
32
28
|
percentage: number;
|
|
33
29
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Render-ready view of the user's auto-sweep cash-management config,
|
|
36
|
-
* surfaced alongside `AutoTransferRule[]` in `AutoTransferRulesSelectorView`.
|
|
37
|
-
* Kept as a distinct shape (not folded into `AutoTransferRule`) so the rules
|
|
38
|
-
* list can special-case its rendering without polluting the rule type union.
|
|
39
|
-
*
|
|
40
|
-
* Present only when `autoSweepFlowState.settingsId` is set — i.e. the user
|
|
41
|
-
* has saved their auto-sweep settings at least once.
|
|
42
|
-
*/
|
|
43
|
-
export interface CashManagementRule {
|
|
44
|
-
bufferAmount: Amount;
|
|
45
|
-
frequency: AutoSweepFrequency;
|
|
46
|
-
memo: string;
|
|
47
|
-
settingsId: ID;
|
|
48
|
-
nextTransferDate?: ZeniDate;
|
|
49
|
-
primaryFundingAccount?: FundingAccount;
|
|
50
|
-
treasurySummary?: TreasurySummaryWithBalance;
|
|
51
|
-
}
|
|
52
30
|
export interface AutoTransferRulesState extends FetchedState {
|
|
53
31
|
autoTransferReviewDetail: ReviewTransferDetail;
|
|
54
32
|
createRuleFetchState: FetchStateAndError;
|
|
@@ -7,11 +7,97 @@ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
|
7
7
|
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
9
9
|
const transactionReducer_1 = require("../../../entity/transaction/transactionReducer");
|
|
10
|
+
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
10
11
|
const responsePayload_1 = require("../../../responsePayload");
|
|
11
12
|
const transactionsViewReducer_1 = require("../../expenseAutomationView/reducers/transactionsViewReducer");
|
|
12
13
|
const transactionDetailReducer_1 = require("../transactionDetailReducer");
|
|
13
14
|
const transactionDetailState_1 = require("../transactionDetailState");
|
|
14
15
|
const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.markTransactionAsNotMiscategorized.match), (0, operators_1.mergeMap)((action) => {
|
|
16
|
+
if (action.payload.isExpenseAutomationEnabled === true) {
|
|
17
|
+
const transactionKey = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
18
|
+
const transaction = (0, transactionSelector_1.getSupportedTransactionById)(state$.value.transactionState, transactionKey);
|
|
19
|
+
const lineIds = (action.payload.lineIds?.length ?? 0) > 0
|
|
20
|
+
? action.payload.lineIds
|
|
21
|
+
: (transaction?.lines ?? []).map((line) => line.id);
|
|
22
|
+
return zeniAPI
|
|
23
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/mark-as-reviewed`, {
|
|
24
|
+
transactions_reviewed: [
|
|
25
|
+
{
|
|
26
|
+
transaction_id: action.payload.transactionId.id,
|
|
27
|
+
line_ids: lineIds,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
})
|
|
31
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
32
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
33
|
+
const actions = [];
|
|
34
|
+
actions.push((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Completed', undefined));
|
|
35
|
+
const txnId = action.payload.transactionId.id;
|
|
36
|
+
const reviewedFailed = response.data?.transactions_reviewed_failed ?? [];
|
|
37
|
+
const isTransactionFailed = reviewedFailed.some((t) => t.transaction_id === txnId);
|
|
38
|
+
if (!isTransactionFailed) {
|
|
39
|
+
actions.push((0, transactionReducer_1.updateTransactionIsMiscategorized)(transactionKey, false));
|
|
40
|
+
const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
41
|
+
const { transactionCategorizationView, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
42
|
+
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
43
|
+
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
44
|
+
const selectedPeriod = selectedPeriodByTenantId[currentTenant?.tenantId ?? ''];
|
|
45
|
+
const autoTabLineItems = transactionCategorizationView.autoCategorized
|
|
46
|
+
.transactionReviewLocalDataById[txnId]
|
|
47
|
+
?.transactionReviewLocalData.tabSpecificLineItems
|
|
48
|
+
?.autoCategorized ?? [];
|
|
49
|
+
const hasAutoLines = autoTabLineItems.length > 0;
|
|
50
|
+
const { uiState } = transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
51
|
+
const removeIdsFromPeriod = selectedTransactionCategorizationTab === 'review'
|
|
52
|
+
? [txnId]
|
|
53
|
+
: hasAutoLines
|
|
54
|
+
? []
|
|
55
|
+
: [txnId];
|
|
56
|
+
if (selectedPeriod != null) {
|
|
57
|
+
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(selectedTransactionCategorizationTab, [txnId], removeIdsFromPeriod, selectedPeriod, 'Completed'));
|
|
58
|
+
}
|
|
59
|
+
if (!hasAutoLines) {
|
|
60
|
+
actions.push((0, transactionReducer_1.removeTransactionCategorization)({
|
|
61
|
+
transactionIds: [txnId],
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
if (removeIdsFromPeriod.length > 0 &&
|
|
65
|
+
selectedPeriod != null) {
|
|
66
|
+
const totalCountByPeriod = uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
67
|
+
const safeTotalCount = totalCountByPeriod ?? 0;
|
|
68
|
+
const updatedTotalCount = Math.max(0, safeTotalCount - 1);
|
|
69
|
+
actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
70
|
+
selectedPeriod,
|
|
71
|
+
selectedTab: selectedTransactionCategorizationTab,
|
|
72
|
+
totalCount: updatedTotalCount,
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
77
|
+
transactionId: action.payload.transactionId,
|
|
78
|
+
fetchState: 'Completed',
|
|
79
|
+
}));
|
|
80
|
+
if (action.payload.transactionSaveUpdates.anyBulkUpdates === true) {
|
|
81
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
82
|
+
messageSection: 'transactionDetails_updatingPastTransactions',
|
|
83
|
+
messageText: 'success',
|
|
84
|
+
type: 'success',
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
89
|
+
messageSection: 'transactionDetails_transactionUpdated',
|
|
90
|
+
messageText: 'success',
|
|
91
|
+
type: 'success',
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return (0, rxjs_1.from)(actions);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
return (0, rxjs_1.of)((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Error', response.status));
|
|
98
|
+
}
|
|
99
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Transaction mark as reviewed REST API call errored out ${error}`)))));
|
|
100
|
+
}
|
|
15
101
|
return zeniAPI
|
|
16
102
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${action.payload.transactionId.id}/mark-miscategorized-as-correct`, preparePayload(action.payload.transactionId))
|
|
17
103
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -19,44 +105,7 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
19
105
|
const actions = [];
|
|
20
106
|
actions.push((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Completed', undefined));
|
|
21
107
|
const transactionKey = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
22
|
-
// Mark this transaction as not miscategorized anymore
|
|
23
108
|
actions.push((0, transactionReducer_1.updateTransactionIsMiscategorized)(transactionKey, false));
|
|
24
|
-
if (action.payload.isExpenseAutomationEnabled === true) {
|
|
25
|
-
const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
26
|
-
const { transactionCategorizationView, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
27
|
-
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
28
|
-
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
29
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
30
|
-
const txnId = action.payload.transactionId.id;
|
|
31
|
-
const autoTabLineItems = transactionCategorizationView.autoCategorized
|
|
32
|
-
.transactionReviewLocalDataById[txnId]
|
|
33
|
-
?.transactionReviewLocalData.tabSpecificLineItems
|
|
34
|
-
.autoCategorized ?? [];
|
|
35
|
-
const hasAutoLines = autoTabLineItems.length > 0;
|
|
36
|
-
const { uiState } = transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
37
|
-
const removeIdsFromPeriod = selectedTransactionCategorizationTab === 'review'
|
|
38
|
-
? [txnId]
|
|
39
|
-
: hasAutoLines
|
|
40
|
-
? []
|
|
41
|
-
: [txnId];
|
|
42
|
-
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(selectedTransactionCategorizationTab, [txnId], removeIdsFromPeriod, selectedPeriod, 'Completed'));
|
|
43
|
-
if (!hasAutoLines) {
|
|
44
|
-
actions.push((0, transactionReducer_1.removeTransactionCategorization)({
|
|
45
|
-
transactionIds: [txnId],
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
if (removeIdsFromPeriod.length > 0) {
|
|
49
|
-
const totalCountByPeriod = uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
50
|
-
const updatedTotalCount = totalCountByPeriod === 0
|
|
51
|
-
? totalCountByPeriod
|
|
52
|
-
: totalCountByPeriod - 1;
|
|
53
|
-
actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
54
|
-
selectedPeriod,
|
|
55
|
-
selectedTab: selectedTransactionCategorizationTab,
|
|
56
|
-
totalCount: updatedTotalCount,
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
109
|
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
61
110
|
transactionId: action.payload.transactionId,
|
|
62
111
|
fetchState: 'Completed',
|
|
@@ -69,7 +118,6 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
69
118
|
}));
|
|
70
119
|
}
|
|
71
120
|
else {
|
|
72
|
-
//Finally everything done for this transaction
|
|
73
121
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
74
122
|
messageSection: 'transactionDetails_transactionUpdated',
|
|
75
123
|
messageText: 'success',
|
|
@@ -9,6 +9,7 @@ const rxjs_1 = require("rxjs");
|
|
|
9
9
|
const operators_1 = require("rxjs/operators");
|
|
10
10
|
const recommendationPayload_1 = require("../../../commonPayloadTypes/recommendationPayload");
|
|
11
11
|
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
12
|
+
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
12
13
|
const customerTransactionPayload_1 = require("../../../entity/transaction/payloadTypes/customerTransactionPayload");
|
|
13
14
|
const otherTransactionPayload_1 = require("../../../entity/transaction/payloadTypes/otherTransactionPayload");
|
|
14
15
|
const transactionIDPayload_1 = require("../../../entity/transaction/payloadTypes/transactionIDPayload");
|
|
@@ -16,7 +17,6 @@ const transactionPayload_1 = require("../../../entity/transaction/payloadTypes/t
|
|
|
16
17
|
const vendorTransactionPayload_1 = require("../../../entity/transaction/payloadTypes/vendorTransactionPayload");
|
|
17
18
|
const customerTransaction_1 = require("../../../entity/transaction/stateTypes/customerTransaction");
|
|
18
19
|
const otherTransaction_1 = require("../../../entity/transaction/stateTypes/otherTransaction");
|
|
19
|
-
const transactionType_1 = require("../../../entity/transaction/stateTypes/transactionType");
|
|
20
20
|
const vendorTransaction_1 = require("../../../entity/transaction/stateTypes/vendorTransaction");
|
|
21
21
|
const toSupportedTransaction_1 = __importDefault(require("../../../entity/transaction/toSupportedTransaction"));
|
|
22
22
|
const transactionHelper_1 = require("../../../entity/transaction/transactionHelper");
|
|
@@ -25,13 +25,12 @@ const transactionSelector_1 = require("../../../entity/transaction/transactionSe
|
|
|
25
25
|
const vendorReducer_1 = require("../../../entity/vendor/vendorReducer");
|
|
26
26
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
27
27
|
const responsePayload_1 = require("../../../responsePayload");
|
|
28
|
-
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
29
28
|
const accountListSelector_1 = require("../../accountList/accountListSelector");
|
|
30
29
|
const transactionCategorizationLocalDataHelper_1 = require("../../expenseAutomationView/helpers/transactionCategorizationLocalDataHelper");
|
|
31
30
|
const transactionsViewReducer_1 = require("../../expenseAutomationView/reducers/transactionsViewReducer");
|
|
31
|
+
const transactionDetailLocalDataHelper_1 = require("../transactionDetailLocalDataHelper");
|
|
32
32
|
const transactionDetailReducer_1 = require("../transactionDetailReducer");
|
|
33
33
|
const transactionDetailState_1 = require("../transactionDetailState");
|
|
34
|
-
const saveTransactionHelper_1 = require("./saveTransactionHelper");
|
|
35
34
|
const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.updateTransactionDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
36
35
|
const { transactionState, vendorState, transactionDetailState } = state$.value;
|
|
37
36
|
const isAccountingProjectsEnabled = (0, tenantSelector_1.getIsAccountingProjectsEnabled)(state$.value);
|
|
@@ -42,24 +41,6 @@ const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
42
41
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
43
42
|
const transactionIdResp = (0, transactionIDPayload_1.toTransactionID)(response.data.transaction);
|
|
44
43
|
const transactionDetailKeyForResponse = (0, transactionDetailState_1.getTransactionDetailKey)(transactionIdResp);
|
|
45
|
-
const tranDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, transactionDetailKeyForResponse, undefined);
|
|
46
|
-
const tranVendorUpdates = tranDetail?.transactionDetailLocalData.vendorUpdates;
|
|
47
|
-
let vendorUpdates = undefined;
|
|
48
|
-
if (tranVendorUpdates?.qboId != null) {
|
|
49
|
-
const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, tranVendorUpdates.qboId);
|
|
50
|
-
if (vendor != null) {
|
|
51
|
-
vendorUpdates = {
|
|
52
|
-
id: vendor?.qboId,
|
|
53
|
-
name: vendor?.name,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
else if (tranVendorUpdates.name != null) {
|
|
57
|
-
vendorUpdates = {
|
|
58
|
-
id: tranVendorUpdates.qboId,
|
|
59
|
-
name: tranVendorUpdates.name,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
44
|
const actions = [];
|
|
64
45
|
if (response.data.vendors != null) {
|
|
65
46
|
actions.push((0, vendorReducer_1.updateVendors)(response.data.vendors, 'merge'));
|
|
@@ -72,30 +53,14 @@ const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
72
53
|
vendorId: response.data.vendors?.[0]?.vendor_id,
|
|
73
54
|
}));
|
|
74
55
|
actions.push((0, transactionDetailReducer_1.updateTransactionDetailSaveStatus)(transactionIdResp, 'Completed'));
|
|
75
|
-
let callMarkTransactionAsNotMiscategorized = true;
|
|
76
|
-
// NOTE: If tran is vendorType OR JE OR Deposit transaction and there is no vendor chosen on this tranaction while saving,
|
|
77
|
-
// then we need to skip mark-miscategorized-as-correct api call
|
|
78
|
-
if ((0, transactionType_1.toVendorTransactionTypeStrict)(response.data.transaction.transaction_type) != null ||
|
|
79
|
-
(0, transactionType_1.toJEAndDepositTransactionTypeStrict)(response.data.transaction.transaction_type) != null) {
|
|
80
|
-
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
|
|
81
|
-
const isAnyClassMissing = isAccountingClassesEnabled &&
|
|
82
|
-
checkIfClassMissingForAnyLineItem(response.data.transaction);
|
|
83
|
-
const isVendorOrCustomerMissingInAnyLine = (0, transactionType_1.toJEAndDepositTransactionTypeStrict)(response.data.transaction.transaction_type) != null &&
|
|
84
|
-
checkIfVendorOrCustomerMissingForAnyLineItem(response.data.transaction);
|
|
85
|
-
if ((vendorUpdates?.id == null &&
|
|
86
|
-
isVendorOrCustomerMissingInAnyLine == true) ||
|
|
87
|
-
isAnyClassMissing == true) {
|
|
88
|
-
callMarkTransactionAsNotMiscategorized = false;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
56
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(state$.value.accountState, state$.value.accountListState, 'accountList');
|
|
92
57
|
const transaction = (0, toSupportedTransaction_1.default)(response.data.transaction);
|
|
93
|
-
const
|
|
58
|
+
const isAccountingClassesEnabled = (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value);
|
|
59
|
+
const eligibleLineIds = getLineIdsEligibleForReview(transaction, uncategorizedIncomeExpense, isAccountingClassesEnabled);
|
|
94
60
|
if (action.payload.transactionSaveUpdates.markAsMiscatUpdates ===
|
|
95
61
|
true &&
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
actions.push((0, transactionDetailReducer_1.markTransactionAsNotMiscategorized)(transactionIdResp, action.payload.transactionSaveUpdates, action.payload.isExpenseAutomationEnabled));
|
|
62
|
+
eligibleLineIds.length > 0) {
|
|
63
|
+
actions.push((0, transactionDetailReducer_1.markTransactionAsNotMiscategorized)(transactionIdResp, action.payload.transactionSaveUpdates, action.payload.isExpenseAutomationEnabled, eligibleLineIds));
|
|
99
64
|
}
|
|
100
65
|
else {
|
|
101
66
|
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
@@ -307,31 +272,25 @@ const toTransactionUpdatePayload = (updates, detail, cotTransactionTracking, isA
|
|
|
307
272
|
return (0, transactionPayload_1.injectCOTFlagsIntoTransactionPayload)(basePayload, transaction);
|
|
308
273
|
};
|
|
309
274
|
exports.toTransactionUpdatePayload = toTransactionUpdatePayload;
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
?.customer == null) {
|
|
330
|
-
isAnyVendorOrCustomerMissing = true;
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
return isAnyVendorOrCustomerMissing;
|
|
275
|
+
const getLineIdsEligibleForReview = (transaction, uncategorizedIncomeExpense, isAccountingClassesEnabled) => {
|
|
276
|
+
return (transaction.lines ?? [])
|
|
277
|
+
.filter((line) => {
|
|
278
|
+
if (line.type !== 'transaction_with_account_and_class_line' &&
|
|
279
|
+
line.type !== 'journal_entry_transaction_line' &&
|
|
280
|
+
line.type !== 'transaction_with_product_or_service_line') {
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
const typedLine = line;
|
|
284
|
+
const hasCategory = !(0, transactionDetailLocalDataHelper_1.isAccountUncategorized)(uncategorizedIncomeExpense, typedLine.account?.qboId);
|
|
285
|
+
const hasClass = !isAccountingClassesEnabled || typedLine.class != null;
|
|
286
|
+
const hasAmount = (typedLine.amount?.amount ?? 0) !== 0;
|
|
287
|
+
const hasEntity = line.type !== 'journal_entry_transaction_line' ||
|
|
288
|
+
typedLine.vendor != null ||
|
|
289
|
+
typedLine.customer != null;
|
|
290
|
+
return hasCategory && hasClass && hasAmount && hasEntity;
|
|
291
|
+
})
|
|
292
|
+
.map((line) => line.id)
|
|
293
|
+
.filter(Boolean);
|
|
335
294
|
};
|
|
336
295
|
// Converts a locally-created line item (from edit mode) into the wire shape
|
|
337
296
|
// expected by the categorize endpoint. Sending id='' signals the backend to
|
|
@@ -764,6 +764,7 @@ const setEntityRecommendationForLineIdInLocalData = (transaction, transactionDet
|
|
|
764
764
|
latestUpdatedLineWithEntity: transactionDetailLocalData.latestUpdatedLineWithEntity,
|
|
765
765
|
vendorBulkUpdateCategoryClassRecommendationsFetchStatus: transactionDetailLocalData.vendorBulkUpdateCategoryClassRecommendationsFetchStatus,
|
|
766
766
|
selectedEntity: transactionDetailLocalData.selectedEntity,
|
|
767
|
+
editMode: transactionDetailLocalData.editMode,
|
|
767
768
|
};
|
|
768
769
|
return newLocalData;
|
|
769
770
|
};
|
|
@@ -818,6 +819,7 @@ const removeEntityRecommendationForLineIdInLocalData = (transaction, transaction
|
|
|
818
819
|
latestSelectedEntityOnLineItem: transactionDetailLocalData.latestSelectedEntityOnLineItem,
|
|
819
820
|
latestUpdatedLineWithEntity: transactionDetailLocalData.latestUpdatedLineWithEntity,
|
|
820
821
|
selectedEntity: transactionDetailLocalData.selectedEntity,
|
|
822
|
+
editMode: transactionDetailLocalData.editMode,
|
|
821
823
|
};
|
|
822
824
|
return newLocalData;
|
|
823
825
|
};
|
|
@@ -838,7 +840,8 @@ const getChangedLineItemCountFromLocalData = (transaction, transactionLocalData)
|
|
|
838
840
|
const accountLine = line;
|
|
839
841
|
hasCategoryChanged =
|
|
840
842
|
accountLineLocal.account?.qboId !== accountLine.account.qboId &&
|
|
841
|
-
accountLineLocal.account?.accountId !==
|
|
843
|
+
accountLineLocal.account?.accountId !==
|
|
844
|
+
accountLine.account.accountId;
|
|
842
845
|
hasClassChanged =
|
|
843
846
|
(accountLineLocal.class?.qboId != null ||
|
|
844
847
|
accountLine.class?.qboId != null) &&
|
|
@@ -38,10 +38,11 @@ export declare const downloadAccountingProviderAttachment: import("@reduxjs/tool
|
|
|
38
38
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
39
39
|
}, "transactionDetail/updateTransactionDetailSaveStatus", never, never>, clearTransactionDetailSaveStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID], {
|
|
40
40
|
transactionId: TransactionID;
|
|
41
|
-
}, "transactionDetail/clearTransactionDetailSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates, isExpenseAutomationEnabled: boolean], {
|
|
41
|
+
}, "transactionDetail/clearTransactionDetailSaveStatus", never, never>, markTransactionAsNotMiscategorized: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, transactionSaveUpdates: TransactionSaveUpdates, isExpenseAutomationEnabled: boolean, lineIds?: string[] | undefined], {
|
|
42
42
|
transactionId: TransactionID;
|
|
43
43
|
transactionSaveUpdates: TransactionSaveUpdates;
|
|
44
44
|
isExpenseAutomationEnabled: boolean;
|
|
45
|
+
lineIds: string[] | undefined;
|
|
45
46
|
}, "transactionDetail/markTransactionAsNotMiscategorized", never, never>, deleteTransactionAttachment: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[attachmentFileName: string, transactionId: TransactionID], {
|
|
46
47
|
attachmentFileName: string;
|
|
47
48
|
transactionId: TransactionID;
|
|
@@ -197,12 +197,13 @@ const transactionDetail = (0, toolkit_1.createSlice)({
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
|
-
prepare(transactionId, transactionSaveUpdates, isExpenseAutomationEnabled) {
|
|
200
|
+
prepare(transactionId, transactionSaveUpdates, isExpenseAutomationEnabled, lineIds) {
|
|
201
201
|
return {
|
|
202
202
|
payload: {
|
|
203
203
|
transactionId,
|
|
204
204
|
transactionSaveUpdates,
|
|
205
205
|
isExpenseAutomationEnabled,
|
|
206
|
+
lineIds,
|
|
206
207
|
},
|
|
207
208
|
};
|
|
208
209
|
},
|
package/lib/zeniAPI.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export interface RESTAPIEndpoints {
|
|
|
10
10
|
readonly authMicroServiceBaseUrl: string;
|
|
11
11
|
readonly bankingMicroServiceBaseUrl: string;
|
|
12
12
|
readonly cardMicroServiceBaseUrl: string;
|
|
13
|
-
readonly cashManagementAgentBaseUrl: string;
|
|
14
13
|
readonly communicationAgentMicroServiceBaseUrl: string;
|
|
15
14
|
readonly documentAIMicroServiceBaseUrl: string;
|
|
16
15
|
readonly fileMicroServiceBaseUrl: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.51-beta0RR",
|
|
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,29 +0,0 @@
|
|
|
1
|
-
import { toAmount } from '../../../../commonStateTypes/amount';
|
|
2
|
-
import { date } from '../../../../zeniDayJS';
|
|
3
|
-
import { toAutoSweepFrequency, } from './autoSweepFlowState';
|
|
4
|
-
export const toSaveAutoSweepSettingsBody = (state) => ({
|
|
5
|
-
frequency: state.frequency,
|
|
6
|
-
memo: state.memo,
|
|
7
|
-
minimum_buffer_usd: state.bufferAmount.amount,
|
|
8
|
-
});
|
|
9
|
-
/**
|
|
10
|
-
* Map a `GET /cash-management/settings` payload into the slice's writable
|
|
11
|
-
* fields. Defensive on the frequency (string-from-the-wire → union via
|
|
12
|
-
* `toAutoSweepFrequency`, falling back to `'weekly'` if the server returns
|
|
13
|
-
* something we don't model yet). Only the source account *id* is stored
|
|
14
|
-
* here — the full deposit-account payload is published to the entity bucket
|
|
15
|
-
* by the fetch epic.
|
|
16
|
-
*/
|
|
17
|
-
export const toAutoSweepFlowStatePatch = (payload) => {
|
|
18
|
-
const currencyCode = payload.source_bank_account.balances?.currency_code;
|
|
19
|
-
const currencySymbol = payload.source_bank_account.balances?.currency_symbol;
|
|
20
|
-
return {
|
|
21
|
-
bufferAmount: toAmount(payload.minimum_buffer_usd, currencyCode ?? 'USD', currencySymbol ?? '$'),
|
|
22
|
-
frequency: toAutoSweepFrequency(payload.frequency) ?? 'weekly',
|
|
23
|
-
nextTransferDate: payload.next_run_date != null && payload.next_run_date !== ''
|
|
24
|
-
? date(payload.next_run_date)
|
|
25
|
-
: undefined,
|
|
26
|
-
primaryFundingAccountId: payload.source_bank_account.deposit_account_id ?? undefined,
|
|
27
|
-
settingsId: payload.cash_management_settings_id ?? undefined,
|
|
28
|
-
};
|
|
29
|
-
};
|