@zeniai/client-epic-state 4.13.6 → 4.13.9
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 +16 -2
- package/lib/entity/chargeCard/chargeCard.js +18 -1
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +14 -5
- package/lib/entity/chargeCard/chargeCardPayload.js +24 -7
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/epic.d.ts +4 -2
- package/lib/epic.js +4 -2
- package/lib/index.d.ts +15 -10
- package/lib/index.js +36 -20
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/addressView/toAddressViewLocalData.d.ts +2 -0
- package/lib/view/addressView/toAddressViewLocalData.js +5 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +1 -1
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.js +2 -5
- package/lib/view/settingsView/epic/updateMyProfileEpic.js +6 -4
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.d.ts +3 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer.js +6 -2
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.d.ts +2 -3
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -3
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingState.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.js +1 -21
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/saveCardOnboardingUserDetailsEpic.js +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +4 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +8 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +25 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +8 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updatePhysicalChargeCardAttemptEpic.js +42 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +2 -13
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +2 -17
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +8 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +55 -15
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +9 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +44 -0
- package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.d.ts +3 -2
- package/lib/view/spendManagement/chargeCards/{chargeCardList → issueChargeCard}/issueChargeCardEpic.js +35 -18
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +65 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +22 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +76 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +28 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +23 -0
- package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -1
- package/package.json +1 -1
|
@@ -8,22 +8,39 @@ const chargeCardReducer_1 = require("../../../../entity/chargeCard/chargeCardRed
|
|
|
8
8
|
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
9
9
|
const userRoleReducer_1 = require("../../../../entity/userRole/userRoleReducer");
|
|
10
10
|
const addressReducer_1 = require("../../../../entity/address/addressReducer");
|
|
11
|
-
const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
12
11
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
const issueChargeCardReducer_1 = require("./issueChargeCardReducer");
|
|
13
|
+
const chargeCardListReducer_1 = require("../chargeCardList/chargeCardListReducer");
|
|
14
|
+
const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(issueChargeCardReducer_1.issueChargeCards.match), (0, operators_1.switchMap)(() => {
|
|
15
15
|
const state = state$.value;
|
|
16
|
-
const localData = state.
|
|
17
|
-
const payload =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
const localData = state.issueChargeCardState.localData;
|
|
17
|
+
const payload = localData.map((data) => {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19
|
+
if (data.cardType === 'business_physical_credit_card') {
|
|
20
|
+
return {
|
|
21
|
+
card_holder_user_ids: data.physicalCard.userIds != null
|
|
22
|
+
? [data.physicalCard.userIds]
|
|
23
|
+
: [],
|
|
24
|
+
card_name: data.physicalCard.cardName,
|
|
25
|
+
credit_limit: (_b = (_a = data.physicalCard.amount) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0,
|
|
26
|
+
currency_code: (_d = (_c = data.physicalCard.amount) === null || _c === void 0 ? void 0 : _c.currencyCode) !== null && _d !== void 0 ? _d : 'USD',
|
|
27
|
+
credit_limit_frequency: { code: data.physicalCard.frequency },
|
|
28
|
+
card_type: data.cardType,
|
|
29
|
+
shipping_address_type: data.physicalCard.addressType,
|
|
30
|
+
shipping_address_id: data.physicalCard.addressId,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return {
|
|
35
|
+
card_holder_user_ids: data.virtualCard.userIds,
|
|
36
|
+
card_name: data.virtualCard.cardName,
|
|
37
|
+
credit_limit: (_f = (_e = data.virtualCard.amount) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : 0,
|
|
38
|
+
currency_code: (_h = (_g = data.virtualCard.amount) === null || _g === void 0 ? void 0 : _g.currencyCode) !== null && _h !== void 0 ? _h : 'USD',
|
|
39
|
+
credit_limit_frequency: { code: data.virtualCard.frequency },
|
|
40
|
+
card_type: data.cardType,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
27
44
|
return zeniAPI
|
|
28
45
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards`, { cards: payload })
|
|
29
46
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -32,7 +49,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
32
49
|
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)({
|
|
33
50
|
chargeCardListPayload: response.data,
|
|
34
51
|
keepExistingListItems: true,
|
|
35
|
-
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0,
|
|
52
|
+
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, issueChargeCardReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
36
53
|
const cardHolderIds = response.data.cards.map((card) => card.holder_user_id);
|
|
37
54
|
const names = response.data.users
|
|
38
55
|
.filter((user) => cardHolderIds.includes(user.user_id))
|
|
@@ -45,20 +62,20 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
45
62
|
variables: [
|
|
46
63
|
{
|
|
47
64
|
variableName: '_user-name_',
|
|
48
|
-
variableValue: names
|
|
65
|
+
variableValue: names,
|
|
49
66
|
},
|
|
50
67
|
],
|
|
51
68
|
}));
|
|
52
69
|
return (0, rxjs_1.from)(actions);
|
|
53
70
|
}
|
|
54
71
|
else {
|
|
55
|
-
return (0, rxjs_1.of)((0,
|
|
72
|
+
return (0, rxjs_1.of)((0, issueChargeCardReducer_1.issueChargeCardSuccessOrFailure)({
|
|
56
73
|
fetchState: 'Error',
|
|
57
74
|
error: response.status,
|
|
58
75
|
}));
|
|
59
76
|
}
|
|
60
77
|
}), (0, operators_1.catchError)((error) => {
|
|
61
|
-
return (0, rxjs_1.of)((0,
|
|
78
|
+
return (0, rxjs_1.of)((0, issueChargeCardReducer_1.issueChargeCardSuccessOrFailure)({
|
|
62
79
|
fetchState: 'Error',
|
|
63
80
|
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Issue Charge Card REST API call errored out' +
|
|
64
81
|
JSON.stringify(error)),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
|
+
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { IssueChargeCardState, IssueChargeCardLocalData } from './issueChargeCardState';
|
|
4
|
+
export declare const initialState: IssueChargeCardState;
|
|
5
|
+
export declare const issueChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[], {}, string, never, never>, updateChargeCardsLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<IssueChargeCardLocalData[], string>, issueChargeCardSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
6
|
+
fetchState: FetchState;
|
|
7
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
8
|
+
}, string>, resetIssueChargeCardForm: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateCustomAddressId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
addressId: ID;
|
|
10
|
+
cardLineId: ID;
|
|
11
|
+
}, string>, fetchIssueCardPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
12
|
+
cacheOverride: any;
|
|
13
|
+
}, string, never, never>, clearIssueChargeCard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
14
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<IssueChargeCardState, import("@reduxjs/toolkit").AnyAction>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearIssueChargeCard = exports.fetchIssueCardPage = exports.updateCustomAddressId = exports.resetIssueChargeCardForm = exports.issueChargeCardSuccessOrFailure = exports.updateChargeCardsLocalStore = exports.issueChargeCards = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const issueChargeCardState_1 = require("./issueChargeCardState");
|
|
7
|
+
exports.initialState = {
|
|
8
|
+
localData: issueChargeCardState_1.initialIssueChargeCardLocalData,
|
|
9
|
+
fetchState: 'Not-Started',
|
|
10
|
+
error: undefined,
|
|
11
|
+
saveStatus: {
|
|
12
|
+
fetchState: 'Not-Started',
|
|
13
|
+
error: undefined,
|
|
14
|
+
},
|
|
15
|
+
hasValidState() {
|
|
16
|
+
return this.fetchState == 'Completed';
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const issueChargeCard = (0, toolkit_1.createSlice)({
|
|
20
|
+
name: 'issueChargeCard',
|
|
21
|
+
initialState: exports.initialState,
|
|
22
|
+
reducers: {
|
|
23
|
+
fetchIssueCardPage: {
|
|
24
|
+
reducer() {
|
|
25
|
+
//do nothing
|
|
26
|
+
},
|
|
27
|
+
prepare(cacheOverride = false) {
|
|
28
|
+
return {
|
|
29
|
+
payload: { cacheOverride },
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
issueChargeCards: {
|
|
34
|
+
prepare() {
|
|
35
|
+
return { payload: {} };
|
|
36
|
+
},
|
|
37
|
+
reducer(draft) {
|
|
38
|
+
draft.saveStatus.fetchState = 'In-Progress';
|
|
39
|
+
draft.saveStatus.error = undefined;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
updateChargeCardsLocalStore(draft, action) {
|
|
43
|
+
draft.localData = action.payload;
|
|
44
|
+
},
|
|
45
|
+
resetIssueChargeCardForm(draft) {
|
|
46
|
+
draft.localData = [...exports.initialState.localData];
|
|
47
|
+
},
|
|
48
|
+
issueChargeCardSuccessOrFailure(draft, action) {
|
|
49
|
+
draft.saveStatus.fetchState = action.payload.fetchState;
|
|
50
|
+
draft.saveStatus.error = action.payload.error;
|
|
51
|
+
},
|
|
52
|
+
updateCustomAddressId(draft, action) {
|
|
53
|
+
const { addressId, cardLineId } = action.payload;
|
|
54
|
+
const targetIndex = draft.localData.findIndex((lineItem) => lineItem.lineId === cardLineId);
|
|
55
|
+
if (targetIndex > -1) {
|
|
56
|
+
draft.localData[targetIndex] = Object.assign(Object.assign({}, draft.localData[targetIndex]), { physicalCard: Object.assign(Object.assign({}, draft.localData[targetIndex].physicalCard), { addressId: addressId }) });
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
clearIssueChargeCard(draft) {
|
|
60
|
+
Object.assign(draft, exports.initialState);
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
_a = issueChargeCard.actions, exports.issueChargeCards = _a.issueChargeCards, exports.updateChargeCardsLocalStore = _a.updateChargeCardsLocalStore, exports.issueChargeCardSuccessOrFailure = _a.issueChargeCardSuccessOrFailure, exports.resetIssueChargeCardForm = _a.resetIssueChargeCardForm, exports.updateCustomAddressId = _a.updateCustomAddressId, exports.fetchIssueCardPage = _a.fetchIssueCardPage, exports.clearIssueChargeCard = _a.clearIssueChargeCard;
|
|
65
|
+
exports.default = issueChargeCard.reducer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RootState } from '../../../../reducer';
|
|
2
|
+
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
+
import { Address } from '../../../../entity/address/addressState';
|
|
5
|
+
import { Person } from '../../../people/peopleSelectorTypes';
|
|
6
|
+
import { Class } from '../../../../entity/class/classState';
|
|
7
|
+
import { IssueChargeCardLocalData } from './issueChargeCardState';
|
|
8
|
+
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
9
|
+
import { CreditAccount } from '../chargeCardList/chargeCardList';
|
|
10
|
+
export interface IssueChargeCardSelectorView extends SelectorView {
|
|
11
|
+
localData: IssueChargeCardLocalData[];
|
|
12
|
+
issueCardStatus: FetchStateAndError;
|
|
13
|
+
userList: Person[];
|
|
14
|
+
allAccountingClasses: Class[];
|
|
15
|
+
chargeCardConfig: ChargeCardConfigState;
|
|
16
|
+
creditAccount: CreditAccount;
|
|
17
|
+
customAddress: Record<ID, Address>;
|
|
18
|
+
customAddressStatus: Record<ID, FetchStateAndError>;
|
|
19
|
+
userAddress: Record<ID, Address>;
|
|
20
|
+
companyAddress?: Address;
|
|
21
|
+
}
|
|
22
|
+
export declare const getIssueChargeCardView: (state: RootState) => IssueChargeCardSelectorView;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIssueChargeCardView = void 0;
|
|
4
|
+
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
5
|
+
const addressSelector_1 = require("../../../../entity/address/addressSelector");
|
|
6
|
+
const addressViewSelector_1 = require("../../../addressView/addressViewSelector");
|
|
7
|
+
const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompanyView");
|
|
8
|
+
const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
9
|
+
const userListViewSelector_1 = require("../../../userListView/userListViewSelector");
|
|
10
|
+
const getIssueChargeCardView = (state) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const { issueChargeCardState, userState, userRoleState, userListViewState, chargeCardConfigState, chargeCardListState, tenantState, addressState, classState, classListState, } = state;
|
|
13
|
+
const userListSelectorView = (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'cardHolderCandidate');
|
|
14
|
+
const userList = userListSelectorView.users;
|
|
15
|
+
let selectedUserAddress = {};
|
|
16
|
+
userList.forEach((user) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const userAddress = (0, addressSelector_1.getAddressByAddressId)(addressState, (_b = (_a = user.user) === null || _a === void 0 ? void 0 : _a.addressId) !== null && _b !== void 0 ? _b : '');
|
|
19
|
+
if (userAddress != null) {
|
|
20
|
+
selectedUserAddress = Object.assign(Object.assign({}, selectedUserAddress), { [user.userId]: userAddress });
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const { currentTenantId } = tenantState;
|
|
24
|
+
const companyId = currentTenantId != null
|
|
25
|
+
? (_b = (_a = tenantState.tenantsById) === null || _a === void 0 ? void 0 : _a[currentTenantId]) === null || _b === void 0 ? void 0 : _b.companyId
|
|
26
|
+
: '';
|
|
27
|
+
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
28
|
+
const companyAddress = companyView === null || companyView === void 0 ? void 0 : companyView.companyAddress;
|
|
29
|
+
let customAddressStatus = {};
|
|
30
|
+
let customAddress = {};
|
|
31
|
+
const defaultFetchState = {
|
|
32
|
+
fetchState: 'Not-Started',
|
|
33
|
+
error: undefined,
|
|
34
|
+
};
|
|
35
|
+
issueChargeCardState.localData.forEach((lineItem) => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (lineItem.cardType === 'business_physical_credit_card') {
|
|
38
|
+
const targetLineId = lineItem.lineId;
|
|
39
|
+
const newlyAddedAddress = (0, addressViewSelector_1.getNewAddress)(`custom_shipping_${targetLineId}_address`, state);
|
|
40
|
+
customAddressStatus = Object.assign(Object.assign({}, customAddressStatus), { [targetLineId]: (_a = newlyAddedAddress === null || newlyAddedAddress === void 0 ? void 0 : newlyAddedAddress.status) !== null && _a !== void 0 ? _a : defaultFetchState });
|
|
41
|
+
if (newlyAddedAddress != null &&
|
|
42
|
+
newlyAddedAddress.status.fetchState === 'Completed' &&
|
|
43
|
+
newlyAddedAddress.newAddressId != null) {
|
|
44
|
+
const addressFromEntity = (0, addressSelector_1.getAddressByAddressId)(addressState, newlyAddedAddress.newAddressId);
|
|
45
|
+
if (addressFromEntity != null) {
|
|
46
|
+
customAddress = Object.assign(Object.assign({}, customAddress), { [targetLineId]: addressFromEntity });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const issueCardPageFetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
52
|
+
chargeCardConfigState,
|
|
53
|
+
userListSelectorView,
|
|
54
|
+
chargeCardListState.creditAccount,
|
|
55
|
+
]);
|
|
56
|
+
const { classIds } = classListState;
|
|
57
|
+
const allAccountingClasses = (0, classSelector_1.getClassesByIds)(classState, {
|
|
58
|
+
classIds: classIds,
|
|
59
|
+
reportId: 'class_list',
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
fetchState: issueCardPageFetchState.fetchState,
|
|
63
|
+
error: issueCardPageFetchState.error,
|
|
64
|
+
issueCardStatus: issueChargeCardState.saveStatus,
|
|
65
|
+
localData: issueChargeCardState.localData,
|
|
66
|
+
userList,
|
|
67
|
+
chargeCardConfig: chargeCardConfigState,
|
|
68
|
+
creditAccount: chargeCardListState.creditAccount,
|
|
69
|
+
companyAddress: companyAddress,
|
|
70
|
+
customAddress,
|
|
71
|
+
customAddressStatus,
|
|
72
|
+
userAddress: selectedUserAddress,
|
|
73
|
+
allAccountingClasses,
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
exports.getIssueChargeCardView = getIssueChargeCardView;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
+
import { FetchedState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { CreditLimitFrequencyCodeType, CardCodeType, ShippingAddressType } from '../../../../entity/chargeCard/chargeCard';
|
|
4
|
+
export interface IssueChargeCardState extends FetchedState {
|
|
5
|
+
localData: IssueChargeCardLocalData[];
|
|
6
|
+
saveStatus: FetchStateAndError;
|
|
7
|
+
}
|
|
8
|
+
export interface PhysicalCardData {
|
|
9
|
+
addressType: ShippingAddressType;
|
|
10
|
+
cardName: string;
|
|
11
|
+
frequency: CreditLimitFrequencyCodeType;
|
|
12
|
+
addressId?: ID;
|
|
13
|
+
amount?: Amount;
|
|
14
|
+
userIds?: ID;
|
|
15
|
+
}
|
|
16
|
+
export interface VirtualCardData {
|
|
17
|
+
userIds: ID[];
|
|
18
|
+
cardName: string;
|
|
19
|
+
frequency: CreditLimitFrequencyCodeType;
|
|
20
|
+
amount?: Amount;
|
|
21
|
+
}
|
|
22
|
+
export interface IssueChargeCardLocalData {
|
|
23
|
+
lineId: ID;
|
|
24
|
+
cardType: CardCodeType;
|
|
25
|
+
physicalCard: PhysicalCardData;
|
|
26
|
+
virtualCard: VirtualCardData;
|
|
27
|
+
}
|
|
28
|
+
export declare const initialIssueChargeCardLocalData: IssueChargeCardLocalData[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initialIssueChargeCardLocalData = void 0;
|
|
4
|
+
exports.initialIssueChargeCardLocalData = [
|
|
5
|
+
{
|
|
6
|
+
lineId: '1',
|
|
7
|
+
cardType: 'business_virtual_credit_card',
|
|
8
|
+
physicalCard: {
|
|
9
|
+
addressType: 'company_address',
|
|
10
|
+
cardName: '',
|
|
11
|
+
frequency: 'monthly',
|
|
12
|
+
addressId: undefined,
|
|
13
|
+
amount: undefined,
|
|
14
|
+
userIds: undefined,
|
|
15
|
+
},
|
|
16
|
+
virtualCard: {
|
|
17
|
+
userIds: [],
|
|
18
|
+
cardName: '',
|
|
19
|
+
frequency: 'monthly',
|
|
20
|
+
amount: undefined,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -46,7 +46,10 @@ const getQueryParam = (userType, isZeniTenant) => {
|
|
|
46
46
|
case 'manager':
|
|
47
47
|
return { is_manager_candidate: true };
|
|
48
48
|
case 'cardHolderCandidate':
|
|
49
|
-
return {
|
|
49
|
+
return {
|
|
50
|
+
is_card_holder_candidate: true,
|
|
51
|
+
is_include_active_cards_count: true,
|
|
52
|
+
};
|
|
50
53
|
case 'taskManagerCandidate':
|
|
51
54
|
return { is_task_manager_candidate: true };
|
|
52
55
|
case 'cardAdmin':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.9",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|