@zeniai/client-epic-state 4.17.45 → 4.17.46
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/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -0
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
- 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/company/companyPayload.d.ts +27 -2
- package/lib/entity/company/companyPayload.js +38 -2
- package/lib/entity/company/companyStateTypes.d.ts +22 -0
- package/lib/entity/company/companyStateTypes.js +13 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.js +1 -0
- package/lib/entity/file/fileState.d.ts +2 -2
- package/lib/entity/file/fileState.js +1 -0
- 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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +5 -1
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/entity/tenant/tenantPayload.d.ts +3 -0
- package/lib/entity/tenant/tenantReducer.js +1 -0
- package/lib/entity/tenant/tenantSelector.d.ts +5 -1
- package/lib/entity/tenant/tenantSelector.js +6 -0
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/userRole/userRolePayload.d.ts +6 -0
- package/lib/entity/userRole/userRolePayload.js +6 -0
- package/lib/entity/userRole/userRoleReducer.js +3 -0
- package/lib/entity/userRole/userRoleState.d.ts +1 -0
- package/lib/entity/userRole/userRoleType.d.ts +5 -2
- package/lib/entity/userRole/userRoleType.js +44 -5
- package/lib/epic.d.ts +11 -1
- package/lib/epic.js +11 -1
- package/lib/index.d.ts +23 -9
- package/lib/index.js +64 -33
- package/lib/reducer.d.ts +12 -0
- package/lib/reducer.js +12 -0
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +21 -0
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +43 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewPayload.d.ts +1 -0
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewPayload.js +7 -0
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewSelector.js +5 -0
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +2 -2
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.js +1 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +1 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/settingsView/settingsViewHelpers.d.ts +2 -1
- package/lib/view/settingsView/settingsViewHelpers.js +4 -3
- package/lib/view/settingsView/settingsViewSelector.d.ts +1 -1
- package/lib/view/settingsView/settingsViewSelector.js +9 -2
- package/lib/view/spendManagement/commonHistoryView/commonHistoryReducer.d.ts +2 -2
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +6 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +3 -1
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +6 -6
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +15 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +10 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +3 -1
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +1 -0
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePrimaryFundingAccountEpic.js +6 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/realTimeApprovalView/realTimeApprovalReducer.d.ts +2 -2
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.d.ts +9 -0
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +69 -0
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryHistoryEpic.d.ts +7 -0
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryHistoryEpic.js +31 -0
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryTransactionListEpic.d.ts +7 -0
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryTransactionListEpic.js +40 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailPayload.d.ts +60 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailPayload.js +18 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +31 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +152 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailSelector.d.ts +14 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailSelector.js +46 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailState.d.ts +42 -0
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailState.js +31 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/acceptTreasuryTermsEpic.d.ts +11 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/acceptTreasuryTermsEpic.js +44 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/fetchPortfolioAllocationEpic.d.ts +7 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/fetchPortfolioAllocationEpic.js +21 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/fetchTreasuryFundsEpic.d.ts +7 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/fetchTreasuryFundsEpic.js +28 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/fetchTreasurySetupViewEpic.d.ts +20 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/fetchTreasurySetupViewEpic.js +83 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.d.ts +7 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updatePortfolioAllocationEpic.js +30 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewPayload.d.ts +53 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewPayload.js +2 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +19 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +264 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewSelector.d.ts +24 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewSelector.js +35 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +47 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.js +2 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/fetchTreasuryStatementListEpic.d.ts +7 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/fetchTreasuryStatementListEpic.js +42 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementList.d.ts +10 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementList.js +11 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementListPayload.d.ts +10 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementListPayload.js +2 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementListReducer.d.ts +15 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementListReducer.js +57 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementListSelector.d.ts +7 -0
- package/lib/view/spendManagement/treasury/treasuryStatementList/treasuryStatementListSelector.js +18 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyEpic.d.ts +9 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyEpic.js +92 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyPayload.d.ts +36 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyPayload.js +15 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyReducer.d.ts +10 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyReducer.js +45 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneySelector.d.ts +17 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneySelector.js +55 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyState.d.ts +17 -0
- package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyState.js +2 -0
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.treasuryTransferMoneyEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const helpers_1 = require("../../helpers");
|
|
9
|
+
const treasuryDetailReducer_1 = require("../treasuryList/treasuryDetailReducer");
|
|
10
|
+
const treasuryTransferMoneyReducer_1 = require("./treasuryTransferMoneyReducer");
|
|
11
|
+
const treasuryTransferMoneyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasuryTransferMoneyReducer_1.executeTreasuryTransferMoney.match), (0, operators_1.switchMap)(() => {
|
|
12
|
+
const state = state$.value;
|
|
13
|
+
const localData = state.treasuryTransferMoneyState.localData;
|
|
14
|
+
return zeniAPI
|
|
15
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/treasury-account/transactions`, Object.assign({}, toTreasuryTransferMoneyPayload(localData)))
|
|
16
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data) {
|
|
18
|
+
const actions = [
|
|
19
|
+
(0, treasuryDetailReducer_1.updateTreasuryTransactionList)({
|
|
20
|
+
transferTransaction: response.data,
|
|
21
|
+
}),
|
|
22
|
+
(0, treasuryTransferMoneyReducer_1.treasuryTransferMoneySuccessOrFailure)({
|
|
23
|
+
fetchState: 'Completed',
|
|
24
|
+
}),
|
|
25
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
26
|
+
messageSection: 'treasury_transfer_money',
|
|
27
|
+
messageText: 'success',
|
|
28
|
+
type: 'success',
|
|
29
|
+
}),
|
|
30
|
+
];
|
|
31
|
+
return (0, rxjs_1.from)(actions);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return (0, rxjs_1.from)([
|
|
35
|
+
(0, treasuryTransferMoneyReducer_1.treasuryTransferMoneySuccessOrFailure)({
|
|
36
|
+
fetchState: 'Error',
|
|
37
|
+
error: response.status,
|
|
38
|
+
}),
|
|
39
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
40
|
+
messageSection: 'treasury_transfer_money_failed',
|
|
41
|
+
messageText: 'failed',
|
|
42
|
+
type: 'error',
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
}), (0, operators_1.catchError)((error) => {
|
|
47
|
+
return (0, rxjs_1.from)([
|
|
48
|
+
(0, treasuryTransferMoneyReducer_1.treasuryTransferMoneySuccessOrFailure)({
|
|
49
|
+
fetchState: 'Error',
|
|
50
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Treasury transfer money REST API call errored out: ' +
|
|
51
|
+
JSON.stringify(error)),
|
|
52
|
+
}),
|
|
53
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
54
|
+
messageSection: 'treasury_transfer_money_failed',
|
|
55
|
+
messageText: 'failed',
|
|
56
|
+
type: 'error',
|
|
57
|
+
}),
|
|
58
|
+
]);
|
|
59
|
+
}));
|
|
60
|
+
}));
|
|
61
|
+
exports.treasuryTransferMoneyEpic = treasuryTransferMoneyEpic;
|
|
62
|
+
const toTreasuryTransferMoneyPayload = (localData) => {
|
|
63
|
+
var _a, _b, _c, _d;
|
|
64
|
+
const payload = {
|
|
65
|
+
from_account: {
|
|
66
|
+
account_type: 'treasury_account',
|
|
67
|
+
},
|
|
68
|
+
to_account: {
|
|
69
|
+
account_type: 'treasury_account',
|
|
70
|
+
},
|
|
71
|
+
amount: localData.amount.amount,
|
|
72
|
+
currency_code: localData.amount.currencyCode,
|
|
73
|
+
currency_symbol: localData.amount.currencySymbol,
|
|
74
|
+
};
|
|
75
|
+
// If fromAccount is not null, it's a transfer TO treasury_account
|
|
76
|
+
if (localData.fromAccount &&
|
|
77
|
+
((_a = localData.fromAccount) === null || _a === void 0 ? void 0 : _a.accType) !== 'treasuryAccount') {
|
|
78
|
+
payload.from_account = {
|
|
79
|
+
account_id: localData.fromAccount.id,
|
|
80
|
+
account_type: (_b = (0, helpers_1.accountTypeSubConfigCodeToAccType)(localData.fromAccount.accType)) !== null && _b !== void 0 ? _b : '',
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// If toAccount is not null, it's a transfer FROM treasury_account
|
|
84
|
+
else if (localData.toAccount &&
|
|
85
|
+
((_c = localData.toAccount) === null || _c === void 0 ? void 0 : _c.accType) !== 'treasuryAccount') {
|
|
86
|
+
payload.to_account = {
|
|
87
|
+
account_id: localData.toAccount.id,
|
|
88
|
+
account_type: (_d = (0, helpers_1.accountTypeSubConfigCodeToAccType)(localData.toAccount.accType)) !== null && _d !== void 0 ? _d : '',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return payload;
|
|
92
|
+
};
|
package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyPayload.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
2
|
+
import { TreasuryTransactionStatus } from '../treasuryList/treasuryDetailPayload';
|
|
3
|
+
interface TreasuryAccountPayload {
|
|
4
|
+
account_type: 'treasury_account';
|
|
5
|
+
}
|
|
6
|
+
interface CheckingAccountPayload {
|
|
7
|
+
account_id: string;
|
|
8
|
+
account_type: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TreasuryTransferMoneyRequestPayload {
|
|
11
|
+
from_account: TreasuryAccountPayload | CheckingAccountPayload;
|
|
12
|
+
to_account: TreasuryAccountPayload | CheckingAccountPayload;
|
|
13
|
+
amount: number;
|
|
14
|
+
currency_code: string;
|
|
15
|
+
currency_symbol: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TreasuryTransferMoneyResponsePayload {
|
|
18
|
+
amount: number;
|
|
19
|
+
currency_code: string;
|
|
20
|
+
currency_symbol: string;
|
|
21
|
+
date: string;
|
|
22
|
+
description: string | null;
|
|
23
|
+
status: TreasuryTransactionStatus;
|
|
24
|
+
transaction_id: string;
|
|
25
|
+
}
|
|
26
|
+
export type TreasuryTransferMoneyResponse = ZeniAPIResponse<TreasuryTransferMoneyResponsePayload>;
|
|
27
|
+
export declare const mapTreasuryTransferMoneyPayloadToTreasuryTransferMoneyResult: (payload: TreasuryTransferMoneyResponsePayload) => {
|
|
28
|
+
amount: string;
|
|
29
|
+
currencyCode: string;
|
|
30
|
+
currencySymbol: string;
|
|
31
|
+
date: string;
|
|
32
|
+
description: string | null;
|
|
33
|
+
status: TreasuryTransactionStatus;
|
|
34
|
+
transactionId: string;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyPayload.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapTreasuryTransferMoneyPayloadToTreasuryTransferMoneyResult = void 0;
|
|
4
|
+
const mapTreasuryTransferMoneyPayloadToTreasuryTransferMoneyResult = (payload) => {
|
|
5
|
+
return {
|
|
6
|
+
amount: payload.amount.toString(),
|
|
7
|
+
currencyCode: payload.currency_code,
|
|
8
|
+
currencySymbol: payload.currency_symbol,
|
|
9
|
+
date: payload.date,
|
|
10
|
+
description: payload.description,
|
|
11
|
+
status: payload.status,
|
|
12
|
+
transactionId: payload.transaction_id,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.mapTreasuryTransferMoneyPayloadToTreasuryTransferMoneyResult = mapTreasuryTransferMoneyPayloadToTreasuryTransferMoneyResult;
|
package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyReducer.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FetchState } from '../../../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
3
|
+
import { TreasuryTransferMoneyLocalData, TreasuryTransferMoneyState } from './treasuryTransferMoneyState';
|
|
4
|
+
export declare const initialState: TreasuryTransferMoneyState;
|
|
5
|
+
export declare const updateTreasuryTransferMoneyLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<TreasuryTransferMoneyLocalData>, "treasuryTransferMoney/updateTreasuryTransferMoneyLocalData">, executeTreasuryTransferMoney: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasuryTransferMoney/executeTreasuryTransferMoney">, treasuryTransferMoneySuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
6
|
+
fetchState: FetchState;
|
|
7
|
+
error?: ZeniAPIStatus;
|
|
8
|
+
}, "treasuryTransferMoney/treasuryTransferMoneySuccessOrFailure">, clearTreasuryTransferMoney: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasuryTransferMoney/clearTreasuryTransferMoney">;
|
|
9
|
+
declare const _default: import("redux").Reducer<TreasuryTransferMoneyState>;
|
|
10
|
+
export default _default;
|
package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyReducer.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearTreasuryTransferMoney = exports.treasuryTransferMoneySuccessOrFailure = exports.executeTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
fetchState: 'Not-Started',
|
|
8
|
+
error: undefined,
|
|
9
|
+
localData: {
|
|
10
|
+
amount: {
|
|
11
|
+
amount: 0,
|
|
12
|
+
currencyCode: 'USD',
|
|
13
|
+
currencySymbol: '$',
|
|
14
|
+
},
|
|
15
|
+
fromAccount: undefined,
|
|
16
|
+
toAccount: {
|
|
17
|
+
accType: 'treasuryAccount',
|
|
18
|
+
label: 'Treasury',
|
|
19
|
+
id: 'treasury',
|
|
20
|
+
balance: undefined,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const treasuryTransferMoney = (0, toolkit_1.createSlice)({
|
|
25
|
+
name: 'treasuryTransferMoney',
|
|
26
|
+
initialState: exports.initialState,
|
|
27
|
+
reducers: {
|
|
28
|
+
updateTreasuryTransferMoneyLocalData: (draft, action) => {
|
|
29
|
+
draft.localData = Object.assign(Object.assign({}, draft.localData), action.payload);
|
|
30
|
+
},
|
|
31
|
+
executeTreasuryTransferMoney(draft) {
|
|
32
|
+
draft.fetchState = 'In-Progress';
|
|
33
|
+
draft.error = undefined;
|
|
34
|
+
},
|
|
35
|
+
treasuryTransferMoneySuccessOrFailure(draft, action) {
|
|
36
|
+
draft.fetchState = action.payload.fetchState;
|
|
37
|
+
draft.error = action.payload.error;
|
|
38
|
+
},
|
|
39
|
+
clearTreasuryTransferMoney(draft) {
|
|
40
|
+
Object.assign(draft, exports.initialState);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
_a = treasuryTransferMoney.actions, exports.updateTreasuryTransferMoneyLocalData = _a.updateTreasuryTransferMoneyLocalData, exports.executeTreasuryTransferMoney = _a.executeTreasuryTransferMoney, exports.treasuryTransferMoneySuccessOrFailure = _a.treasuryTransferMoneySuccessOrFailure, exports.clearTreasuryTransferMoney = _a.clearTreasuryTransferMoney;
|
|
45
|
+
exports.default = treasuryTransferMoney.reducer;
|
package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneySelector.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FetchState } from '../../../../commonStateTypes/common';
|
|
2
|
+
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
6
|
+
import { TreasuryAccount, TreasuryTransferMoneyLocalData } from './treasuryTransferMoneyState';
|
|
7
|
+
export interface TreasuryTransferMoneySelectorView extends SelectorView {
|
|
8
|
+
treasuryTransferMoneyLocalData: TreasuryTransferMoneyLocalData;
|
|
9
|
+
transferMoneyParties: FundingAccount[];
|
|
10
|
+
transferMoneyPartiesFetchState: FetchState;
|
|
11
|
+
canExecuteTransfer: boolean;
|
|
12
|
+
isTransferInProgress: boolean;
|
|
13
|
+
allRequiredDataFetchState: FetchState;
|
|
14
|
+
treasuryAccount: TreasuryAccount;
|
|
15
|
+
primaryPaymentAccount?: PaymentAccount;
|
|
16
|
+
}
|
|
17
|
+
export declare const getTreasuryTransferMoney: (state: RootState) => TreasuryTransferMoneySelectorView;
|
package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneySelector.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTreasuryTransferMoney = void 0;
|
|
4
|
+
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
5
|
+
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
6
|
+
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
7
|
+
const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
8
|
+
const getTreasuryTransferMoney = (state) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const { treasuryTransferMoneyState, treasuryDetailState, treasurySetupViewState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, } = state;
|
|
11
|
+
const { localData, fetchState, error } = treasuryTransferMoneyState;
|
|
12
|
+
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
13
|
+
const paymentAccountsView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
14
|
+
let transferParties = [];
|
|
15
|
+
const transferMoneyPartiesFetchState = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
16
|
+
depositAccountsView,
|
|
17
|
+
paymentAccountsView,
|
|
18
|
+
]).fetchState;
|
|
19
|
+
if (depositAccountsView.fetchState === 'Completed' &&
|
|
20
|
+
paymentAccountsView.fetchState === 'Completed') {
|
|
21
|
+
transferParties = (0, setupViewSelector_1.getAllFundingAccounts)(depositAccountsView.depositAccounts, paymentAccountsView.paymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus);
|
|
22
|
+
}
|
|
23
|
+
const primaryPaymentAccount = (0, paymentAccountListSelector_1.getPrimaryPaymentAccount)(paymentAccountState, paymentAccountListState);
|
|
24
|
+
const treasuryAccount = {
|
|
25
|
+
accType: 'treasuryAccount',
|
|
26
|
+
label: 'Treasury',
|
|
27
|
+
id: 'treasury',
|
|
28
|
+
balance: (_a = treasuryDetailState.accountSummary) === null || _a === void 0 ? void 0 : _a.totalBalance,
|
|
29
|
+
};
|
|
30
|
+
const allRequiredDataFetchState = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
31
|
+
depositAccountsView,
|
|
32
|
+
paymentAccountsView,
|
|
33
|
+
treasuryDetailState,
|
|
34
|
+
treasurySetupViewState.currentAllocation.fetchStatus,
|
|
35
|
+
treasurySetupViewState,
|
|
36
|
+
]).fetchState;
|
|
37
|
+
const isTransferInProgress = fetchState === 'In-Progress';
|
|
38
|
+
const canExecuteTransfer = (localData.fromAccount != null || localData.toAccount != null) &&
|
|
39
|
+
localData.amount.amount > 0 &&
|
|
40
|
+
!isTransferInProgress;
|
|
41
|
+
return {
|
|
42
|
+
treasuryTransferMoneyLocalData: localData,
|
|
43
|
+
transferMoneyParties: transferParties,
|
|
44
|
+
transferMoneyPartiesFetchState,
|
|
45
|
+
treasuryAccount,
|
|
46
|
+
allRequiredDataFetchState,
|
|
47
|
+
primaryPaymentAccount,
|
|
48
|
+
canExecuteTransfer,
|
|
49
|
+
isTransferInProgress,
|
|
50
|
+
fetchState,
|
|
51
|
+
error,
|
|
52
|
+
version: 0,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
exports.getTreasuryTransferMoney = getTreasuryTransferMoney;
|
package/lib/view/spendManagement/treasury/treasuryTransferMoney/treasuryTransferMoneyState.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchStateAndError } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
4
|
+
export interface TreasuryTransferMoneyState extends FetchStateAndError {
|
|
5
|
+
localData: TreasuryTransferMoneyLocalData;
|
|
6
|
+
}
|
|
7
|
+
export interface TreasuryTransferMoneyLocalData {
|
|
8
|
+
amount: Amount;
|
|
9
|
+
fromAccount?: FundingAccount | TreasuryAccount;
|
|
10
|
+
toAccount?: FundingAccount | TreasuryAccount;
|
|
11
|
+
}
|
|
12
|
+
export interface TreasuryAccount {
|
|
13
|
+
accType: 'treasuryAccount';
|
|
14
|
+
label: 'Treasury';
|
|
15
|
+
id: 'treasury';
|
|
16
|
+
balance?: Amount;
|
|
17
|
+
}
|
|
@@ -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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "charge_cards" | "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";
|
|
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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "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";
|
|
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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "charge_cards" | "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";
|
|
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" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "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" | "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";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
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.46",
|
|
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",
|