@zeniai/client-epic-state 4.17.69 → 4.17.70
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/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.js +4 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewPayload.d.ts +2 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +7 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewSelector.js +3 -2
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +1 -0
- package/package.json +1 -1
package/lib/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.js
CHANGED
|
@@ -19,7 +19,10 @@ const updatePortfolioAllocationEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
19
19
|
return apiCall.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
20
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
21
21
|
const actions = [
|
|
22
|
-
(0, treasurySetupViewReducer_1.updatePortfolioAllocationSuccess)(response.data || {
|
|
22
|
+
(0, treasurySetupViewReducer_1.updatePortfolioAllocationSuccess)(response.data || {
|
|
23
|
+
fund_allocation_percentages: {},
|
|
24
|
+
custom_corporate_id: null,
|
|
25
|
+
}),
|
|
23
26
|
];
|
|
24
27
|
if (isEdit) {
|
|
25
28
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
@@ -45,11 +45,13 @@ interface AllocationPercentageToRiskPayload {
|
|
|
45
45
|
}
|
|
46
46
|
export type FetchTreasuryFundsResponse = ZeniAPIResponse<TreasuryFundsPayload>;
|
|
47
47
|
export interface UpdatePortfolioAllocationPayload {
|
|
48
|
+
custom_corporate_id: string | null;
|
|
48
49
|
fund_allocation_percentages: Record<string, number>;
|
|
49
50
|
}
|
|
50
51
|
export type UpdatePortfolioAllocationResponse = ZeniAPIResponse<UpdatePortfolioAllocationPayload>;
|
|
51
52
|
export interface FetchPortfolioAllocationPayload {
|
|
52
53
|
allocation_percentages: Record<string, number>;
|
|
54
|
+
custom_corporate_id: string | null;
|
|
53
55
|
}
|
|
54
56
|
export type FetchPortfolioAllocationResponse = ZeniAPIResponse<FetchPortfolioAllocationPayload>;
|
|
55
57
|
export {};
|
|
@@ -14,6 +14,7 @@ export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreato
|
|
|
14
14
|
isEdit: boolean;
|
|
15
15
|
}, "treasurySetupView/updatePortfolioAllocation", never, never>, updatePortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdatePortfolioAllocationPayload, "treasurySetupView/updatePortfolioAllocationSuccess">, updatePortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/updatePortfolioAllocationFailure", never, never>, fetchPortfolioAllocation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasurySetupView/fetchPortfolioAllocation">, fetchPortfolioAllocationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
16
|
allocation_percentages: Record<string, number>;
|
|
17
|
+
custom_corporate_id: string | null;
|
|
17
18
|
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">;
|
|
18
19
|
declare const _default: import("redux").Reducer<TreasurySetupViewState>;
|
|
19
20
|
export default _default;
|
|
@@ -12,6 +12,7 @@ const treasurySetupViewState_1 = require("./treasurySetupViewState");
|
|
|
12
12
|
exports.initialState = {
|
|
13
13
|
fetchState: 'Not-Started',
|
|
14
14
|
error: undefined,
|
|
15
|
+
isAtomicAccountExists: false,
|
|
15
16
|
isRefreshingViewInBackground: false,
|
|
16
17
|
treasuryTermsDetails: undefined,
|
|
17
18
|
treasuryFundsDetails: {
|
|
@@ -180,6 +181,9 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
|
|
|
180
181
|
fetchState: 'Completed',
|
|
181
182
|
error: undefined,
|
|
182
183
|
};
|
|
184
|
+
if (action.payload.custom_corporate_id != null) {
|
|
185
|
+
draft.isAtomicAccountExists = true;
|
|
186
|
+
}
|
|
183
187
|
// Update currentAllocation with the response data
|
|
184
188
|
draft.currentAllocation = {
|
|
185
189
|
fetchStatus: {
|
|
@@ -228,6 +232,9 @@ const treasurySetupView = (0, toolkit_1.createSlice)({
|
|
|
228
232
|
} }, (Object.keys(action.payload.allocation_percentages).length > 0 && {
|
|
229
233
|
allocation: action.payload.allocation_percentages,
|
|
230
234
|
}));
|
|
235
|
+
if (action.payload.custom_corporate_id != null) {
|
|
236
|
+
draft.isAtomicAccountExists = true;
|
|
237
|
+
}
|
|
231
238
|
//populate the fund allocation local data with current allocation
|
|
232
239
|
const option = draft.treasuryFundsDetails.fundAllocationOptions.find((option) => (0, isEqual_1.default)(option.allocation, action.payload.allocation_percentages));
|
|
233
240
|
if (option) {
|
|
@@ -8,6 +8,7 @@ export interface TreasurySetupView extends SetupView, SelectorView {
|
|
|
8
8
|
fundAllocationLocalData: FundAllocationOption;
|
|
9
9
|
fundAllocationOptions: FundAllocationOption[];
|
|
10
10
|
fundsData: FundData[];
|
|
11
|
+
isAtomicAccountExists: boolean;
|
|
11
12
|
isRefreshingViewInBackground: boolean;
|
|
12
13
|
portfolioAllocationUpdateStatus: FetchStateAndError;
|
|
13
14
|
companyTreasuryInfo?: CompanyTreasuryInfo;
|
|
@@ -11,7 +11,7 @@ function getTreasurySetupViewDetails(state, companyId) {
|
|
|
11
11
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
12
12
|
const companyTreasuryInfo = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyTreasuryInfo;
|
|
13
13
|
const { treasurySetupViewState, setupViewState } = state;
|
|
14
|
-
const { treasuryTermsDetails, isRefreshingViewInBackground, treasuryFundsDetails, } = treasurySetupViewState;
|
|
14
|
+
const { treasuryTermsDetails, isRefreshingViewInBackground, treasuryFundsDetails, isAtomicAccountExists, } = treasurySetupViewState;
|
|
15
15
|
const { updateStatus } = setupViewState;
|
|
16
16
|
const businessVerificationDetails = getTreasuryBusinessVerificationDetails(state, companyId);
|
|
17
17
|
const selectedCompanyOfficer = (0, helpers_1.getSelectedCompanyOfficer)(businessVerificationDetails);
|
|
@@ -23,7 +23,8 @@ function getTreasurySetupViewDetails(state, companyId) {
|
|
|
23
23
|
return Object.assign(Object.assign({}, treasurySetupViewDetails), { treasuryTermsDetails,
|
|
24
24
|
companyTreasuryInfo, version: 1, fetchState: reducedFetchState.fetchState, error: reducedFetchState.error, updateStatus,
|
|
25
25
|
selectedCompanyOfficer,
|
|
26
|
-
isRefreshingViewInBackground,
|
|
26
|
+
isRefreshingViewInBackground,
|
|
27
|
+
isAtomicAccountExists, fundsData: treasuryFundsDetails.fundsDetails, fundAllocationOptions: treasuryFundsDetails.fundAllocationOptions, fundAllocationLocalData: treasurySetupViewState.fundAllocationLocalData, currentAllocation: treasurySetupViewState.currentAllocation.allocation, portfolioAllocationUpdateStatus: treasurySetupViewState.portfolioAllocationUpdateStatus });
|
|
27
28
|
}
|
|
28
29
|
function getTreasuryBusinessVerificationDetails(state, companyId) {
|
|
29
30
|
const treasuryBusinessVerificationDetails = (0, setupViewSelector_1.getBusinessVerificationDetails)(state, companyId);
|
|
@@ -8,6 +8,7 @@ export interface TreasurySetupViewState extends FetchedState {
|
|
|
8
8
|
allocation?: Record<string, number>;
|
|
9
9
|
};
|
|
10
10
|
fundAllocationLocalData: FundAllocationOption;
|
|
11
|
+
isAtomicAccountExists: boolean;
|
|
11
12
|
isRefreshingViewInBackground: boolean;
|
|
12
13
|
portfolioAllocationUpdateStatus: FetchStateAndError;
|
|
13
14
|
treasuryFundsDetails: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.70",
|
|
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
|
"types": "lib/index.d.ts",
|