@zeniai/client-epic-state 4.18.92 → 4.18.93
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 +0 -4
- package/lib/commonStateTypes/classesView/getNestedClassIDHierarchyForReport.js +0 -2
- package/lib/commonStateTypes/classesView/nestedClassID.d.ts +0 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
- package/lib/entity/account/accountState.d.ts +1 -1
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -2
- package/lib/entity/chargeCard/chargeCard.js +0 -2
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +1 -2
- package/lib/entity/chargeCard/chargeCardPayload.js +9 -10
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.d.ts +2 -1
- package/lib/entity/class/classPayload.d.ts +0 -1
- package/lib/entity/class/classPayload.js +9 -9
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -2
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +0 -8
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +0 -14
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +0 -8
- 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 +8 -34
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +1 -1
- package/lib/entity/tenant/tenantReducer.js +2 -8
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/epic.d.ts +1 -13
- package/lib/epic.js +1 -13
- package/lib/index.d.ts +12 -14
- package/lib/index.js +30 -53
- package/lib/init.d.ts +1 -2
- package/lib/init.js +2 -3
- package/lib/responsePayload.d.ts +0 -3
- 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/classList/classListReducer.d.ts +1 -3
- package/lib/view/classList/classListReducer.js +3 -8
- package/lib/view/classList/fetchClassListEpic.js +2 -6
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.d.ts +1 -2
- package/lib/view/companyMonthEndReportView/companyMonthEndReportViewReducer.js +2 -10
- package/lib/view/companyMonthEndReportView/epics/fetchCompanyMonthEndReportViewEpic.js +4 -2
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/dashboard/dashboardSelector.d.ts +1 -2
- package/lib/view/dashboard/dashboardSelector.js +6 -14
- package/lib/view/dashboardLayout/dashboardLayoutReducer.js +0 -1
- package/lib/view/dashboardLayout/fetchDashboardLayoutEpic.js +1 -14
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +1 -3
- package/lib/view/expenseAutomationView/helpers/helpers.d.ts +3 -3
- package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +6 -5
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +64 -46
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthEndCloseChecksEpic.js +1 -1
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewPayload.d.ts +0 -8
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.d.ts +1 -11
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewReducer.js +3 -47
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.d.ts +0 -3
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +13 -18
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewState.d.ts +1 -7
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +4 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +2 -17
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +3 -38
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +1 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -40
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +26 -189
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +1 -19
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +12 -87
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +4 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +0 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +4 -34
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +3 -142
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +0 -46
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +4 -198
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +0 -18
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +2 -24
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +0 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/zeniAPI.d.ts +1 -12
- package/lib/zeniAPI.js +6 -33
- package/package.json +1 -1
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthClosePerformanceTrendEpic.d.ts +0 -7
- package/lib/view/monthEndCloseChecksView/epics/fetchMonthClosePerformanceTrendEpic.js +0 -47
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/closeChargeCardEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/closeChargeCardEpic.js +0 -71
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardsRecurringExpensesEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardsRecurringExpensesEpic.js +0 -44
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/lockChargeCardEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/lockChargeCardEpic.js +0 -78
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/unlockChargeCardEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/unlockChargeCardEpic.js +0 -75
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardNameEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardNameEpic.js +0 -83
- package/lib/view/spendManagement/chargeCards/chargeCardList/closeChargeCardsEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardList/closeChargeCardsEpic.js +0 -69
- package/lib/view/spendManagement/chargeCards/chargeCardList/lockChargeCardsEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardList/lockChargeCardsEpic.js +0 -69
- package/lib/view/spendManagement/chargeCards/chargeCardList/revokeChargeCardsInviteEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/chargeCardList/revokeChargeCardsInviteEpic.js +0 -71
- package/lib/view/spendManagement/chargeCards/chargeCardList/unlockChargeCardsEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardList/unlockChargeCardsEpic.js +0 -68
- package/lib/view/spendManagement/chargeCards/chargeCardList/updateChargeCardsLimitEpic.d.ts +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardList/updateChargeCardsLimitEpic.js +0 -76
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryVideoViewedEpic.js +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
-
import {
|
|
2
|
+
import { ID } from '../../../../commonStateTypes/common';
|
|
3
3
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
4
4
|
import { ZeniDate } from '../../../../zeniDayJS';
|
|
5
5
|
import { ChargeCardListState, ChargeCardListUIState } from './chargeCardList';
|
|
@@ -13,10 +13,10 @@ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionC
|
|
|
13
13
|
}, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccountRepayment">, updateCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountRepaymentPayload, "chargeCardList/updateCreditAccountRepayment">, updateCreditAccountRepaymentFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountRepaymentFailure">, updateCreditAccountRepaymentAmountAndDate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
14
|
amount: Amount;
|
|
15
15
|
date: ZeniDate;
|
|
16
|
-
}, "chargeCardList/updateCreditAccountRepaymentAmountAndDate">,
|
|
16
|
+
}, "chargeCardList/updateCreditAccountRepaymentAmountAndDate">, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccount">, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchDebitCardSummary">, updateDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPayload<DebitCardSummariesPayload, "chargeCardList/updateDebitCardSummary">, updateDebitCardSummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateDebitCardSummaryFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchChargeCardList">, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
17
|
chargeCardListPayload: ChargeCardListPayload;
|
|
18
18
|
keepExistingListItems?: boolean;
|
|
19
|
-
}, "chargeCardList/updateChargeCardList">, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateChargeCardListFailure">, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/updateSearchText">,
|
|
19
|
+
}, "chargeCardList/updateChargeCardList">, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateChargeCardListFailure">, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/updateSearchText">, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
20
|
uiState: Partial<ChargeCardListUIState>;
|
|
21
21
|
}, "chargeCardList/updateChargeCardListUIState">, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/clearChargeCardList">, resendCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
|
|
22
22
|
cardId: string;
|
|
@@ -24,36 +24,6 @@ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionC
|
|
|
24
24
|
cardId: ID;
|
|
25
25
|
}, "chargeCardList/resendCardInviteSuccess">, resendCardInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/resendCardInviteFailure">, revokeCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
|
|
26
26
|
cardId: string;
|
|
27
|
-
}, "chargeCardList/revokeCardInvite", never, never>, revokeCardInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/revokeCardInviteSuccess">, revokeCardInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/revokeCardInviteFailure"
|
|
28
|
-
chargeCardIds: string[];
|
|
29
|
-
updatedSpendLimit: Amount;
|
|
30
|
-
frequency: string;
|
|
31
|
-
}, "chargeCardList/updateChargeCardsSpendLimit", never, never>, updateChargeCardsSpendLimitSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
32
|
-
fetchState: FetchState;
|
|
33
|
-
error?: ZeniAPIStatus;
|
|
34
|
-
}, "chargeCardList/updateChargeCardsSpendLimitSuccessOrFailure">, lockChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardIds: string[], reason?: string | undefined], {
|
|
35
|
-
cardIds: string[];
|
|
36
|
-
reason: string | undefined;
|
|
37
|
-
}, "chargeCardList/lockChargeCards", never, never>, lockChargeCardsSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
38
|
-
fetchState: FetchState;
|
|
39
|
-
error?: ZeniAPIStatus;
|
|
40
|
-
}, "chargeCardList/lockChargeCardsSuccessOrFailure">, unlockChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardIds: string[]], {
|
|
41
|
-
cardIds: string[];
|
|
42
|
-
}, "chargeCardList/unlockChargeCards", never, never>, unlockChargeCardsSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
43
|
-
fetchState: FetchState;
|
|
44
|
-
error?: ZeniAPIStatus;
|
|
45
|
-
}, "chargeCardList/unlockChargeCardsSuccessOrFailure">, closeChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardIds: string[], reason?: string | undefined], {
|
|
46
|
-
cardIds: string[];
|
|
47
|
-
reason: string | undefined;
|
|
48
|
-
}, "chargeCardList/closeChargeCards", never, never>, closeChargeCardsSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
49
|
-
fetchState: FetchState;
|
|
50
|
-
error?: ZeniAPIStatus;
|
|
51
|
-
}, "chargeCardList/closeChargeCardsSuccessOrFailure">, revokeChargeCardsInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardIds: string[]], {
|
|
52
|
-
cardIds: string[];
|
|
53
|
-
}, "chargeCardList/revokeChargeCardsInvite", never, never>, revokeChargeCardsInviteSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
54
|
-
fetchState: FetchState;
|
|
55
|
-
revokedCardIds: ID[];
|
|
56
|
-
error?: ZeniAPIStatus;
|
|
57
|
-
}, "chargeCardList/revokeChargeCardsInviteSuccessOrFailure">;
|
|
27
|
+
}, "chargeCardList/revokeCardInvite", never, never>, revokeCardInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/revokeCardInviteSuccess">, revokeCardInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/revokeCardInviteFailure">;
|
|
58
28
|
declare const _default: import("redux").Reducer<ChargeCardListState>;
|
|
59
29
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.updateCreditAccountRepaymentAmountAndDate = exports.updateCreditAccountRepaymentFailure = exports.updateCreditAccountRepayment = exports.fetchCreditAccountRepayment = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
7
7
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -9,33 +9,11 @@ const chargeCardList_1 = require("./chargeCardList");
|
|
|
9
9
|
exports.initialState = {
|
|
10
10
|
fetchState: 'Not-Started',
|
|
11
11
|
error: undefined,
|
|
12
|
-
bulkActionCardIds: [],
|
|
13
12
|
cardIds: [],
|
|
14
13
|
searchText: '',
|
|
15
14
|
unAssignedCredits: undefined,
|
|
16
|
-
rowActionCardId: undefined,
|
|
17
15
|
creditAccount: chargeCardList_1.initialCreditAcc,
|
|
18
16
|
debitCardSummaries: chargeCardList_1.initialDebitCardSummaries,
|
|
19
|
-
updateChargeCardsSpendLimitFetchState: {
|
|
20
|
-
fetchState: 'Not-Started',
|
|
21
|
-
error: undefined,
|
|
22
|
-
},
|
|
23
|
-
lockChargeCardsFetchState: {
|
|
24
|
-
fetchState: 'Not-Started',
|
|
25
|
-
error: undefined,
|
|
26
|
-
},
|
|
27
|
-
unlockChargeCardsFetchState: {
|
|
28
|
-
fetchState: 'Not-Started',
|
|
29
|
-
error: undefined,
|
|
30
|
-
},
|
|
31
|
-
closeChargeCardsFetchState: {
|
|
32
|
-
fetchState: 'Not-Started',
|
|
33
|
-
error: undefined,
|
|
34
|
-
},
|
|
35
|
-
revokeChargeCardsInviteFetchState: {
|
|
36
|
-
fetchState: 'Not-Started',
|
|
37
|
-
error: undefined,
|
|
38
|
-
},
|
|
39
17
|
hasValidState() {
|
|
40
18
|
return this.fetchState == 'Completed';
|
|
41
19
|
},
|
|
@@ -80,9 +58,6 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
80
58
|
updateCreditAccountRepaymentFailure(draft, action) {
|
|
81
59
|
draft.creditAccountRepayment = Object.assign(Object.assign({}, chargeCardList_1.initialCreditAccountRepayment), { fetchState: 'Error', error: action.payload });
|
|
82
60
|
},
|
|
83
|
-
updateRowActionCardId(draft, action) {
|
|
84
|
-
draft.rowActionCardId = action.payload;
|
|
85
|
-
},
|
|
86
61
|
fetchCreditAccount(draft) {
|
|
87
62
|
draft.creditAccount.fetchState = 'In-Progress';
|
|
88
63
|
draft.creditAccount.error = undefined;
|
|
@@ -130,9 +105,6 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
130
105
|
updateSearchText(draft, action) {
|
|
131
106
|
draft.searchText = action.payload;
|
|
132
107
|
},
|
|
133
|
-
updateBulkActionCardIds(draft, action) {
|
|
134
|
-
draft.bulkActionCardIds = action.payload;
|
|
135
|
-
},
|
|
136
108
|
updateChargeCardListUIState(draft, action) {
|
|
137
109
|
if (action.payload.uiState.sortKey != null) {
|
|
138
110
|
draft.uiState.sortKey = action.payload.uiState.sortKey;
|
|
@@ -153,7 +125,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
153
125
|
},
|
|
154
126
|
reducer(draft, action) {
|
|
155
127
|
draft.resendCardInvite.cardId = action.payload.cardId;
|
|
156
|
-
draft.
|
|
128
|
+
draft.revokeCardInvite.saveStatus.fetchState = 'In-Progress';
|
|
157
129
|
},
|
|
158
130
|
},
|
|
159
131
|
resendCardInviteSuccess(draft, action) {
|
|
@@ -186,120 +158,9 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
186
158
|
draft.revokeCardInvite.saveStatus.fetchState = 'Error';
|
|
187
159
|
draft.revokeCardInvite.saveStatus.error = action.payload;
|
|
188
160
|
},
|
|
189
|
-
updateChargeCardsSpendLimit: {
|
|
190
|
-
reducer(draft) {
|
|
191
|
-
draft.updateChargeCardsSpendLimitFetchState = {
|
|
192
|
-
fetchState: 'In-Progress',
|
|
193
|
-
error: undefined,
|
|
194
|
-
};
|
|
195
|
-
},
|
|
196
|
-
prepare(chargeCardIds, updatedSpendLimit, frequency) {
|
|
197
|
-
return {
|
|
198
|
-
payload: {
|
|
199
|
-
chargeCardIds,
|
|
200
|
-
updatedSpendLimit,
|
|
201
|
-
frequency,
|
|
202
|
-
},
|
|
203
|
-
};
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
updateChargeCardsSpendLimitSuccessOrFailure(draft, action) {
|
|
207
|
-
draft.updateChargeCardsSpendLimitFetchState = {
|
|
208
|
-
fetchState: action.payload.fetchState,
|
|
209
|
-
error: action.payload.error,
|
|
210
|
-
};
|
|
211
|
-
},
|
|
212
|
-
lockChargeCards: {
|
|
213
|
-
reducer(draft) {
|
|
214
|
-
draft.lockChargeCardsFetchState = {
|
|
215
|
-
fetchState: 'In-Progress',
|
|
216
|
-
error: undefined,
|
|
217
|
-
};
|
|
218
|
-
},
|
|
219
|
-
prepare(cardIds, reason) {
|
|
220
|
-
return {
|
|
221
|
-
payload: {
|
|
222
|
-
cardIds,
|
|
223
|
-
reason,
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
lockChargeCardsSuccessOrFailure(draft, action) {
|
|
229
|
-
draft.lockChargeCardsFetchState = {
|
|
230
|
-
fetchState: action.payload.fetchState,
|
|
231
|
-
error: action.payload.error,
|
|
232
|
-
};
|
|
233
|
-
},
|
|
234
|
-
closeChargeCards: {
|
|
235
|
-
reducer(draft) {
|
|
236
|
-
draft.closeChargeCardsFetchState = {
|
|
237
|
-
fetchState: 'In-Progress',
|
|
238
|
-
error: undefined,
|
|
239
|
-
};
|
|
240
|
-
},
|
|
241
|
-
prepare(cardIds, reason) {
|
|
242
|
-
return {
|
|
243
|
-
payload: {
|
|
244
|
-
cardIds,
|
|
245
|
-
reason,
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
closeChargeCardsSuccessOrFailure(draft, action) {
|
|
251
|
-
draft.closeChargeCardsFetchState = {
|
|
252
|
-
fetchState: action.payload.fetchState,
|
|
253
|
-
error: action.payload.error,
|
|
254
|
-
};
|
|
255
|
-
},
|
|
256
|
-
unlockChargeCards: {
|
|
257
|
-
reducer(draft) {
|
|
258
|
-
draft.unlockChargeCardsFetchState = {
|
|
259
|
-
fetchState: 'In-Progress',
|
|
260
|
-
error: undefined,
|
|
261
|
-
};
|
|
262
|
-
},
|
|
263
|
-
prepare(cardIds) {
|
|
264
|
-
return {
|
|
265
|
-
payload: {
|
|
266
|
-
cardIds,
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
unlockChargeCardsSuccessOrFailure(draft, action) {
|
|
272
|
-
draft.unlockChargeCardsFetchState = {
|
|
273
|
-
fetchState: action.payload.fetchState,
|
|
274
|
-
error: action.payload.error,
|
|
275
|
-
};
|
|
276
|
-
},
|
|
277
|
-
revokeChargeCardsInvite: {
|
|
278
|
-
reducer(draft) {
|
|
279
|
-
draft.revokeChargeCardsInviteFetchState = {
|
|
280
|
-
fetchState: 'In-Progress',
|
|
281
|
-
error: undefined,
|
|
282
|
-
};
|
|
283
|
-
},
|
|
284
|
-
prepare(cardIds) {
|
|
285
|
-
return {
|
|
286
|
-
payload: {
|
|
287
|
-
cardIds,
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
revokeChargeCardsInviteSuccessOrFailure(draft, action) {
|
|
293
|
-
draft.revokeChargeCardsInviteFetchState = {
|
|
294
|
-
fetchState: action.payload.fetchState,
|
|
295
|
-
error: action.payload.error,
|
|
296
|
-
};
|
|
297
|
-
// Remove successfully revoked cards from the list
|
|
298
|
-
draft.cardIds = draft.cardIds.filter((cardId) => !action.payload.revokedCardIds.includes(cardId));
|
|
299
|
-
},
|
|
300
161
|
},
|
|
301
162
|
});
|
|
302
|
-
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.
|
|
163
|
+
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure;
|
|
303
164
|
exports.default = chargeCardList.reducer;
|
|
304
165
|
// helper
|
|
305
166
|
const toCreditAccount = (payload) => ({
|
|
@@ -10,8 +10,6 @@ import { UserRole } from '../../../../entity/userRole/userRoleState';
|
|
|
10
10
|
import { RootState } from '../../../../reducer';
|
|
11
11
|
import { Person } from '../../../people/peopleSelectorTypes';
|
|
12
12
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
13
|
-
import { RecurringExpense } from '../chargeCardDetail/chargeCardDetail';
|
|
14
|
-
import { ChargeCardControlDetailView } from '../chargeCardDetail/chargeCardDetailSelector';
|
|
15
13
|
import { ChargeCardListUIState, CreditAccount, CreditAccountRepayment, DebitCardSummaries, ResendRevokeCardInvite } from './chargeCardList';
|
|
16
14
|
export interface ChargeCardWithUser extends ChargeCard {
|
|
17
15
|
billingAddress: Address;
|
|
@@ -28,21 +26,16 @@ export interface ChargeCardListSelectorView extends SelectorView {
|
|
|
28
26
|
allAccountingClasses: Class[];
|
|
29
27
|
cards: ChargeCardWithUser[];
|
|
30
28
|
chargeCardConfig: ChargeCardConfigState;
|
|
31
|
-
closeChargeCardsFetchState: FetchStateAndError;
|
|
32
29
|
creditAccount: CreditAccount;
|
|
33
30
|
creditAccountRepayment: CreditAccountRepayment;
|
|
34
31
|
hasCreditCard: boolean;
|
|
35
32
|
hasDebitCard: boolean;
|
|
36
33
|
issueCardPageFetchState: FetchStateAndError;
|
|
37
|
-
lockChargeCardsFetchState: FetchStateAndError;
|
|
38
34
|
resendCardInvite: ResendRevokeCardInvite;
|
|
39
35
|
revokeCardInvite: ResendRevokeCardInvite;
|
|
40
|
-
revokeChargeCardsInviteFetchState: FetchStateAndError;
|
|
41
36
|
searchText: string;
|
|
42
37
|
totalCashback: Amount;
|
|
43
38
|
uiState: ChargeCardListUIState;
|
|
44
|
-
unlockChargeCardsFetchState: FetchStateAndError;
|
|
45
|
-
updateChargeCardsSpendLimitFetchState: FetchStateAndError;
|
|
46
39
|
userList: Person[];
|
|
47
40
|
debitCardSummary?: DebitCardSummaries;
|
|
48
41
|
unAssignedCredits?: Amount;
|
|
@@ -74,42 +67,3 @@ export interface DebitCardListSelectorView extends FetchStateAndError {
|
|
|
74
67
|
}
|
|
75
68
|
export declare const getDebitCardList: (state: RootState) => DebitCardListSelectorView;
|
|
76
69
|
export declare const getDebitCardSummary: (state: RootState) => DebitCardSummaries;
|
|
77
|
-
export interface ChargeCardRecurringExpensesByCardIds extends FetchStateAndError {
|
|
78
|
-
recurringExpensesByChargeCardId: Record<ID, RecurringExpense[]>;
|
|
79
|
-
}
|
|
80
|
-
export declare const getChargeCardRecurringExpensesByCardIds: (state: RootState, chargeCardIds: ID[]) => ChargeCardRecurringExpensesByCardIds;
|
|
81
|
-
/**
|
|
82
|
-
* Memoized selector for row action card data
|
|
83
|
-
* Combines ChargeCardControlDetailView, depositAccountLimit, and recurringExpenses
|
|
84
|
-
* based on the rowActionCardId from chargeCardListState
|
|
85
|
-
*/
|
|
86
|
-
export interface ChargeCardRowActionView extends ChargeCardControlDetailView {
|
|
87
|
-
depositAccountLimitFetchState: FetchStateAndError;
|
|
88
|
-
recurringExpenses: RecurringExpense[];
|
|
89
|
-
recurringExpensesFetchState: FetchStateAndError;
|
|
90
|
-
cardId?: ID;
|
|
91
|
-
chargeCard?: ChargeCardWithUser;
|
|
92
|
-
depositAccountLimit?: DepositAccountWithLimit;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Memoized selector that returns row action card data
|
|
96
|
-
* Only recomputes when relevant parts of state change
|
|
97
|
-
*/
|
|
98
|
-
export declare const getChargeCardRowActionView: (state: RootState) => ChargeCardRowActionView;
|
|
99
|
-
/**
|
|
100
|
-
* Memoized selector for bulk action cards data
|
|
101
|
-
* Returns data for all cards selected in bulkActionCardIds
|
|
102
|
-
*/
|
|
103
|
-
export interface ChargeCardBulkActionView {
|
|
104
|
-
bulkActionCardIds: ID[];
|
|
105
|
-
chargeCards: ChargeCardWithUser[];
|
|
106
|
-
hasCreditCards: boolean;
|
|
107
|
-
hasDebitCards: boolean;
|
|
108
|
-
recurringExpensesByCardId: Record<ID, RecurringExpense[]>;
|
|
109
|
-
recurringExpensesFetchState: FetchStateAndError;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Memoized selector that returns bulk action cards data
|
|
113
|
-
* Only recomputes when relevant parts of state change
|
|
114
|
-
*/
|
|
115
|
-
export declare const getChargeCardBulkActionView: (state: RootState) => ChargeCardBulkActionView;
|
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.getDebitCardSummary = exports.getDebitCardList = exports.getDepositAccountListWithDebitCardIssued = exports.getCreditAccountDetails = exports.anyCardOnHold = exports.getMyRequestOnHoldChargeCardListWithShippingAddress = exports.getMyPendingActivationChargeCardListView = exports.getChargeCardListView = void 0;
|
|
8
7
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
8
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
10
9
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
@@ -15,7 +14,6 @@ const depositAccountSelector_1 = require("../../../../entity/depositAccount/depo
|
|
|
15
14
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
16
15
|
const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
|
|
17
16
|
const userListViewSelector_1 = require("../../../userListView/userListViewSelector");
|
|
18
|
-
const chargeCardDetailSelector_1 = require("../chargeCardDetail/chargeCardDetailSelector");
|
|
19
17
|
const getChargeCardListView = (state, includeCreditAccountDebitSummaryAndCashbackInfo, isDebitCardEnabled, isCreditCardEnabled) => {
|
|
20
18
|
const { chargeCardListState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, classListState, cashbackDetailState, userListViewState, } = state;
|
|
21
19
|
const searchText = chargeCardListState.searchText.toLowerCase();
|
|
@@ -78,16 +76,11 @@ const getChargeCardListView = (state, includeCreditAccountDebitSummaryAndCashbac
|
|
|
78
76
|
userList,
|
|
79
77
|
allAccountingClasses,
|
|
80
78
|
issueCardPageFetchState,
|
|
81
|
-
closeChargeCardsFetchState: chargeCardListState.closeChargeCardsFetchState,
|
|
82
|
-
lockChargeCardsFetchState: chargeCardListState.lockChargeCardsFetchState,
|
|
83
|
-
resendCardInvite: chargeCardListState.resendCardInvite,
|
|
84
|
-
revokeCardInvite: chargeCardListState.revokeCardInvite,
|
|
85
|
-
revokeChargeCardsInviteFetchState: chargeCardListState.revokeChargeCardsInviteFetchState,
|
|
86
|
-
searchText,
|
|
87
|
-
unlockChargeCardsFetchState: chargeCardListState.unlockChargeCardsFetchState,
|
|
88
|
-
updateChargeCardsSpendLimitFetchState: chargeCardListState.updateChargeCardsSpendLimitFetchState,
|
|
89
79
|
uiState: chargeCardListState.uiState,
|
|
80
|
+
searchText,
|
|
90
81
|
version: '1.0',
|
|
82
|
+
resendCardInvite: chargeCardListState.resendCardInvite,
|
|
83
|
+
revokeCardInvite: chargeCardListState.revokeCardInvite,
|
|
91
84
|
debitCardSummary: chargeCardListState.debitCardSummaries,
|
|
92
85
|
hasCreditCard,
|
|
93
86
|
hasDebitCard,
|
|
@@ -240,190 +233,3 @@ const getCardsBySortKey = (card, sortKey) => {
|
|
|
240
233
|
return card.limit.amount;
|
|
241
234
|
}
|
|
242
235
|
};
|
|
243
|
-
const getChargeCardRecurringExpensesByCardIds = (state, chargeCardIds) => {
|
|
244
|
-
const { chargeCardDetailState } = state;
|
|
245
|
-
const recurringExpensesByChargeCardId = {};
|
|
246
|
-
chargeCardIds.forEach((cardId) => {
|
|
247
|
-
var _a;
|
|
248
|
-
recurringExpensesByChargeCardId[cardId] =
|
|
249
|
-
(_a = chargeCardDetailState.recurringExpensesByChargeCardId[cardId]) !== null && _a !== void 0 ? _a : [];
|
|
250
|
-
});
|
|
251
|
-
const recurringExpensesFetchState = chargeCardDetailState.recurringExpensesFetchState;
|
|
252
|
-
return {
|
|
253
|
-
fetchState: recurringExpensesFetchState.fetchState,
|
|
254
|
-
error: recurringExpensesFetchState.error,
|
|
255
|
-
recurringExpensesByChargeCardId,
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
exports.getChargeCardRecurringExpensesByCardIds = getChargeCardRecurringExpensesByCardIds;
|
|
259
|
-
// Selector to get rowActionCardId from state
|
|
260
|
-
const selectRowActionCardId = (state) => state.chargeCardListState.rowActionCardId;
|
|
261
|
-
// Selector to get chargeCardDetailState
|
|
262
|
-
const selectChargeCardDetailState = (state) => state.chargeCardDetailState;
|
|
263
|
-
// Selector to get depositAccountState
|
|
264
|
-
const selectDepositAccountState = (state) => state.depositAccountState;
|
|
265
|
-
// Selector to get chargeCardState
|
|
266
|
-
const selectChargeCardState = (state) => state.chargeCardState;
|
|
267
|
-
/**
|
|
268
|
-
* Memoized selector that returns row action card data
|
|
269
|
-
* Only recomputes when relevant parts of state change
|
|
270
|
-
*/
|
|
271
|
-
exports.getChargeCardRowActionView = (0, toolkit_1.createSelector)([
|
|
272
|
-
selectRowActionCardId,
|
|
273
|
-
selectChargeCardDetailState,
|
|
274
|
-
selectDepositAccountState,
|
|
275
|
-
selectChargeCardState,
|
|
276
|
-
(state) => state.chargeCardListState,
|
|
277
|
-
(state) => state.userState,
|
|
278
|
-
(state) => state.userRoleState,
|
|
279
|
-
(state) => state.classState,
|
|
280
|
-
(state) => state.addressState,
|
|
281
|
-
], (rowActionCardId, chargeCardDetailState, depositAccountState, chargeCardState, chargeCardListState, userState, userRoleState, classState, addressState) => {
|
|
282
|
-
var _a;
|
|
283
|
-
// If no rowActionCardId, return empty state
|
|
284
|
-
if (rowActionCardId == null) {
|
|
285
|
-
return {
|
|
286
|
-
closeChargeCardsFetchState: {
|
|
287
|
-
fetchState: 'Not-Started',
|
|
288
|
-
error: undefined,
|
|
289
|
-
},
|
|
290
|
-
lockChargeCardsFetchState: {
|
|
291
|
-
fetchState: 'Not-Started',
|
|
292
|
-
error: undefined,
|
|
293
|
-
},
|
|
294
|
-
unlockChargeCardsFetchState: {
|
|
295
|
-
fetchState: 'Not-Started',
|
|
296
|
-
error: undefined,
|
|
297
|
-
},
|
|
298
|
-
revokeChargeCardFetchState: {
|
|
299
|
-
fetchState: 'Not-Started',
|
|
300
|
-
error: undefined,
|
|
301
|
-
},
|
|
302
|
-
updateChargeCardLimitFetchState: {
|
|
303
|
-
fetchState: 'Not-Started',
|
|
304
|
-
error: undefined,
|
|
305
|
-
},
|
|
306
|
-
updateChargeCardNameFetchState: {
|
|
307
|
-
fetchState: 'Not-Started',
|
|
308
|
-
error: undefined,
|
|
309
|
-
},
|
|
310
|
-
depositAccountLimitFetchState: {
|
|
311
|
-
fetchState: 'Not-Started',
|
|
312
|
-
error: undefined,
|
|
313
|
-
},
|
|
314
|
-
recurringExpenses: [],
|
|
315
|
-
recurringExpensesFetchState: {
|
|
316
|
-
fetchState: 'Not-Started',
|
|
317
|
-
error: undefined,
|
|
318
|
-
},
|
|
319
|
-
cardId: undefined,
|
|
320
|
-
chargeCard: undefined,
|
|
321
|
-
depositAccountLimit: undefined,
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
// Reconstruct a minimal state object for helper functions
|
|
325
|
-
const stateSubset = {
|
|
326
|
-
userState,
|
|
327
|
-
userRoleState,
|
|
328
|
-
classState,
|
|
329
|
-
addressState,
|
|
330
|
-
chargeCardDetailState,
|
|
331
|
-
chargeCardListState,
|
|
332
|
-
};
|
|
333
|
-
// Get charge card (base entity)
|
|
334
|
-
const chargeCardBase = (0, chargeCardSelector_1.getChargeCardById)(chargeCardState, rowActionCardId);
|
|
335
|
-
// Get enriched ChargeCardWithUser
|
|
336
|
-
let chargeCard = undefined;
|
|
337
|
-
if (chargeCardBase != null) {
|
|
338
|
-
const enrichedCards = getChargeCardsWithUser([chargeCardBase], stateSubset);
|
|
339
|
-
chargeCard = enrichedCards[0];
|
|
340
|
-
}
|
|
341
|
-
// Get control detail view
|
|
342
|
-
const controlDetailView = (0, chargeCardDetailSelector_1.getChargeCardControlDetailView)(stateSubset, rowActionCardId);
|
|
343
|
-
// Get deposit account limit (for debit cards)
|
|
344
|
-
let depositAccountLimit = undefined;
|
|
345
|
-
let depositAccountLimitFetchState = {
|
|
346
|
-
fetchState: 'Not-Started',
|
|
347
|
-
error: undefined,
|
|
348
|
-
};
|
|
349
|
-
if ((chargeCardBase === null || chargeCardBase === void 0 ? void 0 : chargeCardBase.type.code.includes('debit')) === true) {
|
|
350
|
-
depositAccountLimit =
|
|
351
|
-
(0, depositAccountSelector_1.getDepositAccountLimitForChargeCardByDepositAccountId)(depositAccountState, chargeCardBase.connectedAccountId);
|
|
352
|
-
depositAccountLimitFetchState =
|
|
353
|
-
(0, chargeCardDetailSelector_1.getDepositAccountLimitFetchStateByDepositAccountId)(stateSubset, chargeCardBase.connectedAccountId);
|
|
354
|
-
}
|
|
355
|
-
// Get recurring expenses
|
|
356
|
-
const recurringExpenses = (_a = chargeCardDetailState.recurringExpensesByChargeCardId[rowActionCardId]) !== null && _a !== void 0 ? _a : [];
|
|
357
|
-
const recurringExpensesFetchState = chargeCardDetailState.recurringExpensesFetchState;
|
|
358
|
-
return Object.assign(Object.assign({}, controlDetailView), { depositAccountLimitFetchState,
|
|
359
|
-
recurringExpenses, recurringExpensesFetchState: {
|
|
360
|
-
fetchState: recurringExpensesFetchState.fetchState,
|
|
361
|
-
error: recurringExpensesFetchState.error,
|
|
362
|
-
}, cardId: rowActionCardId, chargeCard,
|
|
363
|
-
depositAccountLimit });
|
|
364
|
-
});
|
|
365
|
-
// Selector to get bulkActionCardIds from state
|
|
366
|
-
const selectBulkActionCardIds = (state) => state.chargeCardListState.bulkActionCardIds;
|
|
367
|
-
/**
|
|
368
|
-
* Memoized selector that returns bulk action cards data
|
|
369
|
-
* Only recomputes when relevant parts of state change
|
|
370
|
-
*/
|
|
371
|
-
exports.getChargeCardBulkActionView = (0, toolkit_1.createSelector)([
|
|
372
|
-
selectBulkActionCardIds,
|
|
373
|
-
selectChargeCardState,
|
|
374
|
-
selectChargeCardDetailState,
|
|
375
|
-
(state) => state.userState,
|
|
376
|
-
(state) => state.userRoleState,
|
|
377
|
-
(state) => state.classState,
|
|
378
|
-
(state) => state.addressState,
|
|
379
|
-
], (bulkActionCardIds, chargeCardState, chargeCardDetailState, userState, userRoleState, classState, addressState) => {
|
|
380
|
-
// If no cards selected, return empty state
|
|
381
|
-
if (bulkActionCardIds.length === 0) {
|
|
382
|
-
return {
|
|
383
|
-
bulkActionCardIds: [],
|
|
384
|
-
chargeCards: [],
|
|
385
|
-
hasCreditCards: false,
|
|
386
|
-
hasDebitCards: false,
|
|
387
|
-
recurringExpensesByCardId: {},
|
|
388
|
-
recurringExpensesFetchState: {
|
|
389
|
-
fetchState: 'Not-Started',
|
|
390
|
-
error: undefined,
|
|
391
|
-
},
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
// Reconstruct a minimal state object for helper functions
|
|
395
|
-
const stateSubset = {
|
|
396
|
-
userState,
|
|
397
|
-
userRoleState,
|
|
398
|
-
classState,
|
|
399
|
-
addressState,
|
|
400
|
-
};
|
|
401
|
-
// Get all selected charge cards (base entities)
|
|
402
|
-
const chargeCardsBase = bulkActionCardIds
|
|
403
|
-
.map((cardId) => (0, chargeCardSelector_1.getChargeCardById)(chargeCardState, cardId))
|
|
404
|
-
.filter((card) => card != null);
|
|
405
|
-
// Get enriched ChargeCardWithUser array
|
|
406
|
-
const chargeCards = getChargeCardsWithUser(chargeCardsBase, stateSubset);
|
|
407
|
-
// Get recurring expenses for all selected cards
|
|
408
|
-
const recurringExpensesByCardId = {};
|
|
409
|
-
bulkActionCardIds.forEach((cardId) => {
|
|
410
|
-
var _a;
|
|
411
|
-
recurringExpensesByCardId[cardId] =
|
|
412
|
-
(_a = chargeCardDetailState.recurringExpensesByChargeCardId[cardId]) !== null && _a !== void 0 ? _a : [];
|
|
413
|
-
});
|
|
414
|
-
// Determine if selection contains debit or credit cards
|
|
415
|
-
const hasDebitCards = chargeCards.some((card) => card.type.code.includes('debit'));
|
|
416
|
-
const hasCreditCards = chargeCards.some((card) => card.type.code.includes('credit'));
|
|
417
|
-
const recurringExpensesFetchState = chargeCardDetailState.recurringExpensesFetchState;
|
|
418
|
-
return {
|
|
419
|
-
bulkActionCardIds,
|
|
420
|
-
chargeCards,
|
|
421
|
-
hasCreditCards,
|
|
422
|
-
hasDebitCards,
|
|
423
|
-
recurringExpensesByCardId,
|
|
424
|
-
recurringExpensesFetchState: {
|
|
425
|
-
fetchState: recurringExpensesFetchState.fetchState,
|
|
426
|
-
error: recurringExpensesFetchState.error,
|
|
427
|
-
},
|
|
428
|
-
};
|
|
429
|
-
});
|
package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ import { fetchClassList } from '../../../classList/classListReducer';
|
|
|
5
5
|
import { fetchUserListByType } from '../../../userListView/userListViewReducer';
|
|
6
6
|
import { fetchCashbackDetail } from '../cashbackDetail/cashbackDetailReducer';
|
|
7
7
|
import { fetchChargeCardConfig } from '../chargeCardConfig/chargeCardConfigReducer';
|
|
8
|
-
import { fetchChargeCardSetupView } from '../chargeCardSetUp/chargeCardSetUpViewReducer';
|
|
9
|
-
import { fetchDepositAccountListForCards } from '../issueChargeCard/issueChargeCardReducer';
|
|
10
8
|
import { fetchChargeCardList, fetchChargeCardListPage, fetchCreditAccount, fetchCreditAccountRepayment, fetchDebitCardSummary } from './chargeCardListReducer';
|
|
11
|
-
export type ActionType = ReturnType<typeof fetchChargeCardListPage> | ReturnType<typeof fetchCreditAccount> | ReturnType<typeof fetchChargeCardList> | ReturnType<typeof fetchChargeCardConfig> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchCashbackDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchDebitCardSummary> | ReturnType<typeof fetchCreditAccountRepayment
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchChargeCardListPage> | ReturnType<typeof fetchCreditAccount> | ReturnType<typeof fetchChargeCardList> | ReturnType<typeof fetchChargeCardConfig> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchCashbackDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchDebitCardSummary> | ReturnType<typeof fetchCreditAccountRepayment>;
|
|
12
10
|
export declare const fetchChargeCardListPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -3,13 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchChargeCardListPageEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
7
6
|
const classListReducer_1 = require("../../../classList/classListReducer");
|
|
8
7
|
const userListViewReducer_1 = require("../../../userListView/userListViewReducer");
|
|
9
8
|
const cashbackDetailReducer_1 = require("../cashbackDetail/cashbackDetailReducer");
|
|
10
9
|
const chargeCardConfigReducer_1 = require("../chargeCardConfig/chargeCardConfigReducer");
|
|
11
|
-
const chargeCardSetUpViewReducer_1 = require("../chargeCardSetUp/chargeCardSetUpViewReducer");
|
|
12
|
-
const issueChargeCardReducer_1 = require("../issueChargeCard/issueChargeCardReducer");
|
|
13
10
|
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
14
11
|
const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.fetchChargeCardListPage.match), (0, operators_1.mergeMap)((action) => {
|
|
15
12
|
const { doFetchCreditAccountsDebitSummaryAndCashback, isDebitCardEnabled, isCreditCardEnabled, cacheOverride, } = action.payload;
|
|
@@ -83,21 +80,6 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
83
80
|
'Completed') {
|
|
84
81
|
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)());
|
|
85
82
|
}
|
|
86
|
-
//Fetching deposit account list and charge card setup view for mix-panel events
|
|
87
|
-
if (doFetchCreditAccountsDebitSummaryAndCashback &&
|
|
88
|
-
isDebitCardEnabled &&
|
|
89
|
-
state.issueChargeCardState.depositAccountsFetchState.fetchState !==
|
|
90
|
-
'In-Progress' &&
|
|
91
|
-
state.issueChargeCardState.depositAccountsFetchState.fetchState !==
|
|
92
|
-
'Completed') {
|
|
93
|
-
chargeCardListPageAction.push((0, issueChargeCardReducer_1.fetchDepositAccountListForCards)());
|
|
94
|
-
}
|
|
95
|
-
if (doFetchCreditAccountsDebitSummaryAndCashback &&
|
|
96
|
-
state.chargeCardSetupViewState.fetchState !== 'In-Progress' &&
|
|
97
|
-
state.chargeCardSetupViewState.fetchState !== 'Completed') {
|
|
98
|
-
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
99
|
-
chargeCardListPageAction.push((0, chargeCardSetUpViewReducer_1.fetchChargeCardSetupView)(currentTenant.companyId, true));
|
|
100
|
-
}
|
|
101
83
|
}
|
|
102
84
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(chargeCardListPageAction));
|
|
103
85
|
}));
|
|
@@ -15,6 +15,6 @@ export declare const fetchTreasuryFunds: import("@reduxjs/toolkit").ActionCreato
|
|
|
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
17
|
custom_corporate_id: string | null;
|
|
18
|
-
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData"
|
|
18
|
+
}, "treasurySetupView/fetchPortfolioAllocationSuccess">, fetchPortfolioAllocationFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "treasurySetupView/fetchPortfolioAllocationFailure">, updateFundAllocationLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<FundAllocationOption, "treasurySetupView/updateFundAllocationLocalData">;
|
|
19
19
|
declare const _default: import("redux").Reducer<TreasurySetupViewState>;
|
|
20
20
|
export default _default;
|