import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID'; import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID'; import { FetchStateAndError } from '../../../commonStateTypes/common'; import { AccountBase } from '../../../entity/account/accountState'; import { ClassBase } from '../../../entity/class/classState'; import { RootState } from '../../../rootStateTypes'; import { InvoicingQboConnection, InvoicingQboSyncHealth } from './invoicingQboViewPayload'; export declare const INVOICING_ACCOUNT_LIST_KEY: "accountList"; /** Whether QBO is connected, without building the option lists to find out. */ export declare const isInvoicingQboConnected: (state: RootState) => boolean; /** * Whether the accounting pickers are still waiting on their data. Only true when * QBO is connected: a tenant without it has no pickers to populate, so the form * must not sit behind a skeleton waiting for lists it will never show. */ export declare const isInvoicingAccountingPickerDataLoading: (state: RootState) => boolean; /** The QBO connection fetch on its own, without building the bundled view. */ export declare const getInvoicingQboConnectionFetchState: (state: RootState) => FetchStateAndError; /** * The account behind a picker value. The pickers submit the QuickBooks id, so * that is what callers hold; the payload builders need the whole entity to send * `toAccountPayload`, which is why the lookup lives here next to the options. */ export declare const invoicingQboAccountByQboId: (state: RootState, qboId: string | undefined) => AccountBase | undefined; /** The class behind a picker value, for the same reason as the account above. */ export declare const invoicingQboClassByQboId: (state: RootState, qboId: string | undefined) => ClassBase | undefined; /** * The resolver every catalog and settings payload builder needs: a picked * QuickBooks id turned back into the account or class record the request body * carries. Deliberately not memoized — epics call it once per action, where a * fresh pair of closures costs nothing. Keep it out of `mapStateToProps`: the * object identity changes per call, so a component reading it would re-render on * every unrelated action. */ export declare const getInvoicingCatalogAccountingLookup: (state: RootState) => { accountByQboId: (qboId: string) => AccountBase | undefined; classByQboId: (qboId: string) => ClassBase | undefined; }; /** An account or class as the invoicing pickers render and submit it. */ export interface InvoicingAccountingOption { id: string; name: string; accountType?: string; } export interface InvoicingQboView { accounts: InvoicingAccountingOption[]; accountsFetchState: FetchStateAndError; backfillState: FetchStateAndError; classes: InvoicingAccountingOption[]; classesFetchState: FetchStateAndError; connectionFetchState: FetchStateAndError; /** * The account and class trees the grouped pickers render. The flat option * lists above stay for callers that only need id and name. */ nestedAccountHierarchy: NestedAccountHierarchyForReport[]; nestedClassHierarchy: NestedClassHierarchyForReport[]; retryFetchStateByTaskId: Record; syncHealthFetchState: FetchStateAndError; connection?: InvoicingQboConnection; syncHealth?: InvoicingQboSyncHealth; } /** * The accounts valid for one QBO mapping kind, whose `accountTypes` is a * comma-separated list of QuickBooks type names. An unrecognised list yields no * accounts rather than every account: offering a bank account where income is * required would post a mapping QuickBooks rejects. */ export declare const invoicingAccountsForQboAccountTypes: (accounts: InvoicingAccountingOption[], accountTypes: string) => InvoicingAccountingOption[]; /** * Single bundled view for the QBO integration settings screen — the * connection, the account and class options, sync health, and the fetch/action * states for each of them. */ export declare const getInvoicingQboView: (state: RootState) => InvoicingQboView;