@zeniai/client-epic-state 4.19.24-betaRR10 → 4.19.24-betaRR12

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.
@@ -22,6 +22,7 @@ export interface ChargeCardRepayment {
22
22
  updateTime: ZeniDate;
23
23
  zeniCreditAccountId: ID;
24
24
  isAutoPayEnabled?: boolean;
25
+ paymentAccountId?: string | null;
25
26
  paymentAccountName?: string;
26
27
  providerCounterpartyAccountId?: ID;
27
28
  providerCounterpartyId?: ID;
@@ -25,6 +25,7 @@ export interface ChargeCardRepaymentPayload {
25
25
  is_auto_pay_enabled?: boolean;
26
26
  is_deleted?: boolean;
27
27
  paid_by_user?: UserPayload | null;
28
+ payment_account_id?: string | null;
28
29
  payment_account_name?: string | null;
29
30
  provider_counterparty_account_id?: string | null;
30
31
  provider_counterparty_id?: string;
@@ -5,7 +5,7 @@ const amount_1 = require("../../commonStateTypes/amount");
5
5
  const zeniDayJS_1 = require("../../zeniDayJS");
6
6
  const chargeCardRepayment_1 = require("./chargeCardRepayment");
7
7
  const mapChargeCardRepaymentPayloadToChargeCardRepayment = (payload) => {
8
- var _a, _b, _c, _d, _e;
8
+ var _a, _b, _c, _d, _e, _f;
9
9
  return ({
10
10
  amount: (0, amount_1.toAmount)(payload.amount, payload.currency_code, payload.currency_symbol),
11
11
  cardRepaymentId: payload.card_repayment_id,
@@ -17,7 +17,8 @@ const mapChargeCardRepaymentPayloadToChargeCardRepayment = (payload) => {
17
17
  paidById: payload.paid_by_user_id,
18
18
  paymentMethod: payload.payment_method,
19
19
  paymentAccountName: (_b = payload.payment_account_name) !== null && _b !== void 0 ? _b : undefined,
20
- providerCounterpartyId: (_c = payload.provider_counterparty_id) !== null && _c !== void 0 ? _c : undefined,
20
+ paymentAccountId: (_c = payload.payment_account_id) !== null && _c !== void 0 ? _c : undefined,
21
+ providerCounterpartyId: (_d = payload.provider_counterparty_id) !== null && _d !== void 0 ? _d : undefined,
21
22
  providerCreditAccountId: payload.provider_credit_account_id,
22
23
  providerDepositAccountId: payload.provider_deposit_account_id,
23
24
  providerId: payload.provider_id,
@@ -29,8 +30,8 @@ const mapChargeCardRepaymentPayloadToChargeCardRepayment = (payload) => {
29
30
  updateTime: (0, zeniDayJS_1.date)(payload.update_time),
30
31
  zeniCreditAccountId: payload.zeni_credit_account_id,
31
32
  repaymentType: (0, chargeCardRepayment_1.toChargeCardRepaymentType)(payload.repayment_type),
32
- providerCounterpartyAccountId: (_d = payload.provider_counterparty_account_id) !== null && _d !== void 0 ? _d : undefined,
33
- thirdPartyTransactionId: (_e = payload.third_party_transaction_id) !== null && _e !== void 0 ? _e : undefined,
33
+ providerCounterpartyAccountId: (_e = payload.provider_counterparty_account_id) !== null && _e !== void 0 ? _e : undefined,
34
+ thirdPartyTransactionId: (_f = payload.third_party_transaction_id) !== null && _f !== void 0 ? _f : undefined,
34
35
  });
35
36
  };
36
37
  exports.mapChargeCardRepaymentPayloadToChargeCardRepayment = mapChargeCardRepaymentPayloadToChargeCardRepayment;
package/lib/index.d.ts CHANGED
@@ -440,7 +440,7 @@ import { ChargeCardRepaymentDetailLocalData } from './view/spendManagement/charg
440
440
  import { ChargeCardPaymentHistoryDownloadReport, getChargeCardPaymentHistoryDownloadReport } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector';
441
441
  import { fetchChargeCardPaymentPage, fetchChargeCardPaymentHistory, updatePaymentHistoryDownloadUIState, updatePaymentHistoryFilters, updatePaymentHistorySearchText, updatePaymentHistoryUIState } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer';
442
442
  import { ChargeCardPaymentHistorySelectorView, ChargeCardRepaymentWithUser, getChargeCardPaymentHistoryView } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector';
443
- import { PAYMENT_HISTORY_FILTER_CATEGORIES, PaymentHistoryFilterCategory, PaymentHistoryFilterCategoryDropdownOption, PaymentHistoryFilterCategoryField, PaymentHistoryFilters } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory';
443
+ import { PAYMENT_HISTORY_FILTER_CATEGORIES, PaymentHistoryAccountInfo, PaymentHistoryFilterCategory, PaymentHistoryFilterCategoryDropdownOption, PaymentHistoryFilterCategoryField, PaymentHistoryFilters } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory';
444
444
  import { getPaymentHistorySourceAccountName, getPaymentStatusDisplayText } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryHelpers';
445
445
  import { acceptChargeCardTerms, enableChargeCardAutoPay, expressInterestInChargeCard, fetchChargeCardSetupView } from './view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer';
446
446
  import { ChargeCardBusinessVerificationDetails, ChargeCardSetupView, getChargeCardBusinessVerificationDetails, getChargeCardSetupViewDetails } from './view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector';
@@ -815,7 +815,7 @@ export { CompanyHealthMetricsLocalData, CompanyHealthViewUIState };
815
815
  export { getCompanyHealthMetricConfig, fetchCompanyHealthMetricConfig, CompanyHealthMetricConfigSelector, };
816
816
  export { CompanyHealthMetric, CompanyRunway, updateCompaniesHealth, updateCompanyHealth, VerticalProductServices, LastEngagement, AdditionalChurnFactors, AdditionalChurnFactor, };
817
817
  export { clearCompanyHealthMetricView, fetchCompanyHealthMetricView, initializeCompanyHealthMetricViewLocalData, removeSelectedCompanyId, saveCompanyHealthMetricById, updateCompanyHealthMetricLocalStore, updateCompanyHealthMetricViewErrorStatus, updateCompanyHealthMetricViewSuccessStatus, updateCompanyHealthViewUIState, };
818
- 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, fetchChargeCardPaymentPage, fetchChargeCardPaymentHistory, updatePaymentHistoryDownloadUIState, updatePaymentHistoryFilters, updatePaymentHistorySearchText, updatePaymentHistoryUIState, ChargeCardPaymentHistoryDownloadReport, ChargeCardPaymentHistorySelectorView, ChargeCardRepaymentWithUser, getChargeCardPaymentHistoryDownloadReport, getChargeCardPaymentHistoryView, getPaymentHistorySourceAccountName, getPaymentStatusDisplayText, 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, };
818
+ 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, fetchChargeCardPaymentPage, fetchChargeCardPaymentHistory, updatePaymentHistoryDownloadUIState, updatePaymentHistoryFilters, updatePaymentHistorySearchText, updatePaymentHistoryUIState, ChargeCardPaymentHistoryDownloadReport, ChargeCardPaymentHistorySelectorView, ChargeCardRepaymentWithUser, getChargeCardPaymentHistoryDownloadReport, getChargeCardPaymentHistoryView, getPaymentHistorySourceAccountName, getPaymentStatusDisplayText, PAYMENT_HISTORY_FILTER_CATEGORIES, PaymentHistoryAccountInfo, 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, };
819
819
  export { TIME_SERIES_DURATIONS, PerformanceReportKey, TimeSeriesDuration, convertToTimeSeriesSelectionRange, toTimeSeriesDuration, TimeSeriesRange, fetchAggregatedReport, aggregatedReportView, AggregatedReportType, AggregatedReportPersona, EventGroupType, MonthlySummaryType, PerformanceReportSummary, };
820
820
  export { fetchApAging, getApAgingReport, updateApAgingUIState, AgingReportId, ApAgingReport, AgingBalance, AgingPeriod, AgingReportSortKey, AgingBalancesByVendor, AgingReportUIState, AgingDetailReportUIState, AgingDetailReportInvoice, AgingDateSelectionType, };
821
821
  export { fetchApAgingDetail, AgingReportInvoice, ApAgingDetail, getApAgingDetailForVendor, updateApAgingDetailUIState, };
@@ -1,7 +1,15 @@
1
1
  import { FetchState, FetchedState, ID } from '../../../../commonStateTypes/common';
2
+ import { Logo } from '../../../../entity/paymentAccount/paymentAccountState';
2
3
  import { ZeniDate } from '../../../../zeniDayJS';
3
4
  import { SpendManagementUIState } from '../../billPay/billList/billListState';
4
5
  import { CategoryCombinationOperator, FilterCategoryType } from '../../spendManagementFilterHelpers';
6
+ export interface PaymentHistoryAccountInfo {
7
+ accountId?: ID;
8
+ accountLogo?: Logo;
9
+ accountType?: 'depositAccount' | 'paymentAccount';
10
+ depositAccountLast4?: string;
11
+ depositAccountName?: string;
12
+ }
5
13
  export type PaymentHistorySortKey = 'paymentDate' | 'sourceAccount' | 'paymentStatus' | 'initiatedBy' | 'amount';
6
14
  export interface PaymentHistoryUIState extends SpendManagementUIState {
7
15
  sortKey: PaymentHistorySortKey;
@@ -17,7 +25,6 @@ export interface ChargeCardPaymentHistoryState extends FetchedState {
17
25
  filters: PaymentHistoryFilters;
18
26
  isAutoPayEnabled: boolean;
19
27
  repaymentHistoryIds: ID[];
20
- repaymentHistoryUserIds: ID[];
21
28
  repaymentHistoryXlsDownloadUrl: string;
22
29
  searchText: string;
23
30
  totalRepayments: number;
@@ -22,7 +22,6 @@ exports.initialChargeCardPaymentHistoryState = {
22
22
  },
23
23
  isAutoPayEnabled: false,
24
24
  repaymentHistoryIds: [],
25
- repaymentHistoryUserIds: [],
26
25
  searchText: '',
27
26
  totalRepayments: 0,
28
27
  repaymentHistoryXlsDownloadUrl: '',
@@ -6,8 +6,9 @@ const userSelector_1 = require("../../../../entity/user/userSelector");
6
6
  const chargeCardPaymentHistoryHelpers_1 = require("./chargeCardPaymentHistoryHelpers");
7
7
  const getChargeCardPaymentHistoryDownloadReport = (state) => {
8
8
  const { chargeCardPaymentHistoryState, chargeCardRepaymentState, userState, } = state;
9
- const { filters, repaymentHistoryIds, repaymentHistoryUserIds, searchText, uiState, fetchState, error, } = chargeCardPaymentHistoryState;
9
+ const { filters, repaymentHistoryIds, searchText, uiState, fetchState, error, } = chargeCardPaymentHistoryState;
10
10
  const repaymentHistory = (0, chargeCardRepaymentSelector_1.getChargeCardRepaymentByIds)(chargeCardRepaymentState, repaymentHistoryIds);
11
+ const repaymentHistoryUserIds = Array.from(new Set(repaymentHistory.map((r) => r.paidById)));
11
12
  const repaymentHistoryUsers = (0, userSelector_1.getUsersByUserIds)(userState, repaymentHistoryUserIds);
12
13
  const userMap = new Map(repaymentHistoryUsers.map((user) => [user.userId, user]));
13
14
  const repaymentHistoryWithUsers = repaymentHistory.map((repayment) => (Object.assign(Object.assign({}, repayment), { paidByUser: userMap.get(repayment.paidById) })));
@@ -32,9 +32,6 @@ const chargeCardPaymentHistory = (0, toolkit_1.createSlice)({
32
32
  draft.currencySymbol = payload.currency_symbol;
33
33
  draft.isAutoPayEnabled = payload.is_auto_pay_enabled;
34
34
  draft.repaymentHistoryIds = payload.repayment_history.map((repayment) => repayment.card_repayment_id);
35
- draft.repaymentHistoryUserIds = payload.repayment_history
36
- .map((repayment) => { var _a; return (_a = repayment.paid_by_user) === null || _a === void 0 ? void 0 : _a.user_id; })
37
- .filter((userId) => userId != null);
38
35
  draft.totalRepayments = payload.total_repayments;
39
36
  draft.fetchState = 'Completed';
40
37
  draft.error = undefined;
@@ -10,9 +10,10 @@ const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountL
10
10
  const chargeCardPaymentHistoryHelpers_1 = require("./chargeCardPaymentHistoryHelpers");
11
11
  const getChargeCardPaymentHistoryView = (state, accountInfoMap) => {
12
12
  const { chargeCardPaymentHistoryState, chargeCardRepaymentState, userState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, } = state;
13
- const { creditAccountId, currencyCode, currencySymbol, filters, isAutoPayEnabled, repaymentHistoryIds, repaymentHistoryUserIds, searchText, totalRepayments, uiState, fetchState, error, } = chargeCardPaymentHistoryState;
13
+ const { creditAccountId, currencyCode, currencySymbol, filters, isAutoPayEnabled, repaymentHistoryIds, searchText, totalRepayments, uiState, fetchState, error, } = chargeCardPaymentHistoryState;
14
14
  // Get the full repayment details from the entity state
15
15
  const repaymentHistory = (0, chargeCardRepaymentSelector_1.getChargeCardRepaymentByIds)(chargeCardRepaymentState, repaymentHistoryIds);
16
+ const repaymentHistoryUserIds = Array.from(new Set(repaymentHistory.map((r) => r.paidById)));
16
17
  // Get users first to enrich repayments
17
18
  const repaymentHistoryUsers = (0, userSelector_1.getUsersByUserIds)(userState, repaymentHistoryUserIds);
18
19
  // Create a map of userId -> User for quick lookup
@@ -25,7 +26,7 @@ const getChargeCardPaymentHistoryView = (state, accountInfoMap) => {
25
26
  repaymentHistoryWithUsers = (0, chargeCardPaymentHistoryHelpers_1.applyPaymentHistoryFiltersSearchAndSort)(repaymentHistoryWithUsers, filters, searchText, uiState, accountInfoMap);
26
27
  // Extract unique funding account IDs from repayment history
27
28
  const repaymentHistoryFundingAccountIds = Array.from(new Set(repaymentHistoryWithUsers
28
- .map((repayment) => repayment.providerDepositAccountId)
29
+ .map((repayment) => repayment.paymentAccountId)
29
30
  .filter((id) => id !== undefined && id !== null)));
30
31
  // Get deposit and payment accounts views for fetch state reduction
31
32
  const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
@@ -38,7 +39,7 @@ const getChargeCardPaymentHistoryView = (state, accountInfoMap) => {
38
39
  // Filter deposit accounts that match providerDepositAccountIds (by id)
39
40
  const matchingDepositAccounts = depositAccountsView.depositAccounts.filter((depositAccount) => repaymentHistoryFundingAccountIds.includes(depositAccount.id));
40
41
  // Filter payment accounts that match providerDepositAccountIds (by providerAccountId)
41
- const matchingPaymentAccounts = paymentAccountsView.paymentAccounts.filter((paymentAccount) => repaymentHistoryFundingAccountIds.includes(paymentAccount.providerAccountId));
42
+ const matchingPaymentAccounts = paymentAccountsView.paymentAccounts.filter((paymentAccount) => repaymentHistoryFundingAccountIds.includes(paymentAccount.paymentAccountId));
42
43
  // Convert to FundingAccount[] format
43
44
  repaymentHistoryFundingAccounts = (0, setupViewSelector_1.getAllFundingAccounts)(matchingDepositAccounts, matchingPaymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus, false);
44
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.24-betaRR10",
3
+ "version": "4.19.24-betaRR12",
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",