@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
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.closeChargeCardEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
10
|
-
const closeChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.closeChargeCard.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { chargeCardId, reason } = action.payload;
|
|
12
|
-
const payload = {
|
|
13
|
-
reason: reason,
|
|
14
|
-
};
|
|
15
|
-
const cardDetail = state$.value.chargeCardState.chargeCardByID[chargeCardId];
|
|
16
|
-
const accountLast4 = cardDetail.accountLast4;
|
|
17
|
-
return zeniAPI
|
|
18
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}/close`, payload)
|
|
19
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
21
|
-
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data), (0, chargeCardDetailReducer_1.closeChargeCardSuccessOrFailure)({
|
|
22
|
-
chargeCardId,
|
|
23
|
-
fetchState: 'Completed',
|
|
24
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
25
|
-
messageSection: 'close_charge_card',
|
|
26
|
-
messageText: 'success',
|
|
27
|
-
type: 'success',
|
|
28
|
-
variables: [
|
|
29
|
-
{
|
|
30
|
-
variableName: '_masked_card_number_',
|
|
31
|
-
variableValue: `•••• ${accountLast4}`,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
38
|
-
messageSection: 'close_charge_card',
|
|
39
|
-
messageText: 'failed',
|
|
40
|
-
type: 'error',
|
|
41
|
-
variables: [
|
|
42
|
-
{
|
|
43
|
-
variableName: '_api-error_',
|
|
44
|
-
variableValue: response.status.message,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
}), (0, chargeCardDetailReducer_1.closeChargeCardSuccessOrFailure)({
|
|
48
|
-
chargeCardId,
|
|
49
|
-
fetchState: 'Error',
|
|
50
|
-
error: response.status,
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
}), (0, operators_1.catchError)((error) => {
|
|
54
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
55
|
-
messageSection: 'close_charge_card',
|
|
56
|
-
messageText: 'failed',
|
|
57
|
-
type: 'error',
|
|
58
|
-
variables: [
|
|
59
|
-
{
|
|
60
|
-
variableName: '_api-error_',
|
|
61
|
-
variableValue: JSON.stringify(error),
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
}), (0, chargeCardDetailReducer_1.closeChargeCardSuccessOrFailure)({
|
|
65
|
-
chargeCardId,
|
|
66
|
-
fetchState: 'Error',
|
|
67
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Close card API call errored out' + JSON.stringify(error)),
|
|
68
|
-
}));
|
|
69
|
-
}));
|
|
70
|
-
}));
|
|
71
|
-
exports.closeChargeCardEpic = closeChargeCardEpic;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { fetchChargeCardsRecurringExpenses, updateChargeCardsRecurringExpenses, updateChargeCardsRecurringExpensesFetchState } from './chargeCardDetailReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchChargeCardsRecurringExpenses> | ReturnType<typeof updateChargeCardsRecurringExpenses> | ReturnType<typeof updateChargeCardsRecurringExpensesFetchState>;
|
|
7
|
-
export declare const fetchChargeCardsRecurringExpensesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchChargeCardsRecurringExpensesEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const chargeCardDetail_1 = require("./chargeCardDetail");
|
|
8
|
-
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
9
|
-
const fetchChargeCardsRecurringExpensesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.fetchChargeCardsRecurringExpenses.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
-
const { cardIds } = action.payload;
|
|
11
|
-
const query = {
|
|
12
|
-
card_ids: cardIds,
|
|
13
|
-
};
|
|
14
|
-
return zeniAPI
|
|
15
|
-
.getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/recurring-expenses?query=${encodeURIComponent(JSON.stringify(query))}`)
|
|
16
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
18
|
-
const recurringExpensesByChargeCardId = {};
|
|
19
|
-
response.data.forEach((cardRecurringExpense) => {
|
|
20
|
-
recurringExpensesByChargeCardId[cardRecurringExpense.card_id] =
|
|
21
|
-
cardRecurringExpense.expenses.map((expense) => (0, chargeCardDetail_1.mapRecurringExpensePayloadToRecurringExpense)(expense));
|
|
22
|
-
});
|
|
23
|
-
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardsRecurringExpenses)({
|
|
24
|
-
recurringExpensesByChargeCardId,
|
|
25
|
-
}), (0, chargeCardDetailReducer_1.updateChargeCardsRecurringExpensesFetchState)({
|
|
26
|
-
fetchState: 'Completed',
|
|
27
|
-
error: undefined,
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardsRecurringExpensesFetchState)({
|
|
32
|
-
fetchState: 'Error',
|
|
33
|
-
error: response.status,
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
}), (0, operators_1.catchError)((error) => {
|
|
37
|
-
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardsRecurringExpensesFetchState)({
|
|
38
|
-
fetchState: 'Error',
|
|
39
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Charge Cards Recurring Expenses REST API call errored out' +
|
|
40
|
-
JSON.stringify(error)),
|
|
41
|
-
}));
|
|
42
|
-
}));
|
|
43
|
-
}));
|
|
44
|
-
exports.fetchChargeCardsRecurringExpensesEpic = fetchChargeCardsRecurringExpensesEpic;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { lockChargeCard, lockChargeCardSuccessOrFailure } from './chargeCardDetailReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof openSnackbar> | ReturnType<typeof lockChargeCard> | ReturnType<typeof lockChargeCardSuccessOrFailure> | ReturnType<typeof updateChargeCard>;
|
|
9
|
-
export declare const lockChargeCardEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lockChargeCardEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
10
|
-
const lockChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.lockChargeCard.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const { chargeCardId, reason, isChargeCardAdmin } = action.payload;
|
|
13
|
-
const payload = {
|
|
14
|
-
reason: reason,
|
|
15
|
-
};
|
|
16
|
-
const cardDetail = state$.value.chargeCardState.chargeCardByID[chargeCardId];
|
|
17
|
-
const accountLast4 = (_a = cardDetail === null || cardDetail === void 0 ? void 0 : cardDetail.accountLast4) !== null && _a !== void 0 ? _a : '';
|
|
18
|
-
return zeniAPI
|
|
19
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}/lock`, payload)
|
|
20
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
22
|
-
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data), (0, chargeCardDetailReducer_1.lockChargeCardSuccessOrFailure)({
|
|
23
|
-
chargeCardId,
|
|
24
|
-
fetchState: 'Completed',
|
|
25
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
26
|
-
messageSection: isChargeCardAdmin
|
|
27
|
-
? 'lock_charge_card'
|
|
28
|
-
: 'lock_charge_card_card_user',
|
|
29
|
-
messageText: 'success',
|
|
30
|
-
type: 'success',
|
|
31
|
-
variables: [
|
|
32
|
-
{
|
|
33
|
-
variableName: '_masked_card_number_',
|
|
34
|
-
variableValue: `•••• ${accountLast4}`,
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
41
|
-
messageSection: isChargeCardAdmin
|
|
42
|
-
? 'lock_charge_card'
|
|
43
|
-
: 'lock_charge_card_card_user',
|
|
44
|
-
messageText: 'failed',
|
|
45
|
-
type: 'error',
|
|
46
|
-
variables: [
|
|
47
|
-
{
|
|
48
|
-
variableName: '_api-error_',
|
|
49
|
-
variableValue: response.status.message,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
}), (0, chargeCardDetailReducer_1.lockChargeCardSuccessOrFailure)({
|
|
53
|
-
chargeCardId,
|
|
54
|
-
fetchState: 'Error',
|
|
55
|
-
error: response.status,
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
}), (0, operators_1.catchError)((error) => {
|
|
59
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
60
|
-
messageSection: isChargeCardAdmin
|
|
61
|
-
? 'lock_charge_card'
|
|
62
|
-
: 'lock_charge_card_card_user',
|
|
63
|
-
messageText: 'failed',
|
|
64
|
-
type: 'error',
|
|
65
|
-
variables: [
|
|
66
|
-
{
|
|
67
|
-
variableName: '_api-error_',
|
|
68
|
-
variableValue: JSON.stringify(error),
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
}), (0, chargeCardDetailReducer_1.lockChargeCardSuccessOrFailure)({
|
|
72
|
-
chargeCardId,
|
|
73
|
-
fetchState: 'Error',
|
|
74
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Lock card API call errored out' + JSON.stringify(error)),
|
|
75
|
-
}));
|
|
76
|
-
}));
|
|
77
|
-
}));
|
|
78
|
-
exports.lockChargeCardEpic = lockChargeCardEpic;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { unlockChargeCard, unlockChargeCardSuccessOrFailure } from './chargeCardDetailReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof openSnackbar> | ReturnType<typeof unlockChargeCard> | ReturnType<typeof unlockChargeCardSuccessOrFailure> | ReturnType<typeof updateChargeCard>;
|
|
9
|
-
export declare const unlockChargeCardEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unlockChargeCardEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
10
|
-
const unlockChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.unlockChargeCard.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const { isChargeCardAdmin, chargeCardId } = action.payload;
|
|
13
|
-
const cardDetail = state$.value.chargeCardState.chargeCardByID[chargeCardId];
|
|
14
|
-
const accountLast4 = (_a = cardDetail === null || cardDetail === void 0 ? void 0 : cardDetail.accountLast4) !== null && _a !== void 0 ? _a : '';
|
|
15
|
-
return zeniAPI
|
|
16
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}/unlock`)
|
|
17
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
19
|
-
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data), (0, chargeCardDetailReducer_1.unlockChargeCardSuccessOrFailure)({
|
|
20
|
-
chargeCardId,
|
|
21
|
-
fetchState: 'Completed',
|
|
22
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
23
|
-
messageSection: isChargeCardAdmin
|
|
24
|
-
? 'unlock_charge_card'
|
|
25
|
-
: 'unlock_charge_card_card_user',
|
|
26
|
-
messageText: 'success',
|
|
27
|
-
type: 'success',
|
|
28
|
-
variables: [
|
|
29
|
-
{
|
|
30
|
-
variableName: '_masked_card_number_',
|
|
31
|
-
variableValue: `•••• ${accountLast4}`,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
38
|
-
messageSection: isChargeCardAdmin
|
|
39
|
-
? 'unlock_charge_card'
|
|
40
|
-
: 'unlock_charge_card_card_user',
|
|
41
|
-
messageText: 'failed',
|
|
42
|
-
type: 'error',
|
|
43
|
-
variables: [
|
|
44
|
-
{
|
|
45
|
-
variableName: '_api-error_',
|
|
46
|
-
variableValue: response.status.message,
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
}), (0, chargeCardDetailReducer_1.unlockChargeCardSuccessOrFailure)({
|
|
50
|
-
chargeCardId,
|
|
51
|
-
fetchState: 'Error',
|
|
52
|
-
error: response.status,
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
}), (0, operators_1.catchError)((error) => {
|
|
56
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
57
|
-
messageSection: isChargeCardAdmin
|
|
58
|
-
? 'unlock_charge_card'
|
|
59
|
-
: 'unlock_charge_card_card_user',
|
|
60
|
-
messageText: 'failed',
|
|
61
|
-
type: 'error',
|
|
62
|
-
variables: [
|
|
63
|
-
{
|
|
64
|
-
variableName: '_api-error_',
|
|
65
|
-
variableValue: JSON.stringify(error),
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
}), (0, chargeCardDetailReducer_1.unlockChargeCardSuccessOrFailure)({
|
|
69
|
-
chargeCardId,
|
|
70
|
-
fetchState: 'Error',
|
|
71
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Unlock card API call errored out' + JSON.stringify(error)),
|
|
72
|
-
}));
|
|
73
|
-
}));
|
|
74
|
-
}));
|
|
75
|
-
exports.unlockChargeCardEpic = unlockChargeCardEpic;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { updateChargeCardName, updateChargeCardNameSuccessOrFailure } from './chargeCardDetailReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCardName> | ReturnType<typeof updateChargeCardNameSuccessOrFailure> | ReturnType<typeof updateChargeCard>;
|
|
9
|
-
export declare const updateChargeCardNameEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateChargeCardNameEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
10
|
-
const updateChargeCardNameEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.updateChargeCardName.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const { chargeCardId, name, isChargeCardAdmin } = action.payload;
|
|
13
|
-
const payload = {
|
|
14
|
-
card_name: name,
|
|
15
|
-
};
|
|
16
|
-
const cardDetail = state$.value.chargeCardState.chargeCardByID[chargeCardId];
|
|
17
|
-
const accountLast4 = (_a = cardDetail === null || cardDetail === void 0 ? void 0 : cardDetail.accountLast4) !== null && _a !== void 0 ? _a : '';
|
|
18
|
-
return zeniAPI
|
|
19
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}/rename`, payload)
|
|
20
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
22
|
-
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data), (0, chargeCardDetailReducer_1.updateChargeCardNameSuccessOrFailure)({
|
|
23
|
-
chargeCardId,
|
|
24
|
-
fetchState: 'Completed',
|
|
25
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
26
|
-
messageSection: isChargeCardAdmin
|
|
27
|
-
? 'update_charge_card_name'
|
|
28
|
-
: 'update_charge_card_name_card_user',
|
|
29
|
-
messageText: 'success',
|
|
30
|
-
type: 'success',
|
|
31
|
-
variables: [
|
|
32
|
-
{
|
|
33
|
-
variableName: '_masked_card_number_',
|
|
34
|
-
variableValue: `•••• ${accountLast4}`,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
variableName: '_new_card_name_',
|
|
38
|
-
variableValue: name,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
45
|
-
messageSection: isChargeCardAdmin
|
|
46
|
-
? 'update_charge_card_name'
|
|
47
|
-
: 'update_charge_card_name_card_user',
|
|
48
|
-
messageText: 'failed',
|
|
49
|
-
type: 'error',
|
|
50
|
-
variables: [
|
|
51
|
-
{
|
|
52
|
-
variableName: '_api-error_',
|
|
53
|
-
variableValue: response.status.message,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
}), (0, chargeCardDetailReducer_1.updateChargeCardNameSuccessOrFailure)({
|
|
57
|
-
chargeCardId,
|
|
58
|
-
fetchState: 'Error',
|
|
59
|
-
error: response.status,
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
}), (0, operators_1.catchError)((error) => {
|
|
63
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
64
|
-
messageSection: isChargeCardAdmin
|
|
65
|
-
? 'update_charge_card_name'
|
|
66
|
-
: 'update_charge_card_name_card_user',
|
|
67
|
-
messageText: 'failed',
|
|
68
|
-
type: 'error',
|
|
69
|
-
variables: [
|
|
70
|
-
{
|
|
71
|
-
variableName: '_api-error_',
|
|
72
|
-
variableValue: JSON.stringify(error),
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
}), (0, chargeCardDetailReducer_1.updateChargeCardNameSuccessOrFailure)({
|
|
76
|
-
chargeCardId,
|
|
77
|
-
fetchState: 'Error',
|
|
78
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update card name API call errored out' +
|
|
79
|
-
JSON.stringify(error)),
|
|
80
|
-
}));
|
|
81
|
-
}));
|
|
82
|
-
}));
|
|
83
|
-
exports.updateChargeCardNameEpic = updateChargeCardNameEpic;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateChargeCards } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { closeChargeCards, closeChargeCardsSuccessOrFailure } from './chargeCardListReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof closeChargeCards> | ReturnType<typeof closeChargeCardsSuccessOrFailure> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCards>;
|
|
9
|
-
export declare const closeChargeCardsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.closeChargeCardsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
10
|
-
const closeChargeCardsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.closeChargeCards.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { cardIds, reason } = action.payload;
|
|
12
|
-
const payload = {
|
|
13
|
-
card_ids: cardIds,
|
|
14
|
-
reason: reason,
|
|
15
|
-
};
|
|
16
|
-
return zeniAPI
|
|
17
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/bulk/close`, payload)
|
|
18
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
20
|
-
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCards)(response.data), (0, chargeCardListReducer_1.closeChargeCardsSuccessOrFailure)({
|
|
21
|
-
fetchState: 'Completed',
|
|
22
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
23
|
-
messageSection: 'close_charge_cards',
|
|
24
|
-
messageText: 'success',
|
|
25
|
-
type: 'success',
|
|
26
|
-
variables: [
|
|
27
|
-
{
|
|
28
|
-
variableName: '_number_of_cards_',
|
|
29
|
-
variableValue: cardIds.length === 1
|
|
30
|
-
? '1 card'
|
|
31
|
-
: `${cardIds.length} cards`,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
38
|
-
messageSection: 'close_charge_cards',
|
|
39
|
-
messageText: 'failed',
|
|
40
|
-
type: 'error',
|
|
41
|
-
variables: [
|
|
42
|
-
{
|
|
43
|
-
variableName: '_api-error_',
|
|
44
|
-
variableValue: response.status.message,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
}), (0, chargeCardListReducer_1.closeChargeCardsSuccessOrFailure)({
|
|
48
|
-
fetchState: 'Error',
|
|
49
|
-
error: response.status,
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
}), (0, operators_1.catchError)((error) => {
|
|
53
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
54
|
-
messageSection: 'close_charge_cards',
|
|
55
|
-
messageText: 'failed',
|
|
56
|
-
type: 'error',
|
|
57
|
-
variables: [
|
|
58
|
-
{
|
|
59
|
-
variableName: '_api-error_',
|
|
60
|
-
variableValue: JSON.stringify(error),
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
}), (0, chargeCardListReducer_1.closeChargeCardsSuccessOrFailure)({
|
|
64
|
-
fetchState: 'Error',
|
|
65
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Close cards API call errored out' + JSON.stringify(error)),
|
|
66
|
-
}));
|
|
67
|
-
}));
|
|
68
|
-
}));
|
|
69
|
-
exports.closeChargeCardsEpic = closeChargeCardsEpic;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateChargeCards } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { lockChargeCards, lockChargeCardsSuccessOrFailure } from './chargeCardListReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof lockChargeCards> | ReturnType<typeof lockChargeCardsSuccessOrFailure> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCards>;
|
|
9
|
-
export declare const lockChargeCardsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lockChargeCardsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
10
|
-
const lockChargeCardsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.lockChargeCards.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { cardIds, reason } = action.payload;
|
|
12
|
-
const payload = {
|
|
13
|
-
card_ids: cardIds,
|
|
14
|
-
reason: reason,
|
|
15
|
-
};
|
|
16
|
-
return zeniAPI
|
|
17
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/bulk/lock`, payload)
|
|
18
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
20
|
-
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCards)(response.data), (0, chargeCardListReducer_1.lockChargeCardsSuccessOrFailure)({
|
|
21
|
-
fetchState: 'Completed',
|
|
22
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
23
|
-
messageSection: 'lock_charge_cards',
|
|
24
|
-
messageText: 'success',
|
|
25
|
-
type: 'success',
|
|
26
|
-
variables: [
|
|
27
|
-
{
|
|
28
|
-
variableName: '_number_of_cards_',
|
|
29
|
-
variableValue: cardIds.length === 1
|
|
30
|
-
? '1 card'
|
|
31
|
-
: `${cardIds.length} cards`,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
38
|
-
messageSection: 'lock_charge_cards',
|
|
39
|
-
messageText: 'failed',
|
|
40
|
-
type: 'error',
|
|
41
|
-
variables: [
|
|
42
|
-
{
|
|
43
|
-
variableName: '_api-error_',
|
|
44
|
-
variableValue: response.status.message,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
}), (0, chargeCardListReducer_1.lockChargeCardsSuccessOrFailure)({
|
|
48
|
-
fetchState: 'Error',
|
|
49
|
-
error: response.status,
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
}), (0, operators_1.catchError)((error) => {
|
|
53
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
54
|
-
messageSection: 'lock_charge_cards',
|
|
55
|
-
messageText: 'failed',
|
|
56
|
-
type: 'error',
|
|
57
|
-
variables: [
|
|
58
|
-
{
|
|
59
|
-
variableName: '_api-error_',
|
|
60
|
-
variableValue: JSON.stringify(error),
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
}), (0, chargeCardListReducer_1.lockChargeCardsSuccessOrFailure)({
|
|
64
|
-
fetchState: 'Error',
|
|
65
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Lock cards API call errored out' + JSON.stringify(error)),
|
|
66
|
-
}));
|
|
67
|
-
}));
|
|
68
|
-
}));
|
|
69
|
-
exports.lockChargeCardsEpic = lockChargeCardsEpic;
|
package/lib/view/spendManagement/chargeCards/chargeCardList/revokeChargeCardsInviteEpic.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
-
import { RootState } from '../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
-
import { revokeChargeCardsInvite, revokeChargeCardsInviteSuccessOrFailure } from './chargeCardListReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof revokeChargeCardsInvite> | ReturnType<typeof revokeChargeCardsInviteSuccessOrFailure> | ReturnType<typeof openSnackbar>;
|
|
8
|
-
export declare const revokeChargeCardsInviteEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.revokeChargeCardsInviteEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
-
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
9
|
-
const revokeChargeCardsInviteEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.revokeChargeCardsInvite.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
-
const { cardIds } = action.payload;
|
|
11
|
-
const payload = {
|
|
12
|
-
card_ids: cardIds,
|
|
13
|
-
};
|
|
14
|
-
return zeniAPI
|
|
15
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/bulk/cancel-issue-request`, payload)
|
|
16
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
17
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
18
|
-
return (0, rxjs_1.of)((0, chargeCardListReducer_1.revokeChargeCardsInviteSuccessOrFailure)({
|
|
19
|
-
fetchState: 'Completed',
|
|
20
|
-
revokedCardIds: cardIds,
|
|
21
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
22
|
-
messageSection: 'revoke_invite_charge_cards',
|
|
23
|
-
messageText: 'success',
|
|
24
|
-
type: 'success',
|
|
25
|
-
variables: [
|
|
26
|
-
{
|
|
27
|
-
variableName: '_number_of_cards_',
|
|
28
|
-
variableValue: cardIds.length === 1
|
|
29
|
-
? '1 card'
|
|
30
|
-
: `${cardIds.length} cards`,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
37
|
-
messageSection: 'revoke_invite_charge_cards',
|
|
38
|
-
messageText: 'failed',
|
|
39
|
-
type: 'error',
|
|
40
|
-
variables: [
|
|
41
|
-
{
|
|
42
|
-
variableName: '_api-error_',
|
|
43
|
-
variableValue: response.status.message,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
}), (0, chargeCardListReducer_1.revokeChargeCardsInviteSuccessOrFailure)({
|
|
47
|
-
fetchState: 'Error',
|
|
48
|
-
error: response.status,
|
|
49
|
-
revokedCardIds: [],
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
}), (0, operators_1.catchError)((error) => {
|
|
53
|
-
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
54
|
-
messageSection: 'revoke_invite_charge_cards',
|
|
55
|
-
messageText: 'failed',
|
|
56
|
-
type: 'error',
|
|
57
|
-
variables: [
|
|
58
|
-
{
|
|
59
|
-
variableName: '_api-error_',
|
|
60
|
-
variableValue: JSON.stringify(error),
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
}), (0, chargeCardListReducer_1.revokeChargeCardsInviteSuccessOrFailure)({
|
|
64
|
-
fetchState: 'Error',
|
|
65
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Revoke invite charge cards API call errored out' +
|
|
66
|
-
JSON.stringify(error)),
|
|
67
|
-
revokedCardIds: [],
|
|
68
|
-
}));
|
|
69
|
-
}));
|
|
70
|
-
}));
|
|
71
|
-
exports.revokeChargeCardsInviteEpic = revokeChargeCardsInviteEpic;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateChargeCards } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { unlockChargeCards, unlockChargeCardsSuccessOrFailure } from './chargeCardListReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof unlockChargeCards> | ReturnType<typeof unlockChargeCardsSuccessOrFailure> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCards>;
|
|
9
|
-
export declare const unlockChargeCardsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|