@zeniai/client-epic-state 4.12.72 → 4.12.74
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/chargeCardSelector.d.ts +1 -0
- package/lib/entity/chargeCard/chargeCardSelector.js +5 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/epics/initializeCardUserOnboardingLocalDataEpic.js +5 -1
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +4 -2
- package/lib/view/spendManagement/helpers.js +1 -0
- package/package.json +1 -1
|
@@ -2,3 +2,4 @@ import { ID } from '../../commonStateTypes/common';
|
|
|
2
2
|
import { ChargeCardState, ChargeCard } from './chargeCard';
|
|
3
3
|
export declare function getChargeCardsByIds(chargeCardState: ChargeCardState, chargeCardIds: ID[]): ChargeCard[];
|
|
4
4
|
export declare function getChargeCardById(chargeCardState: ChargeCardState, chargeCardId: ID): ChargeCard | undefined;
|
|
5
|
+
export declare function getChargeCardsByHolderUserId(chargeCardState: ChargeCardState, userId: ID): ChargeCard[];
|
|
@@ -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.getChargeCardById = exports.getChargeCardsByIds = void 0;
|
|
6
|
+
exports.getChargeCardsByHolderUserId = exports.getChargeCardById = exports.getChargeCardsByIds = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
function getChargeCardsByIds(chargeCardState, chargeCardIds) {
|
|
9
9
|
const chargeCards = chargeCardIds
|
|
@@ -16,3 +16,7 @@ function getChargeCardById(chargeCardState, chargeCardId) {
|
|
|
16
16
|
return (0, get_1.default)(chargeCardState.chargeCardByID, chargeCardId, undefined);
|
|
17
17
|
}
|
|
18
18
|
exports.getChargeCardById = getChargeCardById;
|
|
19
|
+
function getChargeCardsByHolderUserId(chargeCardState, userId) {
|
|
20
|
+
return Object.values(chargeCardState.chargeCardByID).filter((chargeCard) => chargeCard.cardHolderUserId === userId);
|
|
21
|
+
}
|
|
22
|
+
exports.getChargeCardsByHolderUserId = getChargeCardsByHolderUserId;
|
|
@@ -8,6 +8,7 @@ const addressViewReducer_1 = require("../../../../addressView/addressViewReducer
|
|
|
8
8
|
const cardUserOnboardingReducer_1 = require("../cardUserOnboardingReducer");
|
|
9
9
|
const userRoleSelector_1 = require("../../../../../entity/userRole/userRoleSelector");
|
|
10
10
|
const userSelector_1 = require("../../../../../entity/user/userSelector");
|
|
11
|
+
const chargeCardSelector_1 = require("../../../../../entity/chargeCard/chargeCardSelector");
|
|
11
12
|
const initializeCardUserOnboardingLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(cardUserOnboardingReducer_1.initializeCardUserOnboardingLocalData.match), (0, operators_1.mergeMap)((action) => {
|
|
12
13
|
const { userId } = action.payload;
|
|
13
14
|
const actions = [
|
|
@@ -17,9 +18,12 @@ const initializeCardUserOnboardingLocalDataEpic = (actions$, state$) => actions$
|
|
|
17
18
|
const userRoleState = state$.value.userRoleState;
|
|
18
19
|
const user = (0, userSelector_1.getUserByUserId)(userState, userId);
|
|
19
20
|
const userRole = (0, userRoleSelector_1.getUserRoleByUserId)(userRoleState, userId);
|
|
21
|
+
const userCards = (0, chargeCardSelector_1.getChargeCardsByHolderUserId)(state$.value.chargeCardState, userId);
|
|
20
22
|
const userAddress = (userRole === null || userRole === void 0 ? void 0 : userRole.addressId) != null
|
|
21
23
|
? (0, addressSelector_1.getAddressByAddressId)(state$.value.addressState, userRole.addressId)
|
|
22
|
-
:
|
|
24
|
+
: userCards.length > 0
|
|
25
|
+
? (0, addressSelector_1.getAddressByAddressId)(state$.value.addressState, userCards[0].billingAddressId)
|
|
26
|
+
: undefined;
|
|
23
27
|
if (userAddress != null) {
|
|
24
28
|
actions.push((0, addressViewReducer_1.newAddressInLocalStore)({
|
|
25
29
|
addressType: 'user_address',
|
|
@@ -189,12 +189,14 @@ const getAllFundingAccounts = (depositAccounts, paymentAccounts, paymentAccountB
|
|
|
189
189
|
...depositAccounts.map((depositAcc) => (0, exports.mapDepositAccToFundingAccount)(depositAcc)),
|
|
190
190
|
...(includeOnlyVerifiedAccounts
|
|
191
191
|
? paymentAccounts.filter((paymentAccount) => {
|
|
192
|
-
var _a, _b, _c;
|
|
192
|
+
var _a, _b, _c, _d;
|
|
193
193
|
return ((_a = paymentAccount.providerVerificationStatus) === null || _a === void 0 ? void 0 : _a.code) === 'verified' ||
|
|
194
194
|
((_b = paymentAccount.providerVerificationStatus) === null || _b === void 0 ? void 0 : _b.code) ===
|
|
195
195
|
'manually_verified' ||
|
|
196
196
|
((_c = paymentAccount.providerVerificationStatus) === null || _c === void 0 ? void 0 : _c.code) ===
|
|
197
|
-
'automatically_verified'
|
|
197
|
+
'automatically_verified' ||
|
|
198
|
+
((_d = paymentAccount.providerVerificationStatus) === null || _d === void 0 ? void 0 : _d.code) ===
|
|
199
|
+
'database_matched';
|
|
198
200
|
})
|
|
199
201
|
: paymentAccounts).map((paymentAcc) => (0, exports.mapPaymentAccToFundingAccount)(paymentAcc, paymentAccountBalanceFetchStatus)),
|
|
200
202
|
];
|
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.74",
|
|
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",
|