import { Amount } from '../../../../commonStateTypes/amount'; import { FetchStateAndError, ID } from '../../../../commonStateTypes/common'; import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport'; import { ChargeCard } from '../../../../entity/chargeCard/chargeCard'; import { Class } from '../../../../entity/class/classState'; import { DepositAccountWithLimit } from '../../../../entity/depositAccount/depositAccount'; import { RootState } from '../../../../rootStateTypes'; import { Person } from '../../../people/peopleState'; import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState'; import { RecurringExpense } from '../chargeCardDetail/chargeCardDetail'; import { ChargeCardControlDetailView } from '../chargeCardDetail/chargeCardDetailSelector'; import { ChargeCardListUIState, ChargeCardWithUser, ChargeCardWithUserAndShippingAddress, CreditAccount, CreditAccountRepayment, DebitCardSummaries, ResendRevokeCardInvite } from './chargeCardList'; export interface ChargeCardListSelectorView extends SelectorView { allAccountingClasses: Class[]; cards: ChargeCardWithUser[]; chargeCardConfig: ChargeCardConfigState; closeChargeCardsFetchState: FetchStateAndError; creditAccount: CreditAccount; creditAccountRepayment: CreditAccountRepayment; hasCreditCard: boolean; hasDebitCard: boolean; issueCardPageFetchState: FetchStateAndError; lockChargeCardsFetchState: FetchStateAndError; resendCardInvite: ResendRevokeCardInvite; revokeCardInvite: ResendRevokeCardInvite; revokeChargeCardsInviteFetchState: FetchStateAndError; searchText: string; totalCashback: Amount; uiState: ChargeCardListUIState; unlockChargeCardsFetchState: FetchStateAndError; updateChargeCardsSpendLimitFetchState: FetchStateAndError; userList: Person[]; debitCardSummary?: DebitCardSummaries; unAssignedCredits?: Amount; } export interface MyPendingActivationChargeCardListSelectorView extends SelectorView { cards: ChargeCardWithUser[]; uiState: ChargeCardListUIState; } export interface ChargeCardListWithShippingAddressSelectorView extends SelectorView { cards: ChargeCardWithUserAndShippingAddress[]; } export interface AllChargeCardsWithUserSelectorView extends SelectorView { cards: ChargeCardWithUser[]; } export declare const getChargeCardListView: (state: RootState, includeCreditAccountDebitSummaryAndCashbackInfo: boolean, isDebitCardEnabled: boolean, isCreditCardEnabled: boolean) => ChargeCardListSelectorView; /** * Returns every enriched `ChargeCardWithUser` for the tenant, without * applying the cards-list screen's `searchText` filter or its column * `sortKey/sortOrder`. Used by surfaces that need the raw card universe * decoupled from whatever the user has typed/sorted on the cards list * (e.g. the Card Policy "Apply to Cards" picker, which owns its own * search + sort UI). The list-screen's filter/sort state is intentionally * left untouched so revisits to the cards list still restore the user's * search. */ export declare const getAllChargeCardsWithUser: (state: RootState) => AllChargeCardsWithUserSelectorView; export declare const getMyPendingActivationChargeCardListView: (state: RootState) => MyPendingActivationChargeCardListSelectorView; export declare const getMyRequestOnHoldChargeCardListWithShippingAddress: (state: RootState) => ChargeCardListWithShippingAddressSelectorView; /** * helpers */ export declare const anyCardOnHold: (cards: ChargeCardWithUser[]) => boolean; export declare const getCreditAccountDetails: (state: RootState) => { creditAccount: CreditAccount; creditAccountRepayment: CreditAccountRepayment; }; export interface DepositAccountListWithDebitCardIssued extends FetchStateAndError { depositAccounts: DepositAccountWithLimit[]; } export declare const getDepositAccountListWithDebitCardIssued: (state: RootState, depositAccountIds: ID[]) => DepositAccountListWithDebitCardIssued; export interface DebitCardListSelectorView extends FetchStateAndError { cards: ChargeCard[]; } export declare const getDebitCardList: (state: RootState) => DebitCardListSelectorView; export declare const getDebitCardSummary: (state: RootState) => DebitCardSummaries; export interface ChargeCardRecurringExpensesByCardIds extends FetchStateAndError { recurringExpensesByChargeCardId: Record; } export declare const getChargeCardRecurringExpensesByCardIds: (state: RootState, chargeCardIds: ID[]) => ChargeCardRecurringExpensesByCardIds; /** * Memoized selector for row action card data * Combines ChargeCardControlDetailView, depositAccountLimit, and recurringExpenses * based on the rowActionCardId from chargeCardListState */ export interface ChargeCardRowActionView extends ChargeCardControlDetailView { depositAccountLimitFetchState: FetchStateAndError; recurringExpenses: RecurringExpense[]; recurringExpensesFetchState: FetchStateAndError; cardId?: ID; chargeCard?: ChargeCardWithUser; depositAccountLimit?: DepositAccountWithLimit; } /** * Memoized selector that returns row action card data * Only recomputes when relevant parts of state change */ export declare const getChargeCardRowActionView: (state: RootState) => ChargeCardRowActionView; /** * Memoized selector for bulk action cards data * Returns data for all cards selected in bulkActionCardIds */ export interface ChargeCardBulkActionView { bulkActionCardIds: ID[]; chargeCards: ChargeCardWithUser[]; hasCreditCards: boolean; hasDebitCards: boolean; recurringExpensesByCardId: Record; recurringExpensesFetchState: FetchStateAndError; } /** * Memoized selector that returns bulk action cards data * Only recomputes when relevant parts of state change */ export declare const getChargeCardBulkActionView: (state: RootState) => ChargeCardBulkActionView;