@zeniai/client-epic-state 4.18.85 → 4.18.86
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/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/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- 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 +0 -12
- 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 +11 -13
- package/lib/index.js +30 -52
- 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/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.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscategorizedEpic.js +2 -13
- package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -6
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +3 -6
- 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 -2
- package/lib/view/monthEndCloseChecksView/monthEndCloseChecksViewSelector.js +6 -13
- 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/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
|
@@ -10,25 +10,21 @@ import { TwoFactorAuthenticationView } from '../../../twoFactorAuthentication/tw
|
|
|
10
10
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
11
11
|
import { CreditAccount, CreditAccountRepayment } from '../chargeCardList/chargeCardList';
|
|
12
12
|
import { ChargeCardWithUser } from '../chargeCardList/chargeCardListSelector';
|
|
13
|
-
import { ChargeCardDetailUiState,
|
|
13
|
+
import { ChargeCardDetailUiState, TransactionStatistics } from './chargeCardDetail';
|
|
14
14
|
export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
15
15
|
chargeCardConfig: ChargeCardConfigState;
|
|
16
|
-
closeChargeCardsFetchState: FetchStateAndError;
|
|
17
16
|
creditAccount: CreditAccount;
|
|
18
17
|
creditAccountRepayment: CreditAccountRepayment;
|
|
19
18
|
depositAccountLimitFetchState: FetchStateAndError;
|
|
20
19
|
isRefreshingViewInBackground: boolean;
|
|
21
20
|
isViewReceiptClickedImmediatelyAfterUploadTransactionId: Record<ID, boolean>;
|
|
22
|
-
lockChargeCardsFetchState: FetchStateAndError;
|
|
23
21
|
loggedInUserPhone: string;
|
|
24
22
|
transactionListFetchState: FetchStateAndError;
|
|
25
23
|
transactions: ChargeCardTransaction[];
|
|
26
24
|
transactionStatistics: TransactionStatistics;
|
|
27
25
|
twoFAView: TwoFactorAuthenticationView;
|
|
28
26
|
uiState: ChargeCardDetailUiState;
|
|
29
|
-
unlockChargeCardsFetchState: FetchStateAndError;
|
|
30
27
|
updateChargeCardLimitFetchState: FetchStateAndError;
|
|
31
|
-
updateChargeCardNameFetchState: FetchStateAndError;
|
|
32
28
|
updateFetchState: FetchStateAndError;
|
|
33
29
|
updatePhysicalChargeCardAttemptFetchState: FetchStateAndError;
|
|
34
30
|
uploadReceiptsFetchStateByTransactionId: Record<ID, FetchStateAndError>;
|
|
@@ -38,16 +34,6 @@ export interface ChargeCardDetailSelectorView extends SelectorView {
|
|
|
38
34
|
depositAccountLimit?: DepositAccountWithLimit;
|
|
39
35
|
}
|
|
40
36
|
export declare const getChargeCardDetailView: (state: RootState, chargeCardId: ID, includeCreditAccountInfo: boolean, isCreditCardEnabled: boolean) => ChargeCardDetailSelectorView;
|
|
41
|
-
export declare const getDepositAccountLimitFetchStateByDepositAccountId: (state: RootState, depositAccountId: ID) => FetchStateAndError;
|
|
42
|
-
export interface ChargeCardControlDetailView {
|
|
43
|
-
closeChargeCardsFetchState: FetchStateAndError;
|
|
44
|
-
lockChargeCardsFetchState: FetchStateAndError;
|
|
45
|
-
revokeChargeCardFetchState: FetchStateAndError;
|
|
46
|
-
unlockChargeCardsFetchState: FetchStateAndError;
|
|
47
|
-
updateChargeCardLimitFetchState: FetchStateAndError;
|
|
48
|
-
updateChargeCardNameFetchState: FetchStateAndError;
|
|
49
|
-
}
|
|
50
|
-
export declare const getChargeCardControlDetailView: (state: RootState, chargeCardId: ID) => ChargeCardControlDetailView;
|
|
51
37
|
export interface DebitCardPinSetSelectorView extends SelectorView {
|
|
52
38
|
isRefreshingViewInBackground: boolean;
|
|
53
39
|
updateDebitCardPinAttemptFetchState: FetchStateAndError;
|
|
@@ -67,7 +53,3 @@ export interface ChargeCardTransactionAttachmentView {
|
|
|
67
53
|
transactionAttachments: Attachment[];
|
|
68
54
|
}
|
|
69
55
|
export declare const getChargeCardTransactionAttachmentView: (state: RootState, cardId: ID, transactionId: ID) => ChargeCardTransactionAttachmentView | undefined;
|
|
70
|
-
export interface ChargeCardRecurringExpenses extends FetchStateAndError {
|
|
71
|
-
recurringExpenses: RecurringExpense[];
|
|
72
|
-
}
|
|
73
|
-
export declare const getChargeCardRecurringExpensesView: (state: RootState, chargeCardId: ID) => ChargeCardRecurringExpenses;
|
|
@@ -3,7 +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.
|
|
6
|
+
exports.getChargeCardTransactionAttachmentView = exports.getChargeCardCVVActivateView = exports.getDebitCardSetPinView = exports.getChargeCardDetailView = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
9
9
|
const addressSelector_1 = require("../../../../entity/address/addressSelector");
|
|
@@ -18,7 +18,7 @@ const twoFactorAuthentication_1 = require("../../../twoFactorAuthentication/twoF
|
|
|
18
18
|
const twoFactorAuthenticationSelector_1 = require("../../../twoFactorAuthentication/twoFactorAuthenticationSelector");
|
|
19
19
|
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
20
20
|
const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo, isCreditCardEnabled) => {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
22
22
|
const { tenantState, addressState, chargeCardDetailState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, chargeCardTransactionState, chargeCardListState, connectedAccountState, depositAccountState, } = state;
|
|
23
23
|
const twoFactorAuthenticationView = (0, twoFactorAuthenticationSelector_1.getTwoFactorAuthenticationViewForChargeCardHolder)(state, chargeCardId);
|
|
24
24
|
const loggedInUserId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
@@ -93,42 +93,22 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo,
|
|
|
93
93
|
error: chargeCardDetail.transactionList.error,
|
|
94
94
|
};
|
|
95
95
|
uiState = chargeCardDetail.transactionList.uiState;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
.depositAccountLimitFetchStateByDepositAccountId[depositAccountId]) !== null && _f !== void 0 ? _f : {
|
|
99
|
-
fetchState: 'Not-Started',
|
|
100
|
-
error: undefined,
|
|
101
|
-
};
|
|
96
|
+
depositAccountLimitFetchState =
|
|
97
|
+
chargeCardDetail.depositAccountLimitFetchState;
|
|
102
98
|
depositAccountLimit = (0, depositAccountSelector_1.getDepositAccountLimitForChargeCardByDepositAccountId)(depositAccountState, chargeCard.connectedAccountId);
|
|
103
99
|
}
|
|
104
100
|
return {
|
|
105
101
|
fetchState: reducedFetchState.fetchState,
|
|
106
|
-
updateFetchState: (
|
|
107
|
-
fetchState: 'Not-Started',
|
|
108
|
-
error: undefined,
|
|
109
|
-
},
|
|
110
|
-
isRefreshingViewInBackground: (_h = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.isRefreshingViewInBackground) !== null && _h !== void 0 ? _h : false,
|
|
111
|
-
updatePhysicalChargeCardAttemptFetchState: (_j = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updatePhysicalChargeCardAttemptFetchState) !== null && _j !== void 0 ? _j : {
|
|
112
|
-
fetchState: 'Not-Started',
|
|
113
|
-
error: undefined,
|
|
114
|
-
},
|
|
115
|
-
updateChargeCardLimitFetchState: (_k = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateChargeCardLimitFetchState) !== null && _k !== void 0 ? _k : {
|
|
116
|
-
fetchState: 'Not-Started',
|
|
117
|
-
error: undefined,
|
|
118
|
-
},
|
|
119
|
-
closeChargeCardsFetchState: (_l = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.closeChargeCardFetchState) !== null && _l !== void 0 ? _l : {
|
|
120
|
-
fetchState: 'Not-Started',
|
|
121
|
-
error: undefined,
|
|
122
|
-
},
|
|
123
|
-
lockChargeCardsFetchState: (_m = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.lockChargeCardFetchState) !== null && _m !== void 0 ? _m : {
|
|
102
|
+
updateFetchState: (_f = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateStatus) !== null && _f !== void 0 ? _f : {
|
|
124
103
|
fetchState: 'Not-Started',
|
|
125
104
|
error: undefined,
|
|
126
105
|
},
|
|
127
|
-
|
|
106
|
+
isRefreshingViewInBackground: (_g = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.isRefreshingViewInBackground) !== null && _g !== void 0 ? _g : false,
|
|
107
|
+
updatePhysicalChargeCardAttemptFetchState: (_h = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updatePhysicalChargeCardAttemptFetchState) !== null && _h !== void 0 ? _h : {
|
|
128
108
|
fetchState: 'Not-Started',
|
|
129
109
|
error: undefined,
|
|
130
110
|
},
|
|
131
|
-
|
|
111
|
+
updateChargeCardLimitFetchState: (_j = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateChargeCardLimitFetchState) !== null && _j !== void 0 ? _j : {
|
|
132
112
|
fetchState: 'Not-Started',
|
|
133
113
|
error: undefined,
|
|
134
114
|
},
|
|
@@ -137,9 +117,9 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo,
|
|
|
137
117
|
error: reducedFetchState.error,
|
|
138
118
|
chargeCardConfig: chargeCardConfigState,
|
|
139
119
|
transactions,
|
|
140
|
-
uploadReceiptsFetchStateByTransactionId: (
|
|
141
|
-
uploadReceiptsShowTickByTransactionId: (
|
|
142
|
-
isViewReceiptClickedImmediatelyAfterUploadTransactionId: (
|
|
120
|
+
uploadReceiptsFetchStateByTransactionId: (_k = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsFetchStateByTransactionId) !== null && _k !== void 0 ? _k : {},
|
|
121
|
+
uploadReceiptsShowTickByTransactionId: (_l = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.uploadReceiptsShowTickByTransactionId) !== null && _l !== void 0 ? _l : {},
|
|
122
|
+
isViewReceiptClickedImmediatelyAfterUploadTransactionId: (_m = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionList.isViewReceiptClickedImmediatelyAfterUploadTransactionId) !== null && _m !== void 0 ? _m : {},
|
|
143
123
|
uiState,
|
|
144
124
|
transactionListFetchState,
|
|
145
125
|
twoFAView: twoFactorAuthenticationView,
|
|
@@ -149,53 +129,10 @@ const getChargeCardDetailView = (state, chargeCardId, includeCreditAccountInfo,
|
|
|
149
129
|
version: '1.0',
|
|
150
130
|
creditAccount: chargeCardListState.creditAccount,
|
|
151
131
|
creditAccountRepayment: chargeCardListState.creditAccountRepayment,
|
|
152
|
-
transactionStatistics: (
|
|
132
|
+
transactionStatistics: (_o = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.transactionStatistics) !== null && _o !== void 0 ? _o : chargeCardDetail_1.initialTransactionStatistics,
|
|
153
133
|
};
|
|
154
134
|
};
|
|
155
135
|
exports.getChargeCardDetailView = getChargeCardDetailView;
|
|
156
|
-
const getDepositAccountLimitFetchStateByDepositAccountId = (state, depositAccountId) => {
|
|
157
|
-
var _a;
|
|
158
|
-
const { chargeCardDetailState } = state;
|
|
159
|
-
return ((_a = chargeCardDetailState.depositAccountLimitFetchStateByDepositAccountId[depositAccountId]) !== null && _a !== void 0 ? _a : {
|
|
160
|
-
fetchState: 'Not-Started',
|
|
161
|
-
error: undefined,
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
exports.getDepositAccountLimitFetchStateByDepositAccountId = getDepositAccountLimitFetchStateByDepositAccountId;
|
|
165
|
-
const getChargeCardControlDetailView = (state, chargeCardId) => {
|
|
166
|
-
var _a, _b, _c, _d, _e;
|
|
167
|
-
const { chargeCardDetailState, chargeCardListState } = state;
|
|
168
|
-
const chargeCardDetail = (0, get_1.default)(chargeCardDetailState.detailById, chargeCardId, undefined);
|
|
169
|
-
return {
|
|
170
|
-
revokeChargeCardFetchState: chargeCardListState.revokeCardInvite.cardId === chargeCardId
|
|
171
|
-
? chargeCardListState.revokeCardInvite.saveStatus
|
|
172
|
-
: {
|
|
173
|
-
fetchState: 'Not-Started',
|
|
174
|
-
error: undefined,
|
|
175
|
-
},
|
|
176
|
-
updateChargeCardNameFetchState: (_a = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateChargeCardNameFetchState) !== null && _a !== void 0 ? _a : {
|
|
177
|
-
fetchState: 'Not-Started',
|
|
178
|
-
error: undefined,
|
|
179
|
-
},
|
|
180
|
-
updateChargeCardLimitFetchState: (_b = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.updateChargeCardLimitFetchState) !== null && _b !== void 0 ? _b : {
|
|
181
|
-
fetchState: 'Not-Started',
|
|
182
|
-
error: undefined,
|
|
183
|
-
},
|
|
184
|
-
closeChargeCardsFetchState: (_c = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.closeChargeCardFetchState) !== null && _c !== void 0 ? _c : {
|
|
185
|
-
fetchState: 'Not-Started',
|
|
186
|
-
error: undefined,
|
|
187
|
-
},
|
|
188
|
-
lockChargeCardsFetchState: (_d = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.lockChargeCardFetchState) !== null && _d !== void 0 ? _d : {
|
|
189
|
-
fetchState: 'Not-Started',
|
|
190
|
-
error: undefined,
|
|
191
|
-
},
|
|
192
|
-
unlockChargeCardsFetchState: (_e = chargeCardDetail === null || chargeCardDetail === void 0 ? void 0 : chargeCardDetail.unlockChargeCardFetchState) !== null && _e !== void 0 ? _e : {
|
|
193
|
-
fetchState: 'Not-Started',
|
|
194
|
-
error: undefined,
|
|
195
|
-
},
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
exports.getChargeCardControlDetailView = getChargeCardControlDetailView;
|
|
199
136
|
const getDebitCardSetPinView = (state, chargeCardId) => {
|
|
200
137
|
var _a, _b, _c, _d, _e;
|
|
201
138
|
const { chargeCardDetailState, chargeCardState, chargeCardConfigState } = state;
|
|
@@ -313,15 +250,3 @@ const getChargeCardTransactionAttachmentView = (state, cardId, transactionId) =>
|
|
|
313
250
|
};
|
|
314
251
|
};
|
|
315
252
|
exports.getChargeCardTransactionAttachmentView = getChargeCardTransactionAttachmentView;
|
|
316
|
-
const getChargeCardRecurringExpensesView = (state, chargeCardId) => {
|
|
317
|
-
var _a;
|
|
318
|
-
const { chargeCardDetailState } = state;
|
|
319
|
-
const recurringExpenses = (_a = chargeCardDetailState.recurringExpensesByChargeCardId[chargeCardId]) !== null && _a !== void 0 ? _a : [];
|
|
320
|
-
const recurringExpensesFetchState = chargeCardDetailState.recurringExpensesFetchState;
|
|
321
|
-
return {
|
|
322
|
-
fetchState: recurringExpensesFetchState.fetchState,
|
|
323
|
-
error: recurringExpensesFetchState.error,
|
|
324
|
-
recurringExpenses,
|
|
325
|
-
};
|
|
326
|
-
};
|
|
327
|
-
exports.getChargeCardRecurringExpensesView = getChargeCardRecurringExpensesView;
|
package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js
CHANGED
|
@@ -7,7 +7,7 @@ const depositAccountReducer_1 = require("../../../../entity/depositAccount/depos
|
|
|
7
7
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
8
|
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
9
9
|
const fetchDepositAccountLimitEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.fetchDepositAccountLimit.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
-
const { depositAccountId } = action.payload;
|
|
10
|
+
const { depositAccountId, chargeCardId } = action.payload;
|
|
11
11
|
const query = {
|
|
12
12
|
deposit_account_id: depositAccountId,
|
|
13
13
|
};
|
|
@@ -17,21 +17,21 @@ const fetchDepositAccountLimitEpic = (actions$, _state$, zeniAPI) => actions$.pi
|
|
|
17
17
|
var _a, _b;
|
|
18
18
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
19
19
|
return (0, rxjs_1.of)((0, depositAccountReducer_1.updateDepositAccountLimitsForChargeCard)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.deposit_accounts) !== null && _b !== void 0 ? _b : []), (0, chargeCardDetailReducer_1.updateDepositAccountLimitFetchStatus)({
|
|
20
|
-
|
|
20
|
+
chargeCardId,
|
|
21
21
|
fetchState: 'Completed',
|
|
22
22
|
error: undefined,
|
|
23
23
|
}));
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateDepositAccountLimitFetchStatus)({
|
|
27
|
-
|
|
27
|
+
chargeCardId,
|
|
28
28
|
fetchState: 'Error',
|
|
29
29
|
error: response.status,
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
32
|
}), (0, operators_1.catchError)((error) => {
|
|
33
33
|
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateDepositAccountLimitFetchStatus)({
|
|
34
|
-
|
|
34
|
+
chargeCardId,
|
|
35
35
|
fetchState: 'Error',
|
|
36
36
|
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch deposit Accounts Limit For Card Detail REST API call errored out' +
|
|
37
37
|
JSON.stringify(error)),
|
|
@@ -3,21 +3,14 @@ import { FetchStateAndError, FetchedState, ID } from '../../../../commonStateTyp
|
|
|
3
3
|
import { ZeniDate } from '../../../../zeniDayJS';
|
|
4
4
|
import { SpendManagementUIState } from '../../billPay/billList/billListState';
|
|
5
5
|
export interface ChargeCardListState extends FetchedState {
|
|
6
|
-
bulkActionCardIds: ID[];
|
|
7
6
|
cardIds: ID[];
|
|
8
|
-
closeChargeCardsFetchState: FetchStateAndError;
|
|
9
7
|
creditAccount: CreditAccount;
|
|
10
8
|
creditAccountRepayment: CreditAccountRepayment;
|
|
11
9
|
debitCardSummaries: DebitCardSummaries;
|
|
12
|
-
lockChargeCardsFetchState: FetchStateAndError;
|
|
13
10
|
resendCardInvite: ResendRevokeCardInvite;
|
|
14
11
|
revokeCardInvite: ResendRevokeCardInvite;
|
|
15
|
-
revokeChargeCardsInviteFetchState: FetchStateAndError;
|
|
16
12
|
searchText: string;
|
|
17
13
|
uiState: ChargeCardListUIState;
|
|
18
|
-
unlockChargeCardsFetchState: FetchStateAndError;
|
|
19
|
-
updateChargeCardsSpendLimitFetchState: FetchStateAndError;
|
|
20
|
-
rowActionCardId?: ID;
|
|
21
14
|
unAssignedCredits?: Amount;
|
|
22
15
|
}
|
|
23
16
|
export interface ResendRevokeCardInvite {
|
|
@@ -66,5 +66,4 @@ interface DebitCardSummaryPayload {
|
|
|
66
66
|
}
|
|
67
67
|
export type FetchDebitCardSummaryResponse = ZeniAPIResponse<DebitCardSummaryPayload>;
|
|
68
68
|
export type ResendInviteResponse = ZeniAPIResponse<ChargeCardPayload>;
|
|
69
|
-
export type UpdateChargeCardsLimitResponse = ZeniAPIResponse<ChargeCardPayload[]>;
|
|
70
69
|
export {};
|
|
@@ -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;
|