@zeniai/client-epic-state 4.17.40 → 4.17.42
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 +33 -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/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 +9 -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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
2
2
|
import { PlaidAccountKeyType, PlaidAccountViewState, PlaidLinkTokenType } from './plaidAccountViewState';
|
|
3
3
|
export declare const initialState: PlaidAccountViewState;
|
|
4
|
-
export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, includeBalances?: boolean | undefined], {
|
|
5
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
4
|
+
export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, includeBalances?: boolean | undefined], {
|
|
5
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
6
6
|
includeBalances: boolean;
|
|
7
7
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
8
8
|
}, "plaidAccountView/getPaymentAccounts", never, never>, getPaymentAccountsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], plaidAccountKeyType: PlaidAccountKeyType], {
|
|
@@ -11,20 +11,20 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
11
11
|
}, "plaidAccountView/getPaymentAccountsSuccess", never, never>, getPaymentAccountsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
12
12
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
13
13
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
14
|
-
}, "plaidAccountView/getPaymentAccountsFailure", never, never>, updatePaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType], {
|
|
14
|
+
}, "plaidAccountView/getPaymentAccountsFailure", never, never>, updatePaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountId: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType], {
|
|
15
15
|
accountId: string;
|
|
16
16
|
paymentAccountId: string;
|
|
17
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
17
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
18
18
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
19
19
|
}, "plaidAccountView/updatePaymentAccount", never, never>, updatePaymentAccountSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[plaidAccountKeyType: PlaidAccountKeyType], {
|
|
20
20
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
21
21
|
}, "plaidAccountView/updatePaymentAccountSuccess", never, never>, updatePaymentAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
22
22
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
23
23
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
24
|
-
}, "plaidAccountView/updatePaymentAccountFailure", never, never>, updatePaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
24
|
+
}, "plaidAccountView/updatePaymentAccountFailure", never, never>, updatePaymentAccountStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[verificationStatusCode: string, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
25
25
|
verificationStatusCode: string;
|
|
26
26
|
paymentAccountId: string;
|
|
27
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
27
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
28
28
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
29
29
|
linkTokenType: PlaidLinkTokenType;
|
|
30
30
|
}, "plaidAccountView/updatePaymentAccountStatus", never, never>, updatePaymentAccountStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
@@ -34,10 +34,10 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
34
34
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
35
35
|
linkTokenType: PlaidLinkTokenType;
|
|
36
36
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
37
|
-
}, "plaidAccountView/updatePaymentAccountStatusFailure", never, never>, updatePaymentAccountLoginStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isLoginRequired: boolean, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
37
|
+
}, "plaidAccountView/updatePaymentAccountStatusFailure", never, never>, updatePaymentAccountLoginStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isLoginRequired: boolean, paymentAccountId: string, setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards", plaidAccountKeyType: PlaidAccountKeyType, linkTokenType?: PlaidLinkTokenType | undefined], {
|
|
38
38
|
isLoginRequired: boolean;
|
|
39
39
|
paymentAccountId: string;
|
|
40
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
40
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards";
|
|
41
41
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
42
42
|
linkTokenType: PlaidLinkTokenType;
|
|
43
43
|
}, "plaidAccountView/updatePaymentAccountLoginStatus", never, never>, updatePaymentAccountLoginStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[paymentAccountIds: string[], linkTokenType: PlaidLinkTokenType, plaidAccountKeyType: PlaidAccountKeyType], {
|
|
@@ -61,10 +61,10 @@ export declare const getPaymentAccounts: import("@reduxjs/toolkit").ActionCreato
|
|
|
61
61
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
62
62
|
linkTokenType: PlaidLinkTokenType;
|
|
63
63
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
64
|
-
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined, zeniMappedAccountId?: string | undefined], {
|
|
64
|
+
}, "plaidAccountView/getPlaidLinkTokenFailure", never, never>, establishPlaidConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[publicToken: string, companyId: string, plaidAccountKeyType: PlaidAccountKeyType, setupViewType?: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards" | undefined, linkTokenType?: PlaidLinkTokenType | undefined, zeniMappedAccountId?: string | undefined], {
|
|
65
65
|
publicToken: string;
|
|
66
66
|
companyId: string;
|
|
67
|
-
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards" | undefined;
|
|
67
|
+
setupViewType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards" | "billing" | "debit_cards" | "charge_cards__debit_cards" | undefined;
|
|
68
68
|
linkTokenType: PlaidLinkTokenType;
|
|
69
69
|
plaidAccountKeyType: PlaidAccountKeyType;
|
|
70
70
|
zeniMappedAccountId: string | undefined;
|
|
@@ -16,6 +16,7 @@ exports.initialState = {
|
|
|
16
16
|
external_account: plaidAccountViewState_1.initialPlaidAccountState,
|
|
17
17
|
billing_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
18
18
|
expense_automation_reconcile: plaidAccountViewState_1.initialPlaidAccountState,
|
|
19
|
+
treasury_setup: plaidAccountViewState_1.initialPlaidAccountState,
|
|
19
20
|
};
|
|
20
21
|
const plaidAccountView = (0, toolkit_1.createSlice)({
|
|
21
22
|
name: 'plaidAccountView',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
export type PlaidLinkTokenType = 'link_account' | 'update_account' | 'link_account_no_microdeposit' | 'link_external_account';
|
|
4
|
-
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'bill_pay_detail' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile';
|
|
4
|
+
export type PlaidAccountKeyType = 'spend_management_setup' | 'bill_pay_setup' | 'bill_pay_detail' | 'reimbursement_setup' | 'account_setup' | 'charge_card_setup' | 'user_reimbursement_account' | 'external_account' | 'billing_setup' | 'expense_automation_reconcile' | 'treasury_setup';
|
|
5
5
|
export type PlaidConnectionDetails = Record<PlaidLinkTokenType, {
|
|
6
6
|
linkToken?: string;
|
|
7
7
|
expiration?: ZeniDate;
|
|
@@ -3,9 +3,9 @@ import { EntityType as SpendManagementEntityType } from '../../../entity/entityA
|
|
|
3
3
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
4
4
|
import { RealTimeApprovalDetailLocalData, RealTimeApprovalState } from './realTimeApprovalState';
|
|
5
5
|
export declare const initialState: RealTimeApprovalState;
|
|
6
|
-
export declare const saveRealTimeApproval: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityId: string, entityType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards", realTimeApprovalLocalData: RealTimeApprovalDetailLocalData], {
|
|
6
|
+
export declare const saveRealTimeApproval: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[entityId: string, entityType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards", realTimeApprovalLocalData: RealTimeApprovalDetailLocalData], {
|
|
7
7
|
entityId: string;
|
|
8
|
-
entityType: "bill_pay" | "reimbursement" | "zeni_accounts" | "charge_cards";
|
|
8
|
+
entityType: "bill_pay" | "reimbursement" | "zeni_accounts" | "zeni_treasury" | "charge_cards";
|
|
9
9
|
realTimeApprovalLocalData: RealTimeApprovalDetailLocalData;
|
|
10
10
|
}, "realTimeApproval/saveRealTimeApproval", never, never>, saveRealTimeApprovalSuccessorFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
11
11
|
entityId: ID;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
+
import { fetchPortfolioAllocation, fetchTreasuryFunds } from '../../treasurySetUp/treasurySetupViewReducer';
|
|
6
|
+
import { fetchTreasuryStatementList } from '../../treasuryStatementList/treasuryStatementListReducer';
|
|
7
|
+
import { fetchTreasuryHistory, fetchTreasuryOverviewDetail, fetchTreasurySummaryFailure, fetchTreasurySummarySuccess, fetchTreasuryTransactionList } from '../treasuryDetailReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchTreasuryOverviewDetail> | ReturnType<typeof fetchTreasuryHistory> | ReturnType<typeof fetchTreasuryFunds> | ReturnType<typeof fetchPortfolioAllocation> | ReturnType<typeof fetchTreasuryTransactionList> | ReturnType<typeof fetchTreasuryStatementList> | ReturnType<typeof fetchTreasurySummarySuccess> | ReturnType<typeof fetchTreasurySummaryFailure>;
|
|
9
|
+
export declare const fetchTreasuryDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchTreasuryDetailEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const treasurySetupViewReducer_1 = require("../../treasurySetUp/treasurySetupViewReducer");
|
|
8
|
+
const treasuryStatementListReducer_1 = require("../../treasuryStatementList/treasuryStatementListReducer");
|
|
9
|
+
const treasuryDetailReducer_1 = require("../treasuryDetailReducer");
|
|
10
|
+
const fetchTreasuryDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasuryDetailReducer_1.fetchTreasuryOverviewDetail.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
+
const { cacheOverride } = action.payload;
|
|
12
|
+
const state = state$.value;
|
|
13
|
+
const treasuryActions = [];
|
|
14
|
+
if (cacheOverride === true) {
|
|
15
|
+
treasuryActions.push((0, treasurySetupViewReducer_1.fetchTreasuryFunds)());
|
|
16
|
+
treasuryActions.push((0, treasurySetupViewReducer_1.fetchPortfolioAllocation)());
|
|
17
|
+
treasuryActions.push((0, treasuryStatementListReducer_1.fetchTreasuryStatementList)(true));
|
|
18
|
+
treasuryActions.push((0, treasuryDetailReducer_1.fetchTreasuryHistory)());
|
|
19
|
+
treasuryActions.push((0, treasuryDetailReducer_1.fetchTreasuryTransactionList)(true));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// Check treasury statement list state
|
|
23
|
+
const treasuryStatementListState = state.treasuryStatementListState;
|
|
24
|
+
if (treasuryStatementListState.hasValidState() === false &&
|
|
25
|
+
treasuryStatementListState.fetchState !== 'In-Progress') {
|
|
26
|
+
treasuryActions.push((0, treasuryStatementListReducer_1.fetchTreasuryStatementList)(false));
|
|
27
|
+
}
|
|
28
|
+
// Check treasury detail state for history
|
|
29
|
+
const treasuryDetailState = state.treasuryDetailState;
|
|
30
|
+
if (treasuryDetailState.hasValidState() === false &&
|
|
31
|
+
treasuryDetailState.fetchState !== 'In-Progress') {
|
|
32
|
+
treasuryActions.push((0, treasuryDetailReducer_1.fetchTreasuryHistory)());
|
|
33
|
+
}
|
|
34
|
+
// Check treasury transaction list state
|
|
35
|
+
const treasuryTransactionState = treasuryDetailState.transactionsState;
|
|
36
|
+
if (treasuryTransactionState.fetchState !== 'Completed' &&
|
|
37
|
+
treasuryTransactionState.fetchState !== 'In-Progress') {
|
|
38
|
+
treasuryActions.push((0, treasuryDetailReducer_1.fetchTreasuryTransactionList)(false, 5));
|
|
39
|
+
}
|
|
40
|
+
// Check treasury funds state
|
|
41
|
+
const treasurySetupViewState = state.treasurySetupViewState;
|
|
42
|
+
if (treasurySetupViewState.treasuryFundsDetails.fetchStatus.fetchState !==
|
|
43
|
+
'In-Progress') {
|
|
44
|
+
treasuryActions.push((0, treasurySetupViewReducer_1.fetchTreasuryFunds)());
|
|
45
|
+
}
|
|
46
|
+
// Check portfolio allocation state
|
|
47
|
+
const portfolioAllocationState = treasurySetupViewState.currentAllocation.fetchStatus;
|
|
48
|
+
if (portfolioAllocationState.fetchState !== 'In-Progress') {
|
|
49
|
+
treasuryActions.push((0, treasurySetupViewReducer_1.fetchPortfolioAllocation)());
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Return the treasury summary call followed by other actions
|
|
53
|
+
return zeniAPI
|
|
54
|
+
.getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/treasury-account?query=${encodeURIComponent(`{"is_summary":true}`)}`)
|
|
55
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
56
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
57
|
+
return (0, rxjs_1.concat)((0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasurySummarySuccess)({ data: response })), (0, rxjs_1.from)(treasuryActions));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return (0, rxjs_1.concat)((0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasurySummaryFailure)({ error: response.status })), (0, rxjs_1.from)(treasuryActions));
|
|
61
|
+
}
|
|
62
|
+
}), (0, operators_1.catchError)((error) => {
|
|
63
|
+
return (0, rxjs_1.concat)((0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasurySummaryFailure)({
|
|
64
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch treasury summary REST API call errored out ' +
|
|
65
|
+
JSON.stringify(error)),
|
|
66
|
+
})), (0, rxjs_1.from)(treasuryActions));
|
|
67
|
+
}));
|
|
68
|
+
}));
|
|
69
|
+
exports.fetchTreasuryDetailEpic = fetchTreasuryDetailEpic;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
+
import { fetchTreasuryHistory, fetchTreasuryHistoryFailure, fetchTreasuryHistorySuccess } from '../treasuryDetailReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchTreasuryHistory> | ReturnType<typeof fetchTreasuryHistorySuccess> | ReturnType<typeof fetchTreasuryHistoryFailure>;
|
|
7
|
+
export declare const fetchTreasuryHistoryEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchTreasuryHistoryEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const treasuryDetailReducer_1 = require("../treasuryDetailReducer");
|
|
8
|
+
const fetchTreasuryHistoryEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasuryDetailReducer_1.fetchTreasuryHistory.match), (0, operators_1.switchMap)(() => {
|
|
9
|
+
return zeniAPI
|
|
10
|
+
.getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/treasury-account/balance/time-series`)
|
|
11
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
12
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
13
|
+
return (0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasuryHistorySuccess)({
|
|
14
|
+
data: response,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return (0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasuryHistoryFailure)({
|
|
19
|
+
fetchState: 'Error',
|
|
20
|
+
error: response.status,
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
}), (0, operators_1.catchError)((error) => {
|
|
24
|
+
return (0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasuryHistoryFailure)({
|
|
25
|
+
fetchState: 'Error',
|
|
26
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch treasury account history REST API call errored out ' +
|
|
27
|
+
JSON.stringify(error)),
|
|
28
|
+
}));
|
|
29
|
+
}));
|
|
30
|
+
}));
|
|
31
|
+
exports.fetchTreasuryHistoryEpic = fetchTreasuryHistoryEpic;
|
package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryTransactionListEpic.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
5
|
+
import { fetchTreasuryTransactionList, fetchTreasuryTransactionListFailure, fetchTreasuryTransactionListSuccess } from '../treasuryDetailReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchTreasuryTransactionList> | ReturnType<typeof fetchTreasuryTransactionListSuccess> | ReturnType<typeof fetchTreasuryTransactionListFailure>;
|
|
7
|
+
export declare const fetchTreasuryTransactionListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryTransactionListEpic.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchTreasuryTransactionListEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../../responsePayload");
|
|
7
|
+
const treasuryDetailReducer_1 = require("../treasuryDetailReducer");
|
|
8
|
+
const fetchTreasuryTransactionListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(treasuryDetailReducer_1.fetchTreasuryTransactionList.match), (0, operators_1.switchMap)((action) => {
|
|
9
|
+
const { cacheOverride } = action.payload;
|
|
10
|
+
const queryParam = {
|
|
11
|
+
start_date: '2022-01-01',
|
|
12
|
+
end_date: '2030-12-31',
|
|
13
|
+
};
|
|
14
|
+
if (cacheOverride === true) {
|
|
15
|
+
return zeniAPI
|
|
16
|
+
.getJSON(`${zeniAPI.apiEndPoints.bankingMicroServiceBaseUrl}/1.0/treasury-account/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
17
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
20
|
+
return (0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasuryTransactionListSuccess)({
|
|
21
|
+
transactionList: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.transactions) !== null && _b !== void 0 ? _b : [],
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return (0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasuryTransactionListFailure)({
|
|
26
|
+
error: response.status,
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
}), (0, operators_1.catchError)((error) => {
|
|
30
|
+
return (0, rxjs_1.of)((0, treasuryDetailReducer_1.fetchTreasuryTransactionListFailure)({
|
|
31
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch treasury transactions REST API call errored out' +
|
|
32
|
+
JSON.stringify(error)),
|
|
33
|
+
}));
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return (0, rxjs_1.from)([]);
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
exports.fetchTreasuryTransactionListEpic = fetchTreasuryTransactionListEpic;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
2
|
+
import { AccountHistoryWithBalance } from './treasuryDetailState';
|
|
3
|
+
interface TreasuryDetailPayload {
|
|
4
|
+
treasury_account: {
|
|
5
|
+
total_balance: {
|
|
6
|
+
amount: number;
|
|
7
|
+
currency_code: string;
|
|
8
|
+
currency_symbol: string;
|
|
9
|
+
};
|
|
10
|
+
insured_funds: {
|
|
11
|
+
amount: number;
|
|
12
|
+
currency_code: string;
|
|
13
|
+
currency_symbol: string;
|
|
14
|
+
};
|
|
15
|
+
total_yield: {
|
|
16
|
+
amount: number;
|
|
17
|
+
currency_code: string;
|
|
18
|
+
currency_symbol: string;
|
|
19
|
+
};
|
|
20
|
+
thirty_day_percentage_yield: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type FetchTreasuryDetailResponse = ZeniAPIResponse<TreasuryDetailPayload>;
|
|
24
|
+
export interface TreasuryTransactionStatus {
|
|
25
|
+
code: string;
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TreasuryTransactionPayload {
|
|
29
|
+
transaction_id: string;
|
|
30
|
+
date: string;
|
|
31
|
+
amount: number;
|
|
32
|
+
currency_code: string;
|
|
33
|
+
currency_symbol: string;
|
|
34
|
+
description: string;
|
|
35
|
+
status: TreasuryTransactionStatus;
|
|
36
|
+
}
|
|
37
|
+
export interface TreasuryTransactionListQueryparam {
|
|
38
|
+
start_date: string;
|
|
39
|
+
end_date: string;
|
|
40
|
+
}
|
|
41
|
+
interface TreasuryTransactionListPayload {
|
|
42
|
+
query: TreasuryTransactionListQueryparam;
|
|
43
|
+
transactions: TreasuryTransactionPayload[];
|
|
44
|
+
}
|
|
45
|
+
export type FetchTreasuryTransactionListResponse = ZeniAPIResponse<TreasuryTransactionListPayload>;
|
|
46
|
+
interface AccountHistoryPayload {
|
|
47
|
+
date: string;
|
|
48
|
+
balances: BalancePayload;
|
|
49
|
+
}
|
|
50
|
+
interface BalancePayload {
|
|
51
|
+
current: number;
|
|
52
|
+
currency_code: string;
|
|
53
|
+
currency_symbol: string;
|
|
54
|
+
}
|
|
55
|
+
interface FetchTreasuryAccountHistoryPayload {
|
|
56
|
+
account_end_of_day_balances: AccountHistoryPayload[];
|
|
57
|
+
}
|
|
58
|
+
export type FetchTreasuryAccountHistoryResponse = ZeniAPIResponse<FetchTreasuryAccountHistoryPayload>;
|
|
59
|
+
export declare const mapAccountHistoryPayloadToAccountHistory: (payload: AccountHistoryPayload) => AccountHistoryWithBalance;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapAccountHistoryPayloadToAccountHistory = void 0;
|
|
4
|
+
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
5
|
+
const mapAccountHistoryPayloadToAccountHistory = (payload) => {
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
|
+
return ({
|
|
8
|
+
date: (0, zeniDayJS_1.date)(payload.date),
|
|
9
|
+
balance: {
|
|
10
|
+
available: {
|
|
11
|
+
amount: (_b = (_a = payload.balances) === null || _a === void 0 ? void 0 : _a.current) !== null && _b !== void 0 ? _b : 0,
|
|
12
|
+
currencyCode: (_c = payload.balances) === null || _c === void 0 ? void 0 : _c.currency_code,
|
|
13
|
+
currencySymbol: (_d = payload.balances) === null || _d === void 0 ? void 0 : _d.currency_symbol,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.mapAccountHistoryPayloadToAccountHistory = mapAccountHistoryPayloadToAccountHistory;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FetchState } from '../../../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
3
|
+
import { TreasuryTransferMoneyResponsePayload } from '../treasuryTransferMoney/treasuryTransferMoneyPayload';
|
|
4
|
+
import { FetchTreasuryAccountHistoryResponse, FetchTreasuryDetailResponse, TreasuryTransactionPayload } from './treasuryDetailPayload';
|
|
5
|
+
import { TreasuryDetailState, TreasuryListUIState } from './treasuryDetailState';
|
|
6
|
+
export declare const initialState: TreasuryDetailState;
|
|
7
|
+
export declare const fetchTreasuryOverviewDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean], {
|
|
8
|
+
cacheOverride: boolean;
|
|
9
|
+
}, "treasuryDetail/fetchTreasuryOverviewDetail", never, never>, fetchTreasuryHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasuryDetail/fetchTreasuryHistory">, fetchTreasuryHistorySuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
data: FetchTreasuryAccountHistoryResponse;
|
|
11
|
+
}, "treasuryDetail/fetchTreasuryHistorySuccess">, fetchTreasuryHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
|
+
fetchState: FetchState;
|
|
13
|
+
error: ZeniAPIStatus;
|
|
14
|
+
}, "treasuryDetail/fetchTreasuryHistoryFailure">, clearTreasuryOverviewDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"treasuryDetail/clearTreasuryOverviewDetail">, fetchTreasuryTransactionList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: boolean, count?: number | undefined], {
|
|
15
|
+
cacheOverride: boolean;
|
|
16
|
+
count: number | undefined;
|
|
17
|
+
}, "treasuryDetail/fetchTreasuryTransactionList", never, never>, fetchTreasuryTransactionListSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
|
+
transactionList: TreasuryTransactionPayload[];
|
|
19
|
+
}, "treasuryDetail/fetchTreasuryTransactionListSuccess">, fetchTreasuryTransactionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
error?: ZeniAPIStatus;
|
|
21
|
+
}, "treasuryDetail/fetchTreasuryTransactionListFailure">, updateTreasuryTransactionList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
22
|
+
transferTransaction: TreasuryTransferMoneyResponsePayload;
|
|
23
|
+
}, "treasuryDetail/updateTreasuryTransactionList">, fetchTreasurySummarySuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
24
|
+
data: FetchTreasuryDetailResponse;
|
|
25
|
+
}, "treasuryDetail/fetchTreasurySummarySuccess">, fetchTreasurySummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
26
|
+
error: ZeniAPIStatus;
|
|
27
|
+
}, "treasuryDetail/fetchTreasurySummaryFailure">, updateTreasuryTransactionListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
|
+
uiState: Partial<TreasuryListUIState>;
|
|
29
|
+
}, "treasuryDetail/updateTreasuryTransactionListUIState">;
|
|
30
|
+
declare const _default: import("redux").Reducer<TreasuryDetailState>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.updateTreasuryTransactionListUIState = exports.fetchTreasurySummaryFailure = exports.fetchTreasurySummarySuccess = exports.updateTreasuryTransactionList = exports.fetchTreasuryTransactionListFailure = exports.fetchTreasuryTransactionListSuccess = exports.fetchTreasuryTransactionList = exports.clearTreasuryOverviewDetail = exports.fetchTreasuryHistoryFailure = exports.fetchTreasuryHistorySuccess = exports.fetchTreasuryHistory = exports.fetchTreasuryOverviewDetail = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
7
|
+
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
8
|
+
const treasuryDetailPayload_1 = require("./treasuryDetailPayload");
|
|
9
|
+
const treasuryDetailState_1 = require("./treasuryDetailState");
|
|
10
|
+
exports.initialState = {
|
|
11
|
+
accountHistory: treasuryDetailState_1.initialAccountHistoryWithBalances,
|
|
12
|
+
accountSummary: undefined,
|
|
13
|
+
transactionsState: {
|
|
14
|
+
fetchState: 'Not-Started',
|
|
15
|
+
error: undefined,
|
|
16
|
+
transactions: [],
|
|
17
|
+
uiState: {
|
|
18
|
+
sortKey: 'description',
|
|
19
|
+
sortOrder: 'ascending',
|
|
20
|
+
scrollYOffset: 0,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
fetchState: 'Not-Started',
|
|
24
|
+
error: undefined,
|
|
25
|
+
hasValidState() {
|
|
26
|
+
return this.fetchState == 'Completed';
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const treasuryDetail = (0, toolkit_1.createSlice)({
|
|
30
|
+
name: 'treasuryDetail',
|
|
31
|
+
initialState: exports.initialState,
|
|
32
|
+
reducers: {
|
|
33
|
+
fetchTreasuryOverviewDetail: {
|
|
34
|
+
reducer(draft) {
|
|
35
|
+
draft.fetchState = 'In-Progress';
|
|
36
|
+
},
|
|
37
|
+
prepare(cacheOverride) {
|
|
38
|
+
return {
|
|
39
|
+
payload: {
|
|
40
|
+
cacheOverride,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
fetchTreasuryHistory(draft) {
|
|
46
|
+
draft.accountHistory = Object.assign(Object.assign({}, treasuryDetailState_1.initialAccountHistoryWithBalances), { fetchState: 'In-Progress', error: undefined });
|
|
47
|
+
},
|
|
48
|
+
fetchTreasuryHistorySuccess(draft, action) {
|
|
49
|
+
var _a;
|
|
50
|
+
const { data } = action.payload;
|
|
51
|
+
const accountEndOfDayBalances = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.account_end_of_day_balances;
|
|
52
|
+
if (accountEndOfDayBalances != null) {
|
|
53
|
+
const accountHistoryBalances = accountEndOfDayBalances.map((account) => (0, treasuryDetailPayload_1.mapAccountHistoryPayloadToAccountHistory)(account));
|
|
54
|
+
draft.accountHistory = {
|
|
55
|
+
fetchState: 'Completed',
|
|
56
|
+
error: undefined,
|
|
57
|
+
accountHistoryWithBalance: accountHistoryBalances,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
fetchTreasuryHistoryFailure(draft, action) {
|
|
62
|
+
const { error, fetchState } = action.payload;
|
|
63
|
+
draft.accountHistory = Object.assign(Object.assign({}, treasuryDetailState_1.initialAccountHistoryWithBalances), { fetchState: fetchState, error: error });
|
|
64
|
+
},
|
|
65
|
+
fetchTreasuryTransactionList: {
|
|
66
|
+
reducer(draft) {
|
|
67
|
+
draft.transactionsState = Object.assign(Object.assign({}, draft.transactionsState), { fetchState: 'In-Progress' });
|
|
68
|
+
},
|
|
69
|
+
prepare(cacheOverride, count) {
|
|
70
|
+
return {
|
|
71
|
+
payload: {
|
|
72
|
+
cacheOverride,
|
|
73
|
+
count,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
fetchTreasuryTransactionListSuccess(draft, action) {
|
|
79
|
+
const { transactionList } = action.payload;
|
|
80
|
+
draft.transactionsState = Object.assign(Object.assign({}, draft.transactionsState), { transactions: transactionList.map((tran) => {
|
|
81
|
+
var _a;
|
|
82
|
+
return ({
|
|
83
|
+
id: tran.transaction_id,
|
|
84
|
+
date: (0, zeniDayJS_1.date)(tran.date),
|
|
85
|
+
amount: {
|
|
86
|
+
amount: tran.amount,
|
|
87
|
+
currencyCode: tran.currency_code,
|
|
88
|
+
currencySymbol: tran.currency_symbol,
|
|
89
|
+
},
|
|
90
|
+
description: (_a = tran.description) !== null && _a !== void 0 ? _a : '', //temp until fixed from BE
|
|
91
|
+
status: tran.status,
|
|
92
|
+
});
|
|
93
|
+
}), fetchState: 'Completed', error: undefined });
|
|
94
|
+
},
|
|
95
|
+
fetchTreasuryTransactionListFailure(draft, action) {
|
|
96
|
+
const { error } = action.payload;
|
|
97
|
+
draft.transactionsState = Object.assign(Object.assign({}, draft.transactionsState), { fetchState: 'Error', error });
|
|
98
|
+
},
|
|
99
|
+
updateTreasuryTransactionList(draft, action) {
|
|
100
|
+
var _a;
|
|
101
|
+
const { transferTransaction } = action.payload;
|
|
102
|
+
const newTransaction = {
|
|
103
|
+
id: transferTransaction.transaction_id,
|
|
104
|
+
date: (0, zeniDayJS_1.date)(transferTransaction.date),
|
|
105
|
+
amount: (0, amount_1.toAmount)(transferTransaction.amount, transferTransaction.currency_code, transferTransaction.currency_symbol),
|
|
106
|
+
description: (_a = transferTransaction.description) !== null && _a !== void 0 ? _a : '',
|
|
107
|
+
status: transferTransaction.status,
|
|
108
|
+
};
|
|
109
|
+
// Add the new transaction to the top of the list
|
|
110
|
+
draft.transactionsState.transactions = [
|
|
111
|
+
newTransaction,
|
|
112
|
+
...draft.transactionsState.transactions,
|
|
113
|
+
];
|
|
114
|
+
},
|
|
115
|
+
fetchTreasurySummarySuccess(draft, action) {
|
|
116
|
+
const { data } = action.payload;
|
|
117
|
+
if (data === null || data === void 0 ? void 0 : data.data) {
|
|
118
|
+
const summary = {
|
|
119
|
+
totalBalance: (0, amount_1.toAmount)(data.data.treasury_account.total_balance.amount, data.data.treasury_account.total_balance.currency_code, data.data.treasury_account.total_balance.currency_symbol),
|
|
120
|
+
insuredFunds: (0, amount_1.toAmount)(data.data.treasury_account.insured_funds.amount, data.data.treasury_account.insured_funds.currency_code, data.data.treasury_account.insured_funds.currency_symbol),
|
|
121
|
+
totalYield: (0, amount_1.toAmount)(data.data.treasury_account.total_yield.amount, data.data.treasury_account.total_yield.currency_code, data.data.treasury_account.total_yield.currency_symbol),
|
|
122
|
+
thirtyDayPercentageYield: parseFloat(data.data.treasury_account.thirty_day_percentage_yield),
|
|
123
|
+
};
|
|
124
|
+
draft.accountSummary = summary;
|
|
125
|
+
draft.fetchState = 'Completed';
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
fetchTreasurySummaryFailure(draft, action) {
|
|
129
|
+
const { error } = action.payload;
|
|
130
|
+
draft.error = error;
|
|
131
|
+
},
|
|
132
|
+
updateTreasuryTransactionListUIState(draft, action) {
|
|
133
|
+
if (action.payload.uiState.sortKey != null) {
|
|
134
|
+
draft.transactionsState.uiState.sortKey =
|
|
135
|
+
action.payload.uiState.sortKey;
|
|
136
|
+
}
|
|
137
|
+
if (action.payload.uiState.sortOrder != null) {
|
|
138
|
+
draft.transactionsState.uiState.sortOrder =
|
|
139
|
+
action.payload.uiState.sortOrder;
|
|
140
|
+
}
|
|
141
|
+
if (action.payload.uiState.scrollYOffset != null) {
|
|
142
|
+
draft.transactionsState.uiState.scrollYOffset =
|
|
143
|
+
action.payload.uiState.scrollYOffset;
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
clearTreasuryOverviewDetail(draft) {
|
|
147
|
+
Object.assign(draft, exports.initialState);
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
_a = treasuryDetail.actions, exports.fetchTreasuryOverviewDetail = _a.fetchTreasuryOverviewDetail, exports.fetchTreasuryHistory = _a.fetchTreasuryHistory, exports.fetchTreasuryHistorySuccess = _a.fetchTreasuryHistorySuccess, exports.fetchTreasuryHistoryFailure = _a.fetchTreasuryHistoryFailure, exports.clearTreasuryOverviewDetail = _a.clearTreasuryOverviewDetail, exports.fetchTreasuryTransactionList = _a.fetchTreasuryTransactionList, exports.fetchTreasuryTransactionListSuccess = _a.fetchTreasuryTransactionListSuccess, exports.fetchTreasuryTransactionListFailure = _a.fetchTreasuryTransactionListFailure, exports.updateTreasuryTransactionList = _a.updateTreasuryTransactionList, exports.fetchTreasurySummarySuccess = _a.fetchTreasurySummarySuccess, exports.fetchTreasurySummaryFailure = _a.fetchTreasurySummaryFailure, exports.updateTreasuryTransactionListUIState = _a.updateTreasuryTransactionListUIState;
|
|
152
|
+
exports.default = treasuryDetail.reducer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FetchStateAndError } from '../../../../commonStateTypes/common';
|
|
2
|
+
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { AccountHistoryWithBalances, TreasuryListUIState, TreasurySummaryWithBalance, TreasuryTransaction } from './treasuryDetailState';
|
|
5
|
+
export interface TreasuryDetailSelectorView extends SelectorView {
|
|
6
|
+
accountHistory: AccountHistoryWithBalances;
|
|
7
|
+
transactions: TreasuryTransaction[];
|
|
8
|
+
transactionsFetchState: FetchStateAndError;
|
|
9
|
+
uiState: TreasuryListUIState;
|
|
10
|
+
accountSummaryFetchState: FetchStateAndError;
|
|
11
|
+
allocationPercentage: Record<string, number>;
|
|
12
|
+
accountSummary?: TreasurySummaryWithBalance;
|
|
13
|
+
}
|
|
14
|
+
export declare const getTreasuryDetail: (state: RootState) => TreasuryDetailSelectorView;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getTreasuryDetail = void 0;
|
|
7
|
+
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
|
+
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
9
|
+
const getTreasuryDetail = (state) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const { treasuryDetailState, treasurySetupViewState } = state;
|
|
12
|
+
const fetchStateAndError = {
|
|
13
|
+
fetchState: treasuryDetailState.fetchState,
|
|
14
|
+
error: treasuryDetailState.error,
|
|
15
|
+
};
|
|
16
|
+
const transactionsFetchStateAndError = {
|
|
17
|
+
fetchState: treasuryDetailState.transactionsState.fetchState,
|
|
18
|
+
error: treasuryDetailState.transactionsState.error,
|
|
19
|
+
};
|
|
20
|
+
const sortKey = treasuryDetailState.transactionsState.uiState.sortKey;
|
|
21
|
+
const sortOrder = (0, sortOrderPayload_1.getSortOrder)(treasuryDetailState.transactionsState.uiState.sortOrder);
|
|
22
|
+
const transactionsInOrder = (0, orderBy_1.default)(treasuryDetailState.transactionsState.transactions, (transaction) => getTransactionsBySortKey(transaction, sortKey), sortOrder);
|
|
23
|
+
return {
|
|
24
|
+
accountHistory: treasuryDetailState.accountHistory,
|
|
25
|
+
accountSummary: treasuryDetailState.accountSummary,
|
|
26
|
+
transactions: transactionsInOrder !== null && transactionsInOrder !== void 0 ? transactionsInOrder : [],
|
|
27
|
+
transactionsFetchState: transactionsFetchStateAndError,
|
|
28
|
+
allocationPercentage: (_a = treasurySetupViewState.currentAllocation.allocation) !== null && _a !== void 0 ? _a : {},
|
|
29
|
+
uiState: treasuryDetailState.transactionsState.uiState,
|
|
30
|
+
accountSummaryFetchState: fetchStateAndError,
|
|
31
|
+
fetchState: fetchStateAndError.fetchState,
|
|
32
|
+
error: fetchStateAndError.error,
|
|
33
|
+
version: 0,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.getTreasuryDetail = getTreasuryDetail;
|
|
37
|
+
const getTransactionsBySortKey = (transaction, sortKey) => {
|
|
38
|
+
switch (sortKey) {
|
|
39
|
+
case 'description':
|
|
40
|
+
return transaction.description.toLowerCase();
|
|
41
|
+
case 'date':
|
|
42
|
+
return transaction.date;
|
|
43
|
+
default:
|
|
44
|
+
return Number(transaction.amount.amount);
|
|
45
|
+
}
|
|
46
|
+
};
|