@zeniai/client-epic-state 4.12.55 → 4.12.56
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/entity/chargeCard/chargeCard.d.ts +5 -2
- package/lib/entity/chargeCard/chargeCard.js +2 -0
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +4 -2
- package/lib/entity/chargeCard/chargeCardPayload.js +44 -27
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/epic.d.ts +7 -1
- package/lib/epic.js +7 -1
- package/lib/index.d.ts +12 -8
- package/lib/index.js +40 -22
- package/lib/reducer.d.ts +4 -1
- package/lib/reducer.js +4 -1
- package/lib/view/addressView/addressViewReducer.d.ts +2 -0
- package/lib/view/addressView/addressViewReducer.js +13 -2
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/companyView/epic/companyPassport/updateCompanyPassportLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/companyView/epic/companyPassport/updateCompanyPassportLocalStoreDataEpic.js +8 -1
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/fetchMyProfileEpic.d.ts +12 -2
- package/lib/view/settingsView/epic/fetchMyProfileEpic.js +10 -2
- package/lib/view/settingsView/epic/initializeMyProfileLocalDataEpic.d.ts +7 -0
- package/lib/view/settingsView/epic/initializeMyProfileLocalDataEpic.js +50 -0
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/updateMyProfileEpic.d.ts +11 -0
- package/lib/view/settingsView/epic/updateMyProfileEpic.js +86 -0
- package/lib/view/settingsView/settingsViewPayload.d.ts +12 -0
- package/lib/view/settingsView/settingsViewReducer.d.ts +13 -2
- package/lib/view/settingsView/settingsViewReducer.js +82 -7
- package/lib/view/settingsView/settingsViewSelector.js +14 -2
- package/lib/view/settingsView/settingsViewState.d.ts +16 -4
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +11 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.d.ts +13 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.js +94 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.d.ts +18 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +34 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState.d.ts +20 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.js +50 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/saveCardOnboardingUserDetailsEpic.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/saveCardOnboardingUserDetailsEpic.js +16 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +20 -6
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +8 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +3 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +8 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +43 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +9 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +49 -9
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListEpic.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/issueChargeCardEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/issueChargeCardEpic.js +3 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/resendCardInviteEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/resendCardInviteEpic.js +31 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/revokeCardInviteEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/revokeCardInviteEpic.js +29 -0
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +3 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +30 -0
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +3 -1
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +30 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +12 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +7 -0
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +3 -1
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +26 -0
- package/lib/view/userListView/fetchUserListByTypeEpic.js +3 -1
- package/lib/view/userListView/userListViewReducer.js +1 -0
- package/lib/view/userListView/userListViewState.d.ts +2 -1
- package/package.json +1 -1
package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ import { fetchChargeCardDetail, updateChargeCardDetailFetchState } from './charg
|
|
|
6
6
|
import { updateAllUsers } from '../../../../entity/user/userReducer';
|
|
7
7
|
import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
|
|
8
8
|
import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
9
|
-
import { updateAddress } from '../../../../entity/address/addressReducer';
|
|
10
|
-
export declare type ActionType = ReturnType<typeof fetchChargeCardDetail> | ReturnType<typeof updateChargeCardDetailFetchState> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateAddress> | ReturnType<typeof updateChargeCard>;
|
|
9
|
+
import { updateAddress, updateAddresses } from '../../../../entity/address/addressReducer';
|
|
10
|
+
export declare type ActionType = ReturnType<typeof fetchChargeCardDetail> | ReturnType<typeof updateChargeCardDetailFetchState> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateAddress> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateChargeCard>;
|
|
11
11
|
export declare const fetchChargeCardDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -29,7 +29,7 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
29
29
|
.getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${chargeCardId}`)
|
|
30
30
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
31
31
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
32
|
-
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0,
|
|
32
|
+
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data.card), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
|
|
33
33
|
chargeCardId,
|
|
34
34
|
fetchState: 'Completed',
|
|
35
35
|
}));
|
|
@@ -9,6 +9,12 @@ export interface ChargeCardListState extends FetchedState {
|
|
|
9
9
|
issueChargeCard: IssueChargeCard;
|
|
10
10
|
searchText: string;
|
|
11
11
|
unAssignedCredits?: Amount;
|
|
12
|
+
resendCardInvite: ResendRevokeCardInvite;
|
|
13
|
+
revokeCardInvite: ResendRevokeCardInvite;
|
|
14
|
+
}
|
|
15
|
+
export interface ResendRevokeCardInvite {
|
|
16
|
+
cardId?: ID;
|
|
17
|
+
saveStatus: FetchStateAndError;
|
|
12
18
|
}
|
|
13
19
|
export interface ChargeCardListUIState extends SpendManagementUIState {
|
|
14
20
|
sortKey: ChargeCardViewSortKey;
|
|
@@ -34,6 +40,7 @@ export interface CreditAccount extends FetchStateAndError {
|
|
|
34
40
|
}
|
|
35
41
|
export declare const initialCreditAcc: CreditAccount;
|
|
36
42
|
export declare const initialIssueChargeCard: IssueChargeCard;
|
|
43
|
+
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
37
44
|
export declare const toChargeCardSortKeyType: (v: string) => "owner" | "department" | "cardName" | "utilisation" | "limit";
|
|
38
45
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
39
46
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.initialIssueChargeCard = exports.initialCreditAcc = void 0;
|
|
3
|
+
exports.toCreditAccountStatusType = exports.toCashbackSortKeyType = exports.ALL_CASHBACK_SORT_KEYS = exports.toChargeCardSortKeyType = exports.initialResendRevokeCardInvite = exports.initialIssueChargeCard = exports.initialCreditAcc = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
5
|
exports.initialCreditAcc = {
|
|
6
6
|
fetchState: 'Not-Started',
|
|
@@ -45,6 +45,13 @@ exports.initialIssueChargeCard = {
|
|
|
45
45
|
error: undefined,
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
|
+
exports.initialResendRevokeCardInvite = {
|
|
49
|
+
cardId: undefined,
|
|
50
|
+
saveStatus: {
|
|
51
|
+
fetchState: 'Not-Started',
|
|
52
|
+
error: undefined,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
48
55
|
const ALL_CHARGE_CARD_SORT_KEYS = [
|
|
49
56
|
'owner',
|
|
50
57
|
'cardName',
|
|
@@ -2,12 +2,14 @@ import { ChargeCardPayload } from '../../../../entity/chargeCard/chargeCardPaylo
|
|
|
2
2
|
import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
|
|
3
3
|
import { UserPayload } from '../../../../entity/user/userPayload';
|
|
4
4
|
import { UserRolePayload } from '../../../../entity/userRole/userRolePayload';
|
|
5
|
+
import { AddressPayload } from '../../../../entity/address/addressPayload';
|
|
5
6
|
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
6
7
|
export interface ChargeCardListPayload {
|
|
7
8
|
cards: ChargeCardPayload[];
|
|
8
9
|
unassigned_credit?: AmountPayload;
|
|
9
10
|
users: UserPayload[];
|
|
10
11
|
user_roles: UserRolePayload[];
|
|
12
|
+
addresses: AddressPayload[];
|
|
11
13
|
}
|
|
12
14
|
export declare type FetchChargeCardListResponse = ZeniAPIResponse<ChargeCardListPayload>;
|
|
13
15
|
export interface CreditAccountPayload {
|
|
@@ -31,4 +33,5 @@ interface CreditAccountListPayload {
|
|
|
31
33
|
credit_accounts: CreditAccountPayload[];
|
|
32
34
|
}
|
|
33
35
|
export declare type FetchCreditAccountResponse = ZeniAPIResponse<CreditAccountListPayload>;
|
|
36
|
+
export declare type ResendInviteResponse = ZeniAPIResponse<ChargeCardPayload>;
|
|
34
37
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
2
|
import { ChargeCardListPayload, CreditAccountPayload } from './chargeCardListPayload';
|
|
3
3
|
import { ChargeCardListState, ChargeCardListUIState, ChargeCardLocalData } from './chargeCardList';
|
|
4
|
-
import { FetchState } from '../../../../commonStateTypes/common';
|
|
4
|
+
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
5
5
|
export declare const initialState: ChargeCardListState;
|
|
6
6
|
export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[doFetchCreditAccountsAndCashback: boolean, cacheOverride?: any], {
|
|
7
7
|
doFetchCreditAccountsAndCashback: boolean;
|
|
@@ -14,6 +14,12 @@ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionC
|
|
|
14
14
|
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
15
15
|
}, string>, resetIssueChargeCardForm: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
16
|
uiState: Partial<ChargeCardListUIState>;
|
|
17
|
-
}, string>, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string
|
|
17
|
+
}, string>, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resendCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
|
|
18
|
+
cardId: string;
|
|
19
|
+
}, string, never, never>, resendCardInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
20
|
+
cardId: ID;
|
|
21
|
+
}, string>, resendCardInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, revokeCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
|
|
22
|
+
cardId: string;
|
|
23
|
+
}, string, never, never>, revokeCardInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, revokeCardInviteFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>;
|
|
18
24
|
declare const _default: import("@reduxjs/toolkit").Reducer<ChargeCardListState, import("@reduxjs/toolkit").AnyAction>;
|
|
19
25
|
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.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.resetIssueChargeCardForm = exports.issueChargeCardSuccessOrFailure = exports.updateChargeCardLocalStore = exports.issueChargeCard = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
4
|
+
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.resetIssueChargeCardForm = exports.issueChargeCardSuccessOrFailure = exports.updateChargeCardLocalStore = exports.issueChargeCard = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const chargeCardList_1 = require("./chargeCardList");
|
|
7
7
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
@@ -20,6 +20,8 @@ exports.initialState = {
|
|
|
20
20
|
sortKey: 'owner',
|
|
21
21
|
sortOrder: 'ascending',
|
|
22
22
|
},
|
|
23
|
+
resendCardInvite: chargeCardList_1.initialResendRevokeCardInvite,
|
|
24
|
+
revokeCardInvite: chargeCardList_1.initialResendRevokeCardInvite,
|
|
23
25
|
};
|
|
24
26
|
const chargeCardList = (0, toolkit_1.createSlice)({
|
|
25
27
|
name: 'chargeCardList',
|
|
@@ -100,9 +102,48 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
100
102
|
clearChargeCardList(draft) {
|
|
101
103
|
Object.assign(draft, exports.initialState);
|
|
102
104
|
},
|
|
105
|
+
resendCardInvite: {
|
|
106
|
+
prepare(cardId) {
|
|
107
|
+
return { payload: { cardId } };
|
|
108
|
+
},
|
|
109
|
+
reducer(draft, action) {
|
|
110
|
+
draft.resendCardInvite.cardId = action.payload.cardId;
|
|
111
|
+
draft.revokeCardInvite.saveStatus.fetchState = 'In-Progress';
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
resendCardInviteSuccess(draft, action) {
|
|
115
|
+
if (draft.resendCardInvite.cardId === action.payload.cardId) {
|
|
116
|
+
draft.resendCardInvite.cardId = undefined;
|
|
117
|
+
}
|
|
118
|
+
draft.resendCardInvite.saveStatus.fetchState = 'Completed';
|
|
119
|
+
draft.resendCardInvite.saveStatus.error = undefined;
|
|
120
|
+
},
|
|
121
|
+
resendCardInviteFailure(draft, action) {
|
|
122
|
+
draft.resendCardInvite.cardId = undefined;
|
|
123
|
+
draft.resendCardInvite.saveStatus.fetchState = 'Error';
|
|
124
|
+
draft.resendCardInvite.saveStatus.error = action.payload;
|
|
125
|
+
},
|
|
126
|
+
revokeCardInvite: {
|
|
127
|
+
prepare(cardId) {
|
|
128
|
+
return { payload: { cardId } };
|
|
129
|
+
},
|
|
130
|
+
reducer(draft, action) {
|
|
131
|
+
draft.revokeCardInvite.cardId = action.payload.cardId;
|
|
132
|
+
draft.revokeCardInvite.saveStatus.fetchState = 'In-Progress';
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
revokeCardInviteSuccess(draft, action) {
|
|
136
|
+
draft.revokeCardInvite.saveStatus.fetchState = 'Completed';
|
|
137
|
+
draft.revokeCardInvite.saveStatus.error = undefined;
|
|
138
|
+
draft.cardIds = draft.cardIds.filter((card) => card !== action.payload);
|
|
139
|
+
},
|
|
140
|
+
revokeCardInviteFailure(draft, action) {
|
|
141
|
+
draft.revokeCardInvite.saveStatus.fetchState = 'Error';
|
|
142
|
+
draft.revokeCardInvite.saveStatus.error = action.payload;
|
|
143
|
+
},
|
|
103
144
|
},
|
|
104
145
|
});
|
|
105
|
-
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.issueChargeCard = _a.issueChargeCard, exports.updateChargeCardLocalStore = _a.updateChargeCardLocalStore, exports.issueChargeCardSuccessOrFailure = _a.issueChargeCardSuccessOrFailure, exports.resetIssueChargeCardForm = _a.resetIssueChargeCardForm, exports.updateSearchText = _a.updateSearchText, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList;
|
|
146
|
+
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.issueChargeCard = _a.issueChargeCard, exports.updateChargeCardLocalStore = _a.updateChargeCardLocalStore, exports.issueChargeCardSuccessOrFailure = _a.issueChargeCardSuccessOrFailure, exports.resetIssueChargeCardForm = _a.resetIssueChargeCardForm, 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;
|
|
106
147
|
exports.default = chargeCardList.reducer;
|
|
107
148
|
// helper
|
|
108
149
|
const toCreditAccount = (payload) => ({
|
|
@@ -7,14 +7,16 @@ import { Class, ClassBase } from '../../../../entity/class/classState';
|
|
|
7
7
|
import { User } from '../../../../entity/user/userState';
|
|
8
8
|
import { UserRole } from '../../../../entity/userRole/userRoleState';
|
|
9
9
|
import { RootState } from '../../../../reducer';
|
|
10
|
-
import { ChargeCardListUIState, CreditAccount, IssueChargeCard } from './chargeCardList';
|
|
10
|
+
import { ChargeCardListUIState, CreditAccount, IssueChargeCard, ResendRevokeCardInvite } from './chargeCardList';
|
|
11
11
|
import { Person } from '../../../people/peopleSelectorTypes';
|
|
12
12
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
13
13
|
export interface ChargeCardWithUser extends ChargeCard {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
cardCreatedByUser: User;
|
|
15
|
+
cardHolderUser: User;
|
|
16
|
+
cardHolderRoles: UserRole;
|
|
17
|
+
billingAddress: Address;
|
|
16
18
|
department?: ClassBase;
|
|
17
|
-
|
|
19
|
+
mailingAddress?: Address;
|
|
18
20
|
}
|
|
19
21
|
export interface ChargeCardListSelectorView extends SelectorView {
|
|
20
22
|
totalCashback: Amount;
|
|
@@ -27,6 +29,9 @@ export interface ChargeCardListSelectorView extends SelectorView {
|
|
|
27
29
|
issueCardPageFetchState: FetchStateAndError;
|
|
28
30
|
uiState: ChargeCardListUIState;
|
|
29
31
|
searchText: string;
|
|
32
|
+
resendCardInvite: ResendRevokeCardInvite;
|
|
33
|
+
revokeCardInvite: ResendRevokeCardInvite;
|
|
30
34
|
unAssignedCredits?: Amount;
|
|
31
35
|
}
|
|
32
36
|
export declare const getChargeCardListView: (state: RootState, includeCreditAccountAndCashbackInfo: boolean) => ChargeCardListSelectorView;
|
|
37
|
+
export declare const anyCardOnHold: (cards: ChargeCardWithUser[]) => boolean;
|
|
@@ -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.getChargeCardListView = void 0;
|
|
6
|
+
exports.anyCardOnHold = exports.getChargeCardListView = void 0;
|
|
7
7
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
8
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
9
9
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
@@ -16,9 +16,11 @@ const userListViewSelector_1 = require("../../../userListView/userListViewSelect
|
|
|
16
16
|
const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
17
17
|
const { addressState, chargeCardListState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, classListState, cashbackDetailState, userListViewState, } = state;
|
|
18
18
|
const searchText = chargeCardListState.searchText.toLowerCase();
|
|
19
|
-
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds)
|
|
20
|
-
|
|
19
|
+
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
20
|
+
const chargeCardsWithUser = [];
|
|
21
|
+
cards.forEach((chargeCard) => {
|
|
21
22
|
const cardHolderUser = (0, userSelector_1.getUserByUserId)(userState, chargeCard.cardHolderUserId);
|
|
23
|
+
const cardCreatedByUser = (0, userSelector_1.getUserByUserId)(userState, chargeCard.cardCreaterUserId);
|
|
22
24
|
const cardHolderUserRole = (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, chargeCard.cardHolderUserId);
|
|
23
25
|
const department = cardHolderUserRole != null
|
|
24
26
|
? (0, classSelector_1.getClassById)(classState, {
|
|
@@ -26,20 +28,36 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
26
28
|
reportId: 'class_list',
|
|
27
29
|
})
|
|
28
30
|
: undefined;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const mailingAddress = chargeCard.mailingAddressId != null
|
|
32
|
+
? (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.mailingAddressId)
|
|
33
|
+
: undefined;
|
|
34
|
+
const billingAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, chargeCard.billingAddressId);
|
|
35
|
+
if (cardCreatedByUser == null ||
|
|
36
|
+
cardHolderUser == null ||
|
|
37
|
+
cardHolderUserRole == null ||
|
|
38
|
+
billingAddress == null) {
|
|
39
|
+
console.error(`Cannot find details for card ${chargeCard.id}`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
chargeCardsWithUser.push(Object.assign(Object.assign({}, chargeCard), { cardHolderUser,
|
|
43
|
+
cardCreatedByUser, cardHolderRoles: cardHolderUserRole, billingAddress,
|
|
44
|
+
department,
|
|
45
|
+
mailingAddress }));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
chargeCardsWithUser.filter((cardWithUser) => {
|
|
32
49
|
var _a, _b, _c, _d, _e;
|
|
33
50
|
const derivedCardHolderName = `${(_a = cardWithUser.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName} ${(_b = cardWithUser.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName}`;
|
|
34
51
|
return (cardWithUser.cardName.toLowerCase().includes(searchText) === true ||
|
|
35
52
|
((_c = cardWithUser.cardHolderUser) === null || _c === void 0 ? void 0 : _c.firstName.toLowerCase().includes(searchText)) === true ||
|
|
36
53
|
derivedCardHolderName.toLowerCase().includes(searchText) === true ||
|
|
37
54
|
((_d = cardWithUser.cardHolderUser) === null || _d === void 0 ? void 0 : _d.lastName.toLowerCase().includes(searchText)) === true ||
|
|
38
|
-
((_e = cardWithUser.department) === null || _e === void 0 ? void 0 : _e.className.toLowerCase().includes(searchText)) ===
|
|
55
|
+
((_e = cardWithUser.department) === null || _e === void 0 ? void 0 : _e.className.toLowerCase().includes(searchText)) ===
|
|
56
|
+
true);
|
|
39
57
|
});
|
|
40
58
|
const sortKey = chargeCardListState.uiState.sortKey;
|
|
41
59
|
const sortOrder = (0, sortOrderPayload_1.getSortOrder)(chargeCardListState.uiState.sortOrder);
|
|
42
|
-
const
|
|
60
|
+
const getCardsBySortKey = (card, sortKey) => {
|
|
43
61
|
var _a, _b, _c, _d;
|
|
44
62
|
switch (sortKey) {
|
|
45
63
|
case 'owner': {
|
|
@@ -60,9 +78,23 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
60
78
|
case 'utilisation':
|
|
61
79
|
return card.limit.amount - card.available.amount;
|
|
62
80
|
case 'limit':
|
|
81
|
+
default:
|
|
63
82
|
return card.limit.amount;
|
|
64
83
|
}
|
|
65
|
-
}
|
|
84
|
+
};
|
|
85
|
+
let inviteAcceptedCards = [];
|
|
86
|
+
let inviteNotAcceptedCards = [];
|
|
87
|
+
chargeCardsWithUser.forEach((card) => {
|
|
88
|
+
if (card.status.code !== 'request_on_hold') {
|
|
89
|
+
inviteAcceptedCards.push(card);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
inviteNotAcceptedCards.push(card);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
inviteAcceptedCards = (0, orderBy_1.default)(inviteAcceptedCards, (person) => getCardsBySortKey(person, sortKey), sortOrder);
|
|
96
|
+
inviteNotAcceptedCards = (0, orderBy_1.default)(inviteNotAcceptedCards, (person) => getCardsBySortKey(person, sortKey), sortOrder);
|
|
97
|
+
const cardsInOrder = [...inviteAcceptedCards, ...inviteNotAcceptedCards];
|
|
66
98
|
const userListSelectorView = (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'cardHolderCandidate');
|
|
67
99
|
const userList = userListSelectorView.users;
|
|
68
100
|
const fetchState = includeCreditAccountAndCashbackInfo === true
|
|
@@ -98,6 +130,14 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
98
130
|
uiState: chargeCardListState.uiState,
|
|
99
131
|
searchText,
|
|
100
132
|
version: '1.0',
|
|
133
|
+
resendCardInvite: chargeCardListState.resendCardInvite,
|
|
134
|
+
revokeCardInvite: chargeCardListState.revokeCardInvite,
|
|
101
135
|
};
|
|
102
136
|
};
|
|
103
137
|
exports.getChargeCardListView = getChargeCardListView;
|
|
138
|
+
const anyCardOnHold = (cards) => {
|
|
139
|
+
return cards.reduce((prevValue, currentValue) => {
|
|
140
|
+
return prevValue === true && currentValue.status.code === 'request_on_hold';
|
|
141
|
+
}, true);
|
|
142
|
+
};
|
|
143
|
+
exports.anyCardOnHold = anyCardOnHold;
|
|
@@ -6,5 +6,6 @@ import { fetchChargeCardList, updateChargeCardList, updateChargeCardListFailure,
|
|
|
6
6
|
import { updateChargeCards } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
7
7
|
import { updateAllUsers } from '../../../../entity/user/userReducer';
|
|
8
8
|
import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
|
|
9
|
-
|
|
9
|
+
import { updateAddresses } from '../../../../entity/address/addressReducer';
|
|
10
|
+
export declare type ActionType = ReturnType<typeof fetchChargeCardList> | ReturnType<typeof updateChargeCards> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateChargeCardList> | ReturnType<typeof updateChargeCardListUIState> | ReturnType<typeof updateChargeCardListFailure> | ReturnType<typeof updateAddresses>;
|
|
10
11
|
export declare const fetchChargeCardListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,6 +8,7 @@ const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
|
8
8
|
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
9
9
|
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
10
10
|
const userRoleReducer_1 = require("../../../../entity/userRole/userRoleReducer");
|
|
11
|
+
const addressReducer_1 = require("../../../../entity/address/addressReducer");
|
|
11
12
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
12
13
|
const fetchChargeCardListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.fetchChargeCardList.match), (0, operators_1.switchMap)(() => {
|
|
13
14
|
return zeniAPI
|
|
@@ -20,7 +21,7 @@ const fetchChargeCardListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
20
21
|
if (isChargeCardUser) {
|
|
21
22
|
actions.push((0, chargeCardListReducer_1.updateChargeCardListUIState)({ uiState: { sortKey: 'cardName' } }));
|
|
22
23
|
}
|
|
23
|
-
actions.push((0, chargeCardReducer_1.updateChargeCards)(response.data.cards), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardListReducer_1.updateChargeCardList)({ chargeCardListPayload: response.data }));
|
|
24
|
+
actions.push((0, chargeCardReducer_1.updateChargeCards)(response.data.cards), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardListReducer_1.updateChargeCardList)({ chargeCardListPayload: response.data }));
|
|
24
25
|
return (0, rxjs_1.from)(actions);
|
|
25
26
|
}
|
|
26
27
|
else {
|
|
@@ -20,6 +20,7 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
20
20
|
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)());
|
|
21
21
|
chargeCardListPageAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)());
|
|
22
22
|
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardHolderCandidate', true));
|
|
23
|
+
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardAdmin', true));
|
|
23
24
|
chargeCardListPageAction.push((0, classListReducer_1.fetchClassList)());
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
@@ -48,6 +49,11 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
48
49
|
userList.hasValidState() === false) {
|
|
49
50
|
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardHolderCandidate', false));
|
|
50
51
|
}
|
|
52
|
+
const userAdminList = state.userListViewState.userListByType.cardAdmin;
|
|
53
|
+
if (userAdminList.fetchState !== 'In-Progress' &&
|
|
54
|
+
userAdminList.hasValidState() === false) {
|
|
55
|
+
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardAdmin', false));
|
|
56
|
+
}
|
|
51
57
|
if (state.classListState.hasValidState() === false &&
|
|
52
58
|
state.classListState.fetchState !== 'In-Progress') {
|
|
53
59
|
chargeCardListPageAction.push((0, classListReducer_1.fetchClassList)());
|
|
@@ -5,7 +5,8 @@ import { ZeniAPI } from '../../../../zeniAPI';
|
|
|
5
5
|
import { updateChargeCards } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
6
6
|
import { updateAllUsers } from '../../../../entity/user/userReducer';
|
|
7
7
|
import { updateUserRoles } from '../../../../entity/userRole/userRoleReducer';
|
|
8
|
+
import { updateAddresses } from '../../../../entity/address/addressReducer';
|
|
8
9
|
import { issueChargeCard, issueChargeCardSuccessOrFailure, updateChargeCardList } from './chargeCardListReducer';
|
|
9
10
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
10
|
-
export declare type ActionType = ReturnType<typeof issueChargeCard> | ReturnType<typeof updateChargeCards> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCardList> | ReturnType<typeof issueChargeCardSuccessOrFailure>;
|
|
11
|
+
export declare type ActionType = ReturnType<typeof issueChargeCard> | ReturnType<typeof updateChargeCards> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateChargeCardList> | ReturnType<typeof issueChargeCardSuccessOrFailure> | ReturnType<typeof updateAddresses>;
|
|
11
12
|
export declare const issueChargeCardEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -7,6 +7,7 @@ const responsePayload_1 = require("../../../../responsePayload");
|
|
|
7
7
|
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
8
8
|
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
9
9
|
const userRoleReducer_1 = require("../../../../entity/userRole/userRoleReducer");
|
|
10
|
+
const addressReducer_1 = require("../../../../entity/address/addressReducer");
|
|
10
11
|
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
11
12
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
12
13
|
const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.issueChargeCard.match), (0, operators_1.switchMap)(() => {
|
|
@@ -20,7 +21,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
20
21
|
credit_limit: (_b = (_a = localData.amount) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0,
|
|
21
22
|
currency_code: (_d = (_c = localData.amount) === null || _c === void 0 ? void 0 : _c.currencyCode) !== null && _d !== void 0 ? _d : 'USD',
|
|
22
23
|
credit_limit_frequency: { code: localData.frequency },
|
|
23
|
-
card_type: '
|
|
24
|
+
card_type: 'business_virtual_credit_card',
|
|
24
25
|
},
|
|
25
26
|
];
|
|
26
27
|
return zeniAPI
|
|
@@ -31,7 +32,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
31
32
|
actions.push((0, chargeCardReducer_1.updateChargeCards)(response.data.cards), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardListReducer_1.updateChargeCardList)({
|
|
32
33
|
chargeCardListPayload: response.data,
|
|
33
34
|
keepExistingListItems: true,
|
|
34
|
-
}), (0, chargeCardListReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
35
|
+
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardListReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
35
36
|
const names = response.data.users
|
|
36
37
|
.map((user) => { var _a, _b, _c; return (_b = (_a = user.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : (_c = user.last_name) === null || _c === void 0 ? void 0 : _c.trim(); })
|
|
37
38
|
.join(', ');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { resendCardInvite, resendCardInviteSuccess, resendCardInviteFailure, fetchChargeCardList } from './chargeCardListReducer';
|
|
6
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
7
|
+
import { updateChargeCard } from '../../../../entity/chargeCard/chargeCardReducer';
|
|
8
|
+
export declare type ActionType = ReturnType<typeof resendCardInvite> | ReturnType<typeof openSnackbar> | ReturnType<typeof resendCardInviteSuccess> | ReturnType<typeof resendCardInviteFailure> | ReturnType<typeof fetchChargeCardList> | ReturnType<typeof updateChargeCard>;
|
|
9
|
+
export declare const resendCardInviteEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resendCardInviteEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardReducer");
|
|
10
|
+
const resendCardInviteEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.resendCardInvite.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
+
const { cardId } = action.payload;
|
|
12
|
+
return zeniAPI
|
|
13
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${cardId}/resend-reminder`, { card_issuance_request: true })
|
|
14
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
16
|
+
return (0, rxjs_1.of)((0, chargeCardReducer_1.updateChargeCard)(response.data), // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
17
|
+
(0, chargeCardListReducer_1.resendCardInviteSuccess)({ cardId: action.payload.cardId }), (0, snackbarReducer_1.openSnackbar)({
|
|
18
|
+
messageSection: 'charge_card_resend_invite',
|
|
19
|
+
messageText: 'success',
|
|
20
|
+
type: 'success',
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return (0, rxjs_1.of)((0, chargeCardListReducer_1.resendCardInviteFailure)(response.status));
|
|
25
|
+
}
|
|
26
|
+
}), (0, operators_1.catchError)((error) => {
|
|
27
|
+
return (0, rxjs_1.of)((0, chargeCardListReducer_1.resendCardInviteFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Resend Charge Card REST API call errored out' +
|
|
28
|
+
JSON.stringify(error))));
|
|
29
|
+
}));
|
|
30
|
+
}));
|
|
31
|
+
exports.resendCardInviteEpic = resendCardInviteEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { revokeCardInvite, revokeCardInviteSuccess, revokeCardInviteFailure } from './chargeCardListReducer';
|
|
6
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof revokeCardInvite> | ReturnType<typeof openSnackbar> | ReturnType<typeof revokeCardInviteSuccess> | ReturnType<typeof revokeCardInviteFailure>;
|
|
8
|
+
export declare const revokeCardInviteEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.revokeCardInviteEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const revokeCardInviteEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.revokeCardInvite.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { cardId } = action.payload;
|
|
11
|
+
return zeniAPI
|
|
12
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/${cardId}/cancel-issue-request`)
|
|
13
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
15
|
+
return (0, rxjs_1.of)((0, chargeCardListReducer_1.revokeCardInviteSuccess)(cardId), (0, snackbarReducer_1.openSnackbar)({
|
|
16
|
+
messageSection: 'charge_card_revoke_invite',
|
|
17
|
+
messageText: 'success',
|
|
18
|
+
type: 'success',
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return (0, rxjs_1.of)((0, chargeCardListReducer_1.revokeCardInviteFailure)(response.status));
|
|
23
|
+
}
|
|
24
|
+
}), (0, operators_1.catchError)((error) => {
|
|
25
|
+
return (0, rxjs_1.of)((0, chargeCardListReducer_1.revokeCardInviteFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Revoke Charge Card REST API call errored out' +
|
|
26
|
+
JSON.stringify(error))));
|
|
27
|
+
}));
|
|
28
|
+
}));
|
|
29
|
+
exports.revokeCardInviteEpic = revokeCardInviteEpic;
|
|
@@ -8,7 +8,7 @@ import { updateCreatedTagToLocalStore } from '../../taskManager/taskDetailView/t
|
|
|
8
8
|
export declare type ActionType = ReturnType<typeof createTag> | ReturnType<typeof updateTagCreateStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateCreatedTagToLocalStore> | ReturnType<typeof updateTags>;
|
|
9
9
|
export declare const createTagEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
10
10
|
payload: {
|
|
11
|
-
messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_accept_term" | "charge_card_receipt_upload" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation";
|
|
11
|
+
messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation";
|
|
12
12
|
messageText: "failed" | "success" | "notification";
|
|
13
13
|
type: import("../../..").SnackbarMessageType;
|
|
14
14
|
showStatusIcon?: boolean | undefined;
|
|
@@ -9,7 +9,7 @@ export declare const deleteTagEpic: (actions$: ActionsObservable<ActionType>, _s
|
|
|
9
9
|
type: string;
|
|
10
10
|
} | {
|
|
11
11
|
payload: {
|
|
12
|
-
messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_accept_term" | "charge_card_receipt_upload" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation";
|
|
12
|
+
messageSection: "bill_pay_setup" | "reimbursement_setup" | "charge_card_setup" | "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "create_schedule" | "save_schedule" | "delete_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "issue_charge_card" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation";
|
|
13
13
|
messageText: "failed" | "success" | "notification";
|
|
14
14
|
type: import("../../..").SnackbarMessageType;
|
|
15
15
|
showStatusIcon?: boolean | undefined;
|
|
@@ -6,5 +6,7 @@ import { resendOtp, sendOtpSuccess, sendOtpFailure } from './twoFactorAuthentica
|
|
|
6
6
|
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
7
7
|
import { resendOtpVendorView, sendOtpVendorViewSuccess, sendOtpVendorViewFailure } from '../commonVendorView/vendorView/vendorViewReducer';
|
|
8
8
|
import { resendOnboardingOfficerOtp, sendOnboardingOfficerOtpFailure, sendOnboardingOfficerOtpSuccess } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
9
|
-
|
|
9
|
+
import { sendOtpMyProfileFailure, sendOtpMyProfileSuccess, resendOtpMyProfile } from '../settingsView/settingsViewReducer';
|
|
10
|
+
import { resendOtpCardUserOnboarding, sendOtpCardUserOnboardingFailure, sendOtpCardUserOnboardingSuccess } from '../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer';
|
|
11
|
+
export declare type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof resendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof resendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof resendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure> | ReturnType<typeof resendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof resendOtpMyProfile> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
10
12
|
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|