@zeniai/client-epic-state 4.11.38 → 4.11.39
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/cardPayment/cardPaymentPayload.js +2 -2
- package/lib/entity/chargeCard/chargeCardPayload.js +1 -1
- package/lib/entity/customer/customerPayload.js +2 -2
- package/lib/entity/tenant/tenantReducer.js +2 -2
- package/lib/entity/user/userReducer.js +12 -12
- package/lib/entity/vendor/vendorPayload.js +3 -3
- package/lib/view/companyView/epic/companyPassport/createCompanyOfficersEpic.js +2 -2
- package/lib/view/companyView/epic/companyPassport/updatePrimaryContactEpic.js +2 -2
- package/lib/view/onboardingView/cockpitView/epic/sendOnboardingCustomerViewInviteEpic.js +9 -1
- package/lib/view/people/peopleSelector.js +2 -2
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +13 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/issueChargeCardEpic.js +1 -1
- package/lib/view/vendorReviewView/common/payload/commonTypes.js +3 -2
- package/package.json +1 -1
|
@@ -7,9 +7,9 @@ const mapCardPaymentPayloadToCardPayment = (payload) => ({
|
|
|
7
7
|
brand: payload.brand,
|
|
8
8
|
expiryMonth: payload.expiry_month,
|
|
9
9
|
expiryYear: payload.expiry_year,
|
|
10
|
-
firstName: payload.first_name,
|
|
10
|
+
firstName: payload.first_name.trim(),
|
|
11
11
|
last4: payload.last4,
|
|
12
|
-
lastName: payload.last_name,
|
|
12
|
+
lastName: payload.last_name.trim(),
|
|
13
13
|
maskedNumber: payload.masked_number,
|
|
14
14
|
});
|
|
15
15
|
exports.mapCardPaymentPayloadToCardPayment = mapCardPaymentPayloadToCardPayment;
|
|
@@ -8,7 +8,7 @@ const chargeCard_1 = require("./chargeCard");
|
|
|
8
8
|
const mapChargeCardPayloadToChargeCard = (payload) => ({
|
|
9
9
|
id: payload.card_id,
|
|
10
10
|
type: (0, chargeCard_1.toCardType)(payload.card_type),
|
|
11
|
-
cardName: payload.card_name,
|
|
11
|
+
cardName: payload.card_name.trim(),
|
|
12
12
|
limit: (0, amount_1.toAmount)(payload.credit_limit, payload.currency_code, payload.currency_symbol),
|
|
13
13
|
balance: (0, amount_1.toAmount)(payload.balance_amount, payload.currency_code, payload.currency_symbol),
|
|
14
14
|
hold: (0, amount_1.toAmount)(payload.hold_amount, payload.currency_code, payload.currency_symbol),
|
|
@@ -22,8 +22,8 @@ const toCustomerBasePayload = (customer) => {
|
|
|
22
22
|
};
|
|
23
23
|
exports.toCustomerBasePayload = toCustomerBasePayload;
|
|
24
24
|
const toCustomer = (payload, parseOutParentName = false) => {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
26
|
-
return (Object.assign(Object.assign({}, (0, exports.toCustomerBase)(payload, parseOutParentName)), { addressId: (_a = payload.address_id) !== null && _a !== void 0 ? _a : undefined, lastName: (_b = payload.last_name) !== null &&
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
26
|
+
return (Object.assign(Object.assign({}, (0, exports.toCustomerBase)(payload, parseOutParentName)), { addressId: (_a = payload.address_id) !== null && _a !== void 0 ? _a : undefined, lastName: (_c = (_b = payload.last_name) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : undefined, paymentMethodId: (_d = payload.payment_method_id) !== null && _d !== void 0 ? _d : undefined, suffix: (_e = payload.suffix) !== null && _e !== void 0 ? _e : undefined, createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined, qboCreateTime: payload.qbo_create_time != null ? (0, zeniDayJS_1.date)(payload.qbo_create_time) : undefined, nameOnCheck: (_f = payload.name_on_check) !== null && _f !== void 0 ? _f : undefined, firstName: (_h = (_g = payload.first_name) === null || _g === void 0 ? void 0 : _g.trim()) !== null && _h !== void 0 ? _h : undefined, middleName: (_k = (_j = payload.middle_name) === null || _j === void 0 ? void 0 : _j.trim()) !== null && _k !== void 0 ? _k : undefined, contacts: (_l = payload.contacts) !== null && _l !== void 0 ? _l : undefined, termId: (_m = payload.term_id) !== null && _m !== void 0 ? _m : undefined, note: (_o = payload.note) !== null && _o !== void 0 ? _o : undefined, syncToken: payload.sync_token, email: (_q = (_p = payload.email) === null || _p === void 0 ? void 0 : _p.trim()) !== null && _q !== void 0 ? _q : undefined, websiteUrl: (_r = payload.website_url) !== null && _r !== void 0 ? _r : undefined, parentCustomerId: (_s = payload.parent_customer_id) !== null && _s !== void 0 ? _s : undefined, qboParentCustomerId: (_t = payload.qbo_parent_customer_id) !== null && _t !== void 0 ? _t : undefined, isBillWithParent: Boolean(payload.is_bill_with_parent), updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : undefined, accountId: (_u = payload.account_id) !== null && _u !== void 0 ? _u : undefined, phone: (_v = payload.phone) !== null && _v !== void 0 ? _v : undefined, bankAccountIds: (_w = payload.bank_account_ids) !== null && _w !== void 0 ? _w : undefined, balance: (_x = payload.balance) !== null && _x !== void 0 ? _x : undefined, isDeleted: Boolean(payload.is_deleted), tenantId: payload.tenant_id, title: (_y = payload.title) !== null && _y !== void 0 ? _y : undefined, isSubCustomer: Boolean(payload.is_sub_customer), isTaxable: Boolean(payload.is_taxable), shippingAddressId: (_z = payload.shipping_address_id) !== null && _z !== void 0 ? _z : undefined, billingAddressId: (_0 = payload.billing_address_id) !== null && _0 !== void 0 ? _0 : undefined, currencySymbol: (_1 = payload.currency_symbol) !== null && _1 !== void 0 ? _1 : undefined, qboUpdateTime: payload.qbo_update_time != null ? (0, zeniDayJS_1.date)(payload.qbo_update_time) : undefined, accountingClassId: (_2 = payload.accounting_class_id) !== null && _2 !== void 0 ? _2 : undefined, currencyCode: (_3 = payload.currency_code) !== null && _3 !== void 0 ? _3 : undefined }));
|
|
27
27
|
};
|
|
28
28
|
exports.toCustomer = toCustomer;
|
|
29
29
|
/**
|
|
@@ -404,8 +404,8 @@ function mapLoggedInUserPayloadToLoggedInUser(payload, zeniSessionId) {
|
|
|
404
404
|
return {
|
|
405
405
|
userId: payload.user_id,
|
|
406
406
|
zeniSessionId: zeniSessionId,
|
|
407
|
-
firstName: payload.first_name,
|
|
408
|
-
lastName: payload.last_name,
|
|
407
|
+
firstName: payload.first_name.trim(),
|
|
408
|
+
lastName: payload.last_name.trim(),
|
|
409
409
|
photo: (0, urlPayload_1.toURL)(payload.photo),
|
|
410
410
|
};
|
|
411
411
|
}
|
|
@@ -50,17 +50,17 @@ exports.default = user.reducer;
|
|
|
50
50
|
* Helper functions.
|
|
51
51
|
*/
|
|
52
52
|
function mapUserPayloadToUser(payload) {
|
|
53
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
54
54
|
return {
|
|
55
55
|
userId: payload.user_id,
|
|
56
56
|
email: payload.email,
|
|
57
|
-
firstName: (_a = payload.first_name) !== null &&
|
|
58
|
-
lastName: (
|
|
59
|
-
middleName: (
|
|
57
|
+
firstName: (_b = (_a = payload.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '',
|
|
58
|
+
lastName: (_d = (_c = payload.last_name) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '',
|
|
59
|
+
middleName: (_f = (_e = payload.middle_name) === null || _e === void 0 ? void 0 : _e.trim()) !== null && _f !== void 0 ? _f : '',
|
|
60
60
|
birthday: payload.birthday != null ? (0, zeniDayJS_1.date)(payload.birthday) : undefined,
|
|
61
|
-
countryCode: (
|
|
62
|
-
phone: (
|
|
63
|
-
ssn: (
|
|
61
|
+
countryCode: (_g = payload.country_code) !== null && _g !== void 0 ? _g : undefined,
|
|
62
|
+
phone: (_h = payload.phone) !== null && _h !== void 0 ? _h : undefined,
|
|
63
|
+
ssn: (_j = payload.ssn) !== null && _j !== void 0 ? _j : undefined,
|
|
64
64
|
photo: payload.photo != null ? (0, exports.toPhotoURL)(payload.photo) : undefined,
|
|
65
65
|
lastSeenTime: payload.last_seen_time != null ? (0, zeniDayJS_1.date)(payload.last_seen_time) : undefined,
|
|
66
66
|
createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
|
|
@@ -70,13 +70,13 @@ function mapUserPayloadToUser(payload) {
|
|
|
70
70
|
* it should be a calculated from createTime or updateTime.
|
|
71
71
|
* Lets do it when we enable support in platform.
|
|
72
72
|
*/
|
|
73
|
-
syncToken: (
|
|
74
|
-
roleAtCompany: (
|
|
75
|
-
gender: (
|
|
73
|
+
syncToken: (_k = payload.sync_token) !== null && _k !== void 0 ? _k : undefined,
|
|
74
|
+
roleAtCompany: (_l = payload.role_at_company) !== null && _l !== void 0 ? _l : undefined,
|
|
75
|
+
gender: (_m = payload.gender) !== null && _m !== void 0 ? _m : undefined,
|
|
76
76
|
isPotentialFraud: payload.is_potential_fraud,
|
|
77
77
|
isDeleted: payload.is_deleted,
|
|
78
|
-
addressId: (
|
|
79
|
-
companyId: (
|
|
78
|
+
addressId: (_o = payload.address_id) !== null && _o !== void 0 ? _o : undefined,
|
|
79
|
+
companyId: (_p = payload.company_id) !== null && _p !== void 0 ? _p : undefined,
|
|
80
80
|
isPhoneVerified: payload.is_phone_verified,
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -28,12 +28,12 @@ const toVendorBasePayload = (tranVendor, vendorUpdates) => {
|
|
|
28
28
|
};
|
|
29
29
|
exports.toVendorBasePayload = toVendorBasePayload;
|
|
30
30
|
const mapVendorPayloadToVendor = (payload) => {
|
|
31
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
32
|
-
return Object.assign(Object.assign({}, (0, exports.mapVendorBasePayloadToVendorBase)(payload)), { qboId: payload.qbo_id, title: (_a = payload.title) !== null && _a !== void 0 ? _a : '', suffix: (_b = payload.suffix) !== null && _b !== void 0 ? _b : '', firstName: (_c = payload.first_name) !== null &&
|
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
32
|
+
return Object.assign(Object.assign({}, (0, exports.mapVendorBasePayloadToVendorBase)(payload)), { qboId: payload.qbo_id, title: (_a = payload.title) !== null && _a !== void 0 ? _a : '', suffix: (_b = payload.suffix) !== null && _b !== void 0 ? _b : '', firstName: (_d = (_c = payload.first_name) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '', middleName: (_f = (_e = payload.middle_name) === null || _e === void 0 ? void 0 : _e.trim()) !== null && _f !== void 0 ? _f : '', lastName: (_h = (_g = payload.last_name) === null || _g === void 0 ? void 0 : _g.trim()) !== null && _h !== void 0 ? _h : '', vendorType: (_j = payload.vendor_type) !== null && _j !== void 0 ? _j : '', isDeleted: (_k = payload.is_deleted) !== null && _k !== void 0 ? _k : false, createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : (0, zeniDayJS_1.dateNow)(), updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : (0, zeniDayJS_1.dateNow)(), syncToken: (_l = payload.sync_token) !== null && _l !== void 0 ? _l : '', email: (_o = (_m = payload.email) === null || _m === void 0 ? void 0 : _m.trim()) !== null && _o !== void 0 ? _o : '', phone: (_p = payload.phone) !== null && _p !== void 0 ? _p : '', websiteUrl: (_q = payload.website_url) !== null && _q !== void 0 ? _q : '', currencyCode: payload.currency_code, currencySymbol: payload.currency_symbol, vendorCurrencyCode: (_r = payload.vendor_currency_code) !== null && _r !== void 0 ? _r : payload.currency_code, vendorCurrencySymbol: (_s = payload.vendor_currency_symbol) !== null && _s !== void 0 ? _s : payload.currency_symbol, countryCode: (_t = payload.country_code) !== null && _t !== void 0 ? _t : undefined, accountId: (_v = (_u = payload.account) === null || _u === void 0 ? void 0 : _u.account_id) !== null && _v !== void 0 ? _v : undefined, classId: (_x = (_w = payload.accounting_class) === null || _w === void 0 ? void 0 : _w.accounting_class_id) !== null && _x !== void 0 ? _x : undefined, contactIds: (_z = (_y = payload.contacts) === null || _y === void 0 ? void 0 : _y.map((contact) => contact.contact_id)) !== null && _z !== void 0 ? _z : [], billingAddressId: payload.billing_address != null
|
|
33
33
|
? payload.billing_address.address_id
|
|
34
34
|
: undefined, addressId: payload.address != null ? payload.address.address_id : undefined, shippingAddressId: payload.shipping_address != null
|
|
35
35
|
? payload.shipping_address.address_id
|
|
36
|
-
: undefined, bankAccountIds: (
|
|
36
|
+
: undefined, bankAccountIds: (_1 = (_0 = payload.bank_accounts) === null || _0 === void 0 ? void 0 : _0.map((bankAcc) => bankAcc.bank_account_id)) !== null && _1 !== void 0 ? _1 : [], paymentInstrumentIds: (_3 = (_2 = payload.payment_instruments) === null || _2 === void 0 ? void 0 : _2.map((piAcc) => piAcc.zeni_payment_instrument_id)) !== null && _3 !== void 0 ? _3 : [], ownerId: (_5 = (_4 = payload.owner) === null || _4 === void 0 ? void 0 : _4.user_id) !== null && _5 !== void 0 ? _5 : undefined, balance: (_6 = payload.balance) !== null && _6 !== void 0 ? _6 : 0, matchScore: ((_7 = payload.match_score) === null || _7 === void 0 ? void 0 : _7.value) != null ? payload.match_score.value : 0, isVendor1099: (_8 = payload.is_vendor_1099) !== null && _8 !== void 0 ? _8 : false, documentIds: (_9 = payload.document_ids) !== null && _9 !== void 0 ? _9 : [], last30DaysSpend: payload.last_30_days_spend, last90DaysSpend: payload.last_90_days_spend, yearToDateSpend: payload.year_to_date_spend, lastMonthSpend: payload.last_month_spend, last3MonthsSpend: payload.last_3_months_spend, last6MonthsSpend: payload.last_6_months_spend, last12MonthsSpend: payload.last_12_months_spend, previousYearSpend: payload.previous_year_spend, recommendations: payload.recommendation != null && payload.recommendation.length > 0
|
|
37
37
|
? (0, transactionPayload_1.transformRecommendation)(payload.recommendation[0]) // In this case, there will be only one recommendation item since this is entity recommendation payload.
|
|
38
38
|
: [], preferredInternationalTransferFeeBearerPaymentMethod: payload.preferred_international_transfer_fee_bearer_payment_method != null
|
|
39
39
|
? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)(payload.preferred_international_transfer_fee_bearer_payment_method)
|
|
@@ -42,9 +42,9 @@ const createCompanyOfficersEpic = (actions$, state$, zeniAPI) => actions$.pipe((
|
|
|
42
42
|
(0, userRoleReducer_1.updateUserRoles)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.user_roles) !== null && _f !== void 0 ? _f : []),
|
|
43
43
|
];
|
|
44
44
|
const officersData = officers.map((officer) => {
|
|
45
|
-
var _a, _b, _c;
|
|
45
|
+
var _a, _b, _c, _d, _e;
|
|
46
46
|
const user = users.find((user) => user.email === officer.email);
|
|
47
|
-
return Object.assign(Object.assign({}, officer), { firstName: (_a = user === null || user === void 0 ? void 0 : user.first_name) !== null &&
|
|
47
|
+
return Object.assign(Object.assign({}, officer), { firstName: (_b = (_a = user === null || user === void 0 ? void 0 : user.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : officer.firstName, lastName: (_d = (_c = user === null || user === void 0 ? void 0 : user.last_name) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : officer.lastName, phone: (_e = user === null || user === void 0 ? void 0 : user.phone) !== null && _e !== void 0 ? _e : '', userId: user === null || user === void 0 ? void 0 : user.user_id });
|
|
48
48
|
});
|
|
49
49
|
actions.push((0, companyViewReducer_1.companyPassportSaveDataInLocalStore)({
|
|
50
50
|
officers: officersData,
|
|
@@ -39,7 +39,7 @@ const updatePrimaryContactEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
|
|
|
39
39
|
: // User PUT call is on individual user so User will be updated across tenants wherever its present
|
|
40
40
|
zeniAPI.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/users/${userId}`, payload);
|
|
41
41
|
return userAPI.pipe((0, operators_1.mergeMap)((response) => {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
43
43
|
const users = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.users) !== null && _b !== void 0 ? _b : [];
|
|
44
44
|
if ((0, responsePayload_1.isSuccessResponse)(response) && users.length > 0) {
|
|
45
45
|
const actions = [(0, userReducer_1.updateAllUsers)({ users })];
|
|
@@ -48,7 +48,7 @@ const updatePrimaryContactEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
|
|
|
48
48
|
payload: (_d = (_c = response.data) === null || _c === void 0 ? void 0 : _c.companies) !== null && _d !== void 0 ? _d : [],
|
|
49
49
|
schema: {},
|
|
50
50
|
}), (0, userRoleReducer_1.updateUserRoles)((_f = (_e = response.data) === null || _e === void 0 ? void 0 : _e.user_roles) !== null && _f !== void 0 ? _f : []), (0, companyViewReducer_1.companyPassportSaveDataInLocalStore)({
|
|
51
|
-
primaryContact: Object.assign(Object.assign({}, action.payload.primaryContact), { firstName: (_g = users[0].first_name) !== null &&
|
|
51
|
+
primaryContact: Object.assign(Object.assign({}, action.payload.primaryContact), { firstName: (_h = (_g = users[0].first_name) === null || _g === void 0 ? void 0 : _g.trim()) !== null && _h !== void 0 ? _h : action.payload.primaryContact.firstName, lastName: (_k = (_j = users[0].last_name) === null || _j === void 0 ? void 0 : _j.trim()) !== null && _k !== void 0 ? _k : action.payload.primaryContact.lastName, userId: users[0].user_id }),
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
54
54
|
actions.push((0, companyViewReducer_1.companyPassportUpdatePrimaryContactSuccess)(companyId));
|
|
@@ -98,6 +98,7 @@ const sendOnboardingCustomerViewInviteEpic = (actions$, _state$, zeniAPI) => act
|
|
|
98
98
|
}));
|
|
99
99
|
exports.sendOnboardingCustomerViewInviteEpic = sendOnboardingCustomerViewInviteEpic;
|
|
100
100
|
const getUserNameForEmailSent = (onboardingInfo, users) => {
|
|
101
|
+
var _a, _b, _c, _d;
|
|
101
102
|
const customerUserId = (onboardingInfo === null || onboardingInfo === void 0 ? void 0 : onboardingInfo.onboarding_customer_user_ids) != null &&
|
|
102
103
|
onboardingInfo.onboarding_customer_user_ids.length > 0
|
|
103
104
|
? onboardingInfo.onboarding_customer_user_ids[0]
|
|
@@ -106,7 +107,14 @@ const getUserNameForEmailSent = (onboardingInfo, users) => {
|
|
|
106
107
|
if (customerUserId != null) {
|
|
107
108
|
const user = users.find((user) => user.user_id === customerUserId);
|
|
108
109
|
if (user != null) {
|
|
109
|
-
|
|
110
|
+
const firstName = (_b = (_a = user.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
111
|
+
const lastName = (_d = (_c = user.last_name) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '';
|
|
112
|
+
if (Boolean(firstName) && Boolean(lastName)) {
|
|
113
|
+
userName = `${firstName} ${lastName}`;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
userName = firstName || lastName || '';
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
}
|
|
112
120
|
return userName;
|
|
@@ -142,8 +142,8 @@ const sortPeopleBySortKey = (person, sortKey, userState, classState) => {
|
|
|
142
142
|
default:
|
|
143
143
|
return person.user != null
|
|
144
144
|
? person.user.firstName
|
|
145
|
-
? (_b = person.user) === null || _b === void 0 ? void 0 : _b.firstName.toLowerCase()
|
|
146
|
-
: (_c = person.user) === null || _c === void 0 ? void 0 : _c.email.toLowerCase()
|
|
145
|
+
? (_b = person.user) === null || _b === void 0 ? void 0 : _b.firstName.toLowerCase()
|
|
146
|
+
: (_c = person.user) === null || _c === void 0 ? void 0 : _c.email.toLowerCase()
|
|
147
147
|
: undefined;
|
|
148
148
|
}
|
|
149
149
|
};
|
|
@@ -68,6 +68,7 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
+
const sortOrderValue = (0, sortOrderPayload_1.getSortOrder)(sortOrder);
|
|
71
72
|
const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValues, (company) => {
|
|
72
73
|
var _a;
|
|
73
74
|
const warningCount = (0, exports.getAuditWarningsCount)(company);
|
|
@@ -113,7 +114,7 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
113
114
|
return isSecondarySortApplicable === true
|
|
114
115
|
? [primarySortValue, secondarySortValue]
|
|
115
116
|
: primarySortValue;
|
|
116
|
-
},
|
|
117
|
+
}, [sortOrderValue, sortOrderValue]);
|
|
117
118
|
return {
|
|
118
119
|
companies: [
|
|
119
120
|
...sortedCompaniesWithSortKeyValue,
|
|
@@ -40,14 +40,23 @@ const getChargeCardListView = (state, includeCreditAccountAndCashbackInfo) => {
|
|
|
40
40
|
const sortKey = chargeCardListState.uiState.sortKey;
|
|
41
41
|
const sortOrder = (0, sortOrderPayload_1.getSortOrder)(chargeCardListState.uiState.sortOrder);
|
|
42
42
|
const cardsInOrder = (0, orderBy_1.default)(cards, (card) => {
|
|
43
|
-
var _a, _b, _c, _d
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
44
|
switch (sortKey) {
|
|
45
|
-
case 'owner':
|
|
46
|
-
|
|
45
|
+
case 'owner': {
|
|
46
|
+
const firstName = (_a = card.cardHolderUser) === null || _a === void 0 ? void 0 : _a.firstName.toLowerCase();
|
|
47
|
+
const lastName = (_b = card.cardHolderUser) === null || _b === void 0 ? void 0 : _b.lastName.toLowerCase();
|
|
48
|
+
if (Boolean(firstName) && Boolean(lastName)) {
|
|
49
|
+
return `${firstName} ${lastName}`;
|
|
50
|
+
}
|
|
51
|
+
else if (Boolean(firstName) || Boolean(lastName)) {
|
|
52
|
+
return firstName !== null && firstName !== void 0 ? firstName : lastName;
|
|
53
|
+
}
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
47
56
|
case 'cardName':
|
|
48
57
|
return card.cardName.toLowerCase();
|
|
49
58
|
case 'department':
|
|
50
|
-
return (
|
|
59
|
+
return (_d = (_c = card.department) === null || _c === void 0 ? void 0 : _c.className.toLowerCase()) !== null && _d !== void 0 ? _d : '';
|
|
51
60
|
case 'utilisation':
|
|
52
61
|
return card.limit.amount - card.available.amount;
|
|
53
62
|
case 'limit':
|
|
@@ -33,7 +33,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
33
33
|
keepExistingListItems: true,
|
|
34
34
|
}), (0, chargeCardListReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
|
|
35
35
|
const names = response.data.users
|
|
36
|
-
.map((user) => { var _a; return (_a = user.first_name) !== null &&
|
|
36
|
+
.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
37
|
.join(', ');
|
|
38
38
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
39
39
|
messageSection: 'issue_charge_card',
|
|
@@ -10,10 +10,11 @@ const globalMerchantPayload_1 = require("../../../../entity/globalMerchant/globa
|
|
|
10
10
|
* Helpers
|
|
11
11
|
*/
|
|
12
12
|
const toUserPayload = (user) => {
|
|
13
|
+
var _a, _b;
|
|
13
14
|
return {
|
|
14
15
|
user_id: user.user_id,
|
|
15
|
-
first_name: user.first_name,
|
|
16
|
-
last_name: user.last_name,
|
|
16
|
+
first_name: (_a = user.first_name) === null || _a === void 0 ? void 0 : _a.trim(),
|
|
17
|
+
last_name: (_b = user.last_name) === null || _b === void 0 ? void 0 : _b.trim(),
|
|
17
18
|
email: '',
|
|
18
19
|
};
|
|
19
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.39",
|
|
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",
|