@zeniai/client-epic-state 4.19.8-betaRR1 → 4.19.8-betaRR2
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/chargeCardRepayment/chargeCardRepaymentPayload.d.ts +2 -0
- package/lib/index.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +3 -0
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.d.ts +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +5 -2
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentHistoryEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentHistoryEpic.js +6 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserPayload } from '../user/userPayload';
|
|
1
2
|
import { ChargeCardRepayment } from './chargeCardRepayment';
|
|
2
3
|
export interface ChargeCardRepaymentPayload {
|
|
3
4
|
amount: number;
|
|
@@ -22,6 +23,7 @@ export interface ChargeCardRepaymentPayload {
|
|
|
22
23
|
zeni_credit_account_id: string;
|
|
23
24
|
is_auto_pay_enabled?: boolean;
|
|
24
25
|
is_deleted?: boolean;
|
|
26
|
+
paid_by_user?: UserPayload | null;
|
|
25
27
|
provider_counterparty_account_id?: string | null;
|
|
26
28
|
provider_counterparty_id?: string;
|
|
27
29
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ import { RecurringBillConfig, RecurringBillDetail, RecurringBillFrequency, Recur
|
|
|
58
58
|
import { CardPayment } from './entity/cardPayment/cardPaymentState';
|
|
59
59
|
import { CardActivationOrPinUpdateEventCodeType, CardAddressType, CardCodeType, CardStatusCodeType, ChargeCard, ChargeCardRecommendation, ChargeCardType, CreditCardCodeType, CreditLimitFrequency, CreditLimitFrequencyCodeType, DebitCardCodeType, ShippingAddressType, toCardAddressType, toCardType, toCreditLimitFrequencyCodeType, toShippingAddressType } from './entity/chargeCard/chargeCard';
|
|
60
60
|
import { getChargeCardById } from './entity/chargeCard/chargeCardSelector';
|
|
61
|
+
import { ChargeCardRepayment, ChargeCardRepaymentStatusCodeType } from './entity/chargeCardRepayment/chargeCardRepayment';
|
|
61
62
|
import { ChargeCardTransaction, ChargeCardTransactionStatus, ChargeCardTransactionStatusCode, ChargeCardTransactionTypeCode } from './entity/chargeCardTransaction/chargeCardTransaction';
|
|
62
63
|
import { TransactionReceiptsPayload } from './entity/chargeCardTransaction/chargeCardTransactionPayload';
|
|
63
64
|
import { updateChargeCardTransactionAttachments } from './entity/chargeCardTransaction/chargeCardTransactionReducer';
|
|
@@ -812,7 +813,7 @@ export { CompanyHealthMetricsLocalData, CompanyHealthViewUIState };
|
|
|
812
813
|
export { getCompanyHealthMetricConfig, fetchCompanyHealthMetricConfig, CompanyHealthMetricConfigSelector, };
|
|
813
814
|
export { CompanyHealthMetric, CompanyRunway, updateCompaniesHealth, updateCompanyHealth, VerticalProductServices, LastEngagement, AdditionalChurnFactors, AdditionalChurnFactor, };
|
|
814
815
|
export { clearCompanyHealthMetricView, fetchCompanyHealthMetricView, initializeCompanyHealthMetricViewLocalData, removeSelectedCompanyId, saveCompanyHealthMetricById, updateCompanyHealthMetricLocalStore, updateCompanyHealthMetricViewErrorStatus, updateCompanyHealthMetricViewSuccessStatus, updateCompanyHealthViewUIState, };
|
|
815
|
-
export { CardStatusCodeType, updateChargeCardTransactionAttachments, TransactionReceiptsPayload, ProductServices, ProductServiceKey, isCompanyRunwayInfinite, getCompanyHealthMetricView, hasCompanyHealthMetricFormFieldChanged, companyHealthMetricDropDownOptions, CompanyHealthMetricViewSelector, CompanyHealthMetricDropDownOption, CompanyDetailWithHealthMetric, ChargeCardBusinessVerificationDetails, getChargeCardBusinessVerificationDetails, fetchDebitCardSummary, fetchChargeCardList, fetchChargeCardListPage, fetchChargeCardConfig, fetchCreditAccount, fetchCreditAccountRepayment, getChargeCardListView, getMyPendingActivationChargeCardListView, getMyRequestOnHoldChargeCardListWithShippingAddress, clearChargeCardRepaymentDetail, fetchChargeCardRepaymentDetail, initiateChargeCardRepayment, updateChargeCardRepaymentLocalStore, ChargeCardRepaymentDetailSelectorView, getChargeCardRepaymentDetail, ChargeCardRepaymentDetailLocalData, fetchChargeCardPaymentHistory, updatePaymentHistoryFilters, ChargeCardPaymentHistorySelectorView, getChargeCardPaymentHistoryView, PAYMENT_HISTORY_FILTER_CATEGORIES, PaymentHistoryFilterCategory, PaymentHistoryFilterCategoryDropdownOption, PaymentHistoryFilterCategoryField, PaymentHistoryFilters, getCreditAccountDetails, ChargeCardStatementsSelectorView, fetchChargeCardDetailPage, fetchChargeCardDetail, fetchChargeCardTransactionStatistics, fetchDepositAccountLimit, getChargeCardDetailView, getChargeCardControlDetailView, getDepositAccountLimitFetchStateByDepositAccountId, ChargeCardControlDetailView, ChargeCardTransactionAttachmentView, getChargeCardTransactionAttachmentView, DebitCardPinSetSelectorView, getDebitCardSetPinView, getChargeCardRecurringExpensesByCardIds, getChargeCardRecurringExpensesView, getChargeCardRowActionView, getChargeCardBulkActionView, ChargeCardCVVActivateSelectorView, getChargeCardCVVActivateView, fetchChargeCardTransactionList, fetchCashbackDetail, ChargeCard, ChargeCardWithUser, ChargeCardWithUserAndShippingAddress, ChargeCardViewSortKey, ChargeCardRecommendation, toChargeCardSortKeyType, CashbackPeriod, CashbackDetailUIState, CashbackViewSortKey, getCashbackDetail, getZeniDateFromPeriod, CashbackDetailSelectorView, toCreditLimitFrequencyCodeType, ChargeCardListSelectorView, ChargeCardListWithShippingAddressSelectorView, MyPendingActivationChargeCardListSelectorView, ChargeCardRecurringExpensesByCardIds, ChargeCardRecurringExpenses, ChargeCardBulkActionView, ChargeCardRowActionView, DebitCardListSelectorView, getDepositAccountListWithDebitCardIssued, DebitCardSummaries, DepositAccountListWithDebitCardIssued, ChargeCardDetailSelectorView, IssueChargeCardSelectorView, ActiveChargeCardCount, ActiveDebitCardCount, ActiveDebitCardCountByUserId, IssueChargeCardState, getIssueChargeCardView, ChargeCardConfigState, ChargeCardListUIState, CreditAccount, CreditAccountRepayment, ChargeCardTransaction, ChargeCardTransactionStatusCode, ChargeCardTransactionTypeCode, ChargeCardTransactionStatus, ChargeCardDetailUiState, ChargeCardTransactionSortKey, RecurringExpense, TransactionStatistics, getChargeCardSetupViewDetails, ChargeCardSetupView, fetchChargeCardStatementList, ChargeCardStatement, getChargeCardStatements, fetchChargeCardSetupView, enableChargeCardAutoPay, acceptChargeCardTerms, expressInterestInChargeCard, IssueChargeCardLocalData, PhysicalCreditCardData, PhysicalDebitCardData, VirtualDebitCardData, DepositAccountWithLimit, getDepositAccountLimitForChargeCardByDepositAccountId, VirtualCreditCardData, CreditLimitFrequencyCodeType, CardAddressType, toCardAddressType, ShippingAddressType, toShippingAddressType, ConnectedAccount, ChargeCardType, CreditCardCodeType, DebitCardCodeType, CardActivationOrPinUpdateEventCodeType, CreditLimitFrequency, CardCodeType, toCardType, issueChargeCards, fetchIssueCardPage, fetchDepositAccountListForCards, getDebitCardList, getDebitCardSummary, updateCustomAddressId, updateChargeCardsLocalStore, resetIssueChargeCardForm, updateBulkActionCardIds, updateChargeCardListSearchText, updateChargeCardListUIState, updateCashbackDetailUIState, updateChargeCardDetail, updatePhysicalChargeCardAttempt, lockChargeCard, unlockChargeCard, closeChargeCard, updateChargeCardName, CardUserOnboardingLocalData, getCardUserOnboardingView, initializeCardUserOnboardingLocalData, updateCardUserOnboardingLocalData, CardUserOnboardingView, saveCardOnboardingUserDetails, updateChargeCardTransactionUploadReceiptsFetchStatus, completeDebitCardSetPinWait, startDebitCardSetPinWait, updateDebitCardPinAttempt, updateChargeCardTransactionReceiptsShowTickFetchStatus, updateChargeCardTransactionIsViewReceiptClicked, fetchChargeCardTransactionAttachments, completeCVVActivationWait, startCVVActivationWait, updateChargeCardSpendLimit, updateChargeCardSpendLimitSuccessOrFailure, resendCardInvite, revokeCardInvite, updateRowActionCardId, revokeChargeCardsInvite, lockChargeCards, unlockChargeCards, closeChargeCards, updateChargeCardsSpendLimit, fetchChargeCardsRecurringExpenses, startCardUserOnboardingActivationWait, completeCardUserOnboardingActivationWait, setFirstViewAfterActivation, setFirstViewCompleteAfterActivation, setCurrentDisplayedCardId, getChargeCardById, anyCardOnHold, };
|
|
816
|
+
export { CardStatusCodeType, updateChargeCardTransactionAttachments, TransactionReceiptsPayload, ProductServices, ProductServiceKey, isCompanyRunwayInfinite, getCompanyHealthMetricView, hasCompanyHealthMetricFormFieldChanged, companyHealthMetricDropDownOptions, CompanyHealthMetricViewSelector, CompanyHealthMetricDropDownOption, CompanyDetailWithHealthMetric, ChargeCardBusinessVerificationDetails, getChargeCardBusinessVerificationDetails, fetchDebitCardSummary, fetchChargeCardList, fetchChargeCardListPage, fetchChargeCardConfig, fetchCreditAccount, fetchCreditAccountRepayment, getChargeCardListView, getMyPendingActivationChargeCardListView, getMyRequestOnHoldChargeCardListWithShippingAddress, clearChargeCardRepaymentDetail, fetchChargeCardRepaymentDetail, initiateChargeCardRepayment, updateChargeCardRepaymentLocalStore, ChargeCardRepaymentDetailSelectorView, getChargeCardRepaymentDetail, ChargeCardRepaymentDetailLocalData, ChargeCardRepayment, ChargeCardRepaymentStatusCodeType, fetchChargeCardPaymentHistory, updatePaymentHistoryFilters, ChargeCardPaymentHistorySelectorView, getChargeCardPaymentHistoryView, PAYMENT_HISTORY_FILTER_CATEGORIES, PaymentHistoryFilterCategory, PaymentHistoryFilterCategoryDropdownOption, PaymentHistoryFilterCategoryField, PaymentHistoryFilters, getCreditAccountDetails, ChargeCardStatementsSelectorView, fetchChargeCardDetailPage, fetchChargeCardDetail, fetchChargeCardTransactionStatistics, fetchDepositAccountLimit, getChargeCardDetailView, getChargeCardControlDetailView, getDepositAccountLimitFetchStateByDepositAccountId, ChargeCardControlDetailView, ChargeCardTransactionAttachmentView, getChargeCardTransactionAttachmentView, DebitCardPinSetSelectorView, getDebitCardSetPinView, getChargeCardRecurringExpensesByCardIds, getChargeCardRecurringExpensesView, getChargeCardRowActionView, getChargeCardBulkActionView, ChargeCardCVVActivateSelectorView, getChargeCardCVVActivateView, fetchChargeCardTransactionList, fetchCashbackDetail, ChargeCard, ChargeCardWithUser, ChargeCardWithUserAndShippingAddress, ChargeCardViewSortKey, ChargeCardRecommendation, toChargeCardSortKeyType, CashbackPeriod, CashbackDetailUIState, CashbackViewSortKey, getCashbackDetail, getZeniDateFromPeriod, CashbackDetailSelectorView, toCreditLimitFrequencyCodeType, ChargeCardListSelectorView, ChargeCardListWithShippingAddressSelectorView, MyPendingActivationChargeCardListSelectorView, ChargeCardRecurringExpensesByCardIds, ChargeCardRecurringExpenses, ChargeCardBulkActionView, ChargeCardRowActionView, DebitCardListSelectorView, getDepositAccountListWithDebitCardIssued, DebitCardSummaries, DepositAccountListWithDebitCardIssued, ChargeCardDetailSelectorView, IssueChargeCardSelectorView, ActiveChargeCardCount, ActiveDebitCardCount, ActiveDebitCardCountByUserId, IssueChargeCardState, getIssueChargeCardView, ChargeCardConfigState, ChargeCardListUIState, CreditAccount, CreditAccountRepayment, ChargeCardTransaction, ChargeCardTransactionStatusCode, ChargeCardTransactionTypeCode, ChargeCardTransactionStatus, ChargeCardDetailUiState, ChargeCardTransactionSortKey, RecurringExpense, TransactionStatistics, getChargeCardSetupViewDetails, ChargeCardSetupView, fetchChargeCardStatementList, ChargeCardStatement, getChargeCardStatements, fetchChargeCardSetupView, enableChargeCardAutoPay, acceptChargeCardTerms, expressInterestInChargeCard, IssueChargeCardLocalData, PhysicalCreditCardData, PhysicalDebitCardData, VirtualDebitCardData, DepositAccountWithLimit, getDepositAccountLimitForChargeCardByDepositAccountId, VirtualCreditCardData, CreditLimitFrequencyCodeType, CardAddressType, toCardAddressType, ShippingAddressType, toShippingAddressType, ConnectedAccount, ChargeCardType, CreditCardCodeType, DebitCardCodeType, CardActivationOrPinUpdateEventCodeType, CreditLimitFrequency, CardCodeType, toCardType, issueChargeCards, fetchIssueCardPage, fetchDepositAccountListForCards, getDebitCardList, getDebitCardSummary, updateCustomAddressId, updateChargeCardsLocalStore, resetIssueChargeCardForm, updateBulkActionCardIds, updateChargeCardListSearchText, updateChargeCardListUIState, updateCashbackDetailUIState, updateChargeCardDetail, updatePhysicalChargeCardAttempt, lockChargeCard, unlockChargeCard, closeChargeCard, updateChargeCardName, CardUserOnboardingLocalData, getCardUserOnboardingView, initializeCardUserOnboardingLocalData, updateCardUserOnboardingLocalData, CardUserOnboardingView, saveCardOnboardingUserDetails, updateChargeCardTransactionUploadReceiptsFetchStatus, completeDebitCardSetPinWait, startDebitCardSetPinWait, updateDebitCardPinAttempt, updateChargeCardTransactionReceiptsShowTickFetchStatus, updateChargeCardTransactionIsViewReceiptClicked, fetchChargeCardTransactionAttachments, completeCVVActivationWait, startCVVActivationWait, updateChargeCardSpendLimit, updateChargeCardSpendLimitSuccessOrFailure, resendCardInvite, revokeCardInvite, updateRowActionCardId, revokeChargeCardsInvite, lockChargeCards, unlockChargeCards, closeChargeCards, updateChargeCardsSpendLimit, fetchChargeCardsRecurringExpenses, startCardUserOnboardingActivationWait, completeCardUserOnboardingActivationWait, setFirstViewAfterActivation, setFirstViewCompleteAfterActivation, setCurrentDisplayedCardId, getChargeCardById, anyCardOnHold, };
|
|
816
817
|
export { TIME_SERIES_DURATIONS, PerformanceReportKey, TimeSeriesDuration, convertToTimeSeriesSelectionRange, toTimeSeriesDuration, TimeSeriesRange, fetchAggregatedReport, aggregatedReportView, AggregatedReportType, AggregatedReportPersona, EventGroupType, MonthlySummaryType, PerformanceReportSummary, };
|
|
817
818
|
export { fetchApAging, getApAgingReport, updateApAgingUIState, AgingReportId, ApAgingReport, AgingBalance, AgingPeriod, AgingReportSortKey, AgingBalancesByVendor, AgingReportUIState, AgingDetailReportUIState, AgingDetailReportInvoice, AgingDateSelectionType, };
|
|
818
819
|
export { fetchApAgingDetail, AgingReportInvoice, ApAgingDetail, getApAgingDetailForVendor, updateApAgingDetailUIState, };
|
package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface ChargeCardPaymentHistoryState extends FetchedState {
|
|
|
13
13
|
filters: PaymentHistoryFilters;
|
|
14
14
|
isAutoPayEnabled: boolean;
|
|
15
15
|
repaymentHistoryIds: ID[];
|
|
16
|
+
repaymentHistoryUserIds: ID[];
|
|
16
17
|
searchText: string;
|
|
17
18
|
totalRepayments: number;
|
|
18
19
|
uiState: PaymentHistoryUIState;
|
|
@@ -20,6 +20,9 @@ const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
|
|
|
20
20
|
draft.currencySymbol = payload.currency_symbol;
|
|
21
21
|
draft.isAutoPayEnabled = payload.is_auto_pay_enabled;
|
|
22
22
|
draft.repaymentHistoryIds = payload.repayment_history.map((repayment) => repayment.card_repayment_id);
|
|
23
|
+
draft.repaymentHistoryUserIds = payload.repayment_history
|
|
24
|
+
.map((repayment) => { var _a; return (_a = repayment.paid_by_user) === null || _a === void 0 ? void 0 : _a.user_id; })
|
|
25
|
+
.filter((userId) => userId != null);
|
|
23
26
|
draft.totalRepayments = payload.total_repayments;
|
|
24
27
|
draft.fetchState = 'Completed';
|
|
25
28
|
draft.error = undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ID } from '../../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { ChargeCardRepayment } from '../../../../entity/chargeCardRepayment/chargeCardRepayment';
|
|
4
|
+
import { User } from '../../../../entity/user/userState';
|
|
4
5
|
import { RootState } from '../../../../reducer';
|
|
5
6
|
import { PaymentHistoryFilters, PaymentHistoryUIState } from './chargeCardPaymentHistory';
|
|
6
7
|
export interface ChargeCardPaymentHistorySelectorView extends SelectorView {
|
|
@@ -11,6 +12,7 @@ export interface ChargeCardPaymentHistorySelectorView extends SelectorView {
|
|
|
11
12
|
isAutoPayEnabled: boolean;
|
|
12
13
|
repaymentHistory: ChargeCardRepayment[];
|
|
13
14
|
repaymentHistoryIds: ID[];
|
|
15
|
+
repaymentHistoryUsers: User[];
|
|
14
16
|
searchText: string;
|
|
15
17
|
totalRepayments: number;
|
|
16
18
|
uiState: PaymentHistoryUIState;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getChargeCardPaymentHistoryView = void 0;
|
|
7
7
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
8
|
const chargeCardRepaymentSelector_1 = require("../../../../entity/chargeCardRepayment/chargeCardRepaymentSelector");
|
|
9
|
+
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
9
10
|
const spendManagementFilterHelpers_1 = require("../../spendManagementFilterHelpers");
|
|
10
11
|
const getPaymentHistorySortValue = (repayment, sortKey, accountInfoMap) => {
|
|
11
12
|
var _a;
|
|
@@ -31,8 +32,8 @@ const sortPaymentHistory = (repayments, sortKey, sortOrder, accountInfoMap) => {
|
|
|
31
32
|
return (0, orderBy_1.default)(repayments, (repayment) => getPaymentHistorySortValue(repayment, sortKey, accountInfoMap), [order]);
|
|
32
33
|
};
|
|
33
34
|
const getChargeCardPaymentHistoryView = (state, accountInfoMap) => {
|
|
34
|
-
const { chargeCardPaymentHistoryState, chargeCardRepaymentState } = state;
|
|
35
|
-
const { creditAccountId, currencyCode, currencySymbol, filters, isAutoPayEnabled, repaymentHistoryIds, searchText, totalRepayments, uiState, fetchState, error, } = chargeCardPaymentHistoryState;
|
|
35
|
+
const { chargeCardPaymentHistoryState, chargeCardRepaymentState, userState } = state;
|
|
36
|
+
const { creditAccountId, currencyCode, currencySymbol, filters, isAutoPayEnabled, repaymentHistoryIds, repaymentHistoryUserIds, searchText, totalRepayments, uiState, fetchState, error, } = chargeCardPaymentHistoryState;
|
|
36
37
|
// Get the full repayment details from the entity state
|
|
37
38
|
let repaymentHistory = (0, chargeCardRepaymentSelector_1.getChargeCardRepaymentByIds)(chargeCardRepaymentState, repaymentHistoryIds);
|
|
38
39
|
// Apply filters
|
|
@@ -55,6 +56,7 @@ const getChargeCardPaymentHistoryView = (state, accountInfoMap) => {
|
|
|
55
56
|
}
|
|
56
57
|
// Apply sorting
|
|
57
58
|
repaymentHistory = sortPaymentHistory(repaymentHistory, uiState.sortKey, uiState.sortOrder, accountInfoMap);
|
|
59
|
+
const repaymentHistoryUsers = (0, userSelector_1.getUsersByUserIds)(userState, repaymentHistoryUserIds);
|
|
58
60
|
return {
|
|
59
61
|
creditAccountId,
|
|
60
62
|
currencyCode,
|
|
@@ -63,6 +65,7 @@ const getChargeCardPaymentHistoryView = (state, accountInfoMap) => {
|
|
|
63
65
|
isAutoPayEnabled,
|
|
64
66
|
repaymentHistory,
|
|
65
67
|
repaymentHistoryIds,
|
|
68
|
+
repaymentHistoryUsers,
|
|
66
69
|
searchText,
|
|
67
70
|
totalRepayments,
|
|
68
71
|
uiState,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateChargeCardRepayments } from '../../../../entity/chargeCardRepayment/chargeCardRepaymentReducer';
|
|
4
|
+
import { updateAllUsers } from '../../../../entity/user/userReducer';
|
|
4
5
|
import { RootState } from '../../../../reducer';
|
|
5
6
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
7
|
import { fetchChargeCardPaymentHistory, updateChargeCardPaymentHistory, updateChargeCardPaymentHistoryFailure } from './chargeCardPaymentHistoryReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchChargeCardPaymentHistory> | ReturnType<typeof updateChargeCardPaymentHistory> | ReturnType<typeof updateChargeCardPaymentHistoryFailure> | ReturnType<typeof updateChargeCardRepayments>;
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchChargeCardPaymentHistory> | ReturnType<typeof updateChargeCardPaymentHistory> | ReturnType<typeof updateChargeCardPaymentHistoryFailure> | ReturnType<typeof updateChargeCardRepayments> | ReturnType<typeof updateAllUsers>;
|
|
8
9
|
export declare const fetchChargeCardPaymentHistoryEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,6 +4,7 @@ exports.fetchChargeCardPaymentHistoryEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const chargeCardRepaymentReducer_1 = require("../../../../entity/chargeCardRepayment/chargeCardRepaymentReducer");
|
|
7
|
+
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
7
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
9
|
const chargeCardPaymentHistoryReducer_1 = require("./chargeCardPaymentHistoryReducer");
|
|
9
10
|
const fetchChargeCardPaymentHistoryEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardPaymentHistoryReducer_1.fetchChargeCardPaymentHistory.match), (0, operators_1.switchMap)(() => {
|
|
@@ -11,7 +12,11 @@ const fetchChargeCardPaymentHistoryEpic = (actions$, _state$, zeniAPI) => action
|
|
|
11
12
|
.getJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/repayments?query={"include_history": true}`)
|
|
12
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
14
|
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
14
|
-
return (0, rxjs_1.of)((0, chargeCardPaymentHistoryReducer_1.updateChargeCardPaymentHistory)(response.data), (0,
|
|
15
|
+
return (0, rxjs_1.of)((0, chargeCardPaymentHistoryReducer_1.updateChargeCardPaymentHistory)(response.data), (0, userReducer_1.updateAllUsers)({
|
|
16
|
+
users: response.data.repayment_history
|
|
17
|
+
.map((repayment) => repayment.paid_by_user)
|
|
18
|
+
.filter((user) => user != null),
|
|
19
|
+
}), (0, chargeCardRepaymentReducer_1.updateChargeCardRepayments)(response.data.repayment_history));
|
|
15
20
|
}
|
|
16
21
|
else {
|
|
17
22
|
return (0, rxjs_1.of)((0, chargeCardPaymentHistoryReducer_1.updateChargeCardPaymentHistoryFailure)(response.status));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.8-
|
|
3
|
+
"version": "4.19.8-betaRR2",
|
|
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",
|