@zeniai/client-epic-state 4.12.67 → 4.12.69
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/view/spendManagement/billPay/billDetailView/epics/retryOrRefundBillEpic.js +21 -17
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +3 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/issueChargeCardEpic.js +5 -8
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReduce
|
|
|
9
9
|
const billDetailViewState_1 = require("../billDetailViewState");
|
|
10
10
|
const billTransactionReducer_1 = require("../../../../../entity/billPay/billTransaction/billTransactionReducer");
|
|
11
11
|
const retryOrRefundBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billDetailViewReducer_1.retryOrRefundBill.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
-
var _a, _b, _c, _d, _e, _f;
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
13
13
|
const { billId, actionType } = action.payload;
|
|
14
14
|
const { editBillDetailViewState } = state$.value;
|
|
15
15
|
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
@@ -18,23 +18,27 @@ const retryOrRefundBillEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
18
18
|
let payload;
|
|
19
19
|
if (actionType === 'retry') {
|
|
20
20
|
apiUrl = `${apiUrl}/payment/retry`;
|
|
21
|
-
payload =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
?
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
? (_f = (_e = billDetail.billDetailLocalData.paymentDetailsSection) === null || _e === void 0 ? void 0 : _e.paymentTo) !== null && _f !== void 0 ? _f : null
|
|
34
|
-
: null,
|
|
21
|
+
payload =
|
|
22
|
+
Boolean(billDetail.billDetailLocalData
|
|
23
|
+
.isCollectToAccountInfoFromVendorContact) === false
|
|
24
|
+
? {
|
|
25
|
+
bill_pay_info: {
|
|
26
|
+
to_account: ((_b = (_a = billDetail.billDetailLocalData.paymentDetailsSection) === null || _a === void 0 ? void 0 : _a.paymentType) === null || _b === void 0 ? void 0 : _b.method.includes('international')) === true
|
|
27
|
+
? {
|
|
28
|
+
payment_instrument_id: (_d = (_c = billDetail.billDetailLocalData.paymentDetailsSection) === null || _c === void 0 ? void 0 : _c.paymentTo) !== null && _d !== void 0 ? _d : null,
|
|
29
|
+
}
|
|
30
|
+
: {
|
|
31
|
+
account_id: (_f = (_e = billDetail.billDetailLocalData.paymentDetailsSection) === null || _e === void 0 ? void 0 : _e.paymentTo) !== null && _f !== void 0 ? _f : null,
|
|
32
|
+
},
|
|
35
33
|
},
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
}
|
|
35
|
+
: {
|
|
36
|
+
bill_pay_info: {
|
|
37
|
+
to_account_vendor_email: (_g = billDetail.billDetailLocalData.toAccountVendorEmail) !== null && _g !== void 0 ? _g : null,
|
|
38
|
+
is_collect_to_account_info_from_vendor_contact: billDetail.billDetailLocalData
|
|
39
|
+
.isCollectToAccountInfoFromVendorContact,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
38
42
|
}
|
|
39
43
|
else {
|
|
40
44
|
apiUrl = `${apiUrl}/payment/refund`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
2
|
import { RootState } from '../../../../reducer';
|
|
3
3
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
import { BillTransaction } from '../../../../entity/billPay/billTransaction/billTransactionState';
|
|
4
|
+
import { BillPayInfo, BillTransaction } from '../../../../entity/billPay/billTransaction/billTransactionState';
|
|
5
5
|
import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
|
|
6
6
|
import { TransactionWithAccountAndClassLine } from '../../../../entity/transaction/stateTypes/transactionLine';
|
|
7
7
|
import { Vendor } from '../../../../entity/vendor/vendorState';
|
|
@@ -25,6 +25,7 @@ export interface BillPayReviewSelectorView extends SelectorView {
|
|
|
25
25
|
billPayConfigList: BillPayConfig[];
|
|
26
26
|
isRecurring: boolean;
|
|
27
27
|
isInvoiceDateAutoUpdated: boolean;
|
|
28
|
+
billPayInfo?: BillPayInfo;
|
|
28
29
|
recurringBillInstance?: number;
|
|
29
30
|
recurringConfig?: RecurringBillConfigLocalData;
|
|
30
31
|
isBillMarkedForRetry?: boolean;
|
|
@@ -58,6 +58,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
58
58
|
let isRecurring = false;
|
|
59
59
|
let recurringBillInstance;
|
|
60
60
|
let recurringConfig;
|
|
61
|
+
let billPayInfo;
|
|
61
62
|
let isBillMarkedForRetry = false;
|
|
62
63
|
const zeniAssistRetryStatus = billId != null
|
|
63
64
|
? billDetailViewState.billDetailById[key].zeniAssist.retryStatus
|
|
@@ -68,6 +69,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
68
69
|
isCollectToAccountInfoFromVendorContact =
|
|
69
70
|
(_b = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.isCollectToAccountInfoFromVendorContact) !== null && _b !== void 0 ? _b : false;
|
|
70
71
|
isRecurring = (_c = transaction === null || transaction === void 0 ? void 0 : transaction.isRecurring) !== null && _c !== void 0 ? _c : false;
|
|
72
|
+
billPayInfo = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo;
|
|
71
73
|
if (isRecurring &&
|
|
72
74
|
(transaction === null || transaction === void 0 ? void 0 : transaction.recurringBillConfigId) != null &&
|
|
73
75
|
transaction.recurringBillInstance != null) {
|
|
@@ -177,6 +179,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
177
179
|
isInvoiceDateAutoUpdated: (_y = whatForSection.isInvoiceDateAutoUpdated) !== null && _y !== void 0 ? _y : false,
|
|
178
180
|
isBillMarkedForRetry,
|
|
179
181
|
zeniAssistRetryStatus,
|
|
182
|
+
billPayInfo,
|
|
180
183
|
};
|
|
181
184
|
};
|
|
182
185
|
exports.getReviewPageBillDetail = getReviewPageBillDetail;
|
|
@@ -27,20 +27,17 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
27
27
|
return zeniAPI
|
|
28
28
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards`, { cards: payload })
|
|
29
29
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
30
|
-
var _a, _b, _c;
|
|
31
30
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
32
31
|
const actions = [];
|
|
33
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)({
|
|
34
33
|
chargeCardListPayload: response.data,
|
|
35
34
|
keepExistingListItems: true,
|
|
36
35
|
}), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardListReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
37
|
-
|
|
38
|
-
const names = response.data.users
|
|
39
|
-
|
|
40
|
-
:
|
|
41
|
-
|
|
42
|
-
.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(); })
|
|
43
|
-
.join(', ');
|
|
36
|
+
const cardHolderIds = response.data.cards.map((card) => card.holder_user_id);
|
|
37
|
+
const names = response.data.users
|
|
38
|
+
.filter((user) => cardHolderIds.includes(user.user_id))
|
|
39
|
+
.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(); })
|
|
40
|
+
.join(', ');
|
|
44
41
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
45
42
|
messageSection: 'issue_charge_card',
|
|
46
43
|
messageText: 'success',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.69",
|
|
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",
|