@zeniai/client-epic-state 5.0.82-betaAK3 → 5.0.82-betaAK4
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/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +2 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +7 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +2 -0
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +0 -16
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getDepositAccountByDepositAccountId } from '../../../../entity/depositAccount/depositAccountSelector';
|
|
2
2
|
import { mapDepositAccToFundingAccount, } from '../../commonSetup/setupViewSelector';
|
|
3
3
|
import { getTreasuryDetail } from '../../treasury/treasuryList/treasuryDetailSelector';
|
|
4
|
+
import { getCashManagementOverviewBanner } from '../cashManagementOverview/cashManagementOverviewSelector';
|
|
4
5
|
import { bufferAmountToRisk, } from './autoSweepFlowState';
|
|
5
6
|
export const getAutoSweepFlow = (state) => {
|
|
6
7
|
const { bufferAmount, frequency, memo, saveStatus, settingsId, primaryFundingAccountId, fetchState, error, } = state.autoSweepFlowState;
|
|
@@ -21,6 +22,7 @@ export const getAutoSweepFlow = (state) => {
|
|
|
21
22
|
: undefined,
|
|
22
23
|
saveStatus,
|
|
23
24
|
settingsId,
|
|
25
|
+
sweepAmount: getCashManagementOverviewBanner(state).amount,
|
|
24
26
|
treasurySummary: getTreasuryDetail(state).accountSummary,
|
|
25
27
|
version: 0,
|
|
26
28
|
};
|
|
@@ -22,6 +22,13 @@ export interface AutoSweepFlowFormData {
|
|
|
22
22
|
export interface AutoSweepFlowSelectorView extends SelectorView {
|
|
23
23
|
formData: AutoSweepFlowFormData;
|
|
24
24
|
saveStatus: FetchStateAndError;
|
|
25
|
+
/**
|
|
26
|
+
* Recommended sweep amount. Sourced from the cash management banner
|
|
27
|
+
* (the first money_movements[0].movements[0].amount returned by the
|
|
28
|
+
* agent's `/recommend` endpoint). Defaults to zero when the agent
|
|
29
|
+
* hasn't returned a movement yet.
|
|
30
|
+
*/
|
|
31
|
+
sweepAmount: Amount;
|
|
25
32
|
/** Resolved from `primaryFundingAccountId` against the deposit-account
|
|
26
33
|
* entity bucket. `undefined` until the GET fetch publishes the account. */
|
|
27
34
|
primaryFundingAccount?: FundingAccount;
|
|
@@ -4,6 +4,7 @@ exports.getAutoSweepFlow = void 0;
|
|
|
4
4
|
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
5
5
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
6
6
|
const treasuryDetailSelector_1 = require("../../treasury/treasuryList/treasuryDetailSelector");
|
|
7
|
+
const cashManagementOverviewSelector_1 = require("../cashManagementOverview/cashManagementOverviewSelector");
|
|
7
8
|
const autoSweepFlowState_1 = require("./autoSweepFlowState");
|
|
8
9
|
const getAutoSweepFlow = (state) => {
|
|
9
10
|
const { bufferAmount, frequency, memo, saveStatus, settingsId, primaryFundingAccountId, fetchState, error, } = state.autoSweepFlowState;
|
|
@@ -24,6 +25,7 @@ const getAutoSweepFlow = (state) => {
|
|
|
24
25
|
: undefined,
|
|
25
26
|
saveStatus,
|
|
26
27
|
settingsId,
|
|
28
|
+
sweepAmount: (0, cashManagementOverviewSelector_1.getCashManagementOverviewBanner)(state).amount,
|
|
27
29
|
treasurySummary: (0, treasuryDetailSelector_1.getTreasuryDetail)(state).accountSummary,
|
|
28
30
|
version: 0,
|
|
29
31
|
};
|
|
@@ -24,27 +24,11 @@ export declare const RISK_BUFFER_AMOUNT: Record<RiskLevel, number>;
|
|
|
24
24
|
* uses this so it can pre-select the user's existing band on edit.
|
|
25
25
|
*/
|
|
26
26
|
export declare const bufferAmountToRisk: (amount: number) => RiskLevel;
|
|
27
|
-
/**
|
|
28
|
-
* Auto-sweep configuration state.
|
|
29
|
-
*
|
|
30
|
-
* `fetchState` / `error` (inherited from `FetchStateAndError`) track the
|
|
31
|
-
* GET `/cash-management/settings` fetch. `saveStatus` tracks the PUT save
|
|
32
|
-
* separately so the two flows don't stomp on each other's status.
|
|
33
|
-
*
|
|
34
|
-
* `settingsId` is the server-issued id (nullable on the wire — undefined
|
|
35
|
-
* here when the agent has no settings record yet).
|
|
36
|
-
*/
|
|
37
27
|
export interface AutoSweepFlowState extends FetchStateAndError {
|
|
38
28
|
bufferAmount: Amount;
|
|
39
29
|
frequency: AutoSweepFrequency;
|
|
40
30
|
memo: string;
|
|
41
31
|
saveStatus: FetchStateAndError;
|
|
42
|
-
/**
|
|
43
|
-
* Deposit-account id of the primary funding account returned by GET
|
|
44
|
-
* `/cash-management/settings`. The selector resolves it against the
|
|
45
|
-
* deposit-account entity bucket via `getDepositAccountByDepositAccountId`
|
|
46
|
-
* and exposes a hydrated `FundingAccount`.
|
|
47
|
-
*/
|
|
48
32
|
primaryFundingAccountId?: ID;
|
|
49
33
|
settingsId?: ID;
|
|
50
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.82-
|
|
3
|
+
"version": "5.0.82-betaAK4",
|
|
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",
|