import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID'; import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID'; import { FetchStateAndError, ID } from '../../../commonStateTypes/common'; import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport'; import { InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingFieldHelpByCode, InvoicingNamedOption, InvoicingNamedOptionsByKey } from '../../../entity/invoicing/invoicingCommonPayload'; import { InvoicingPlan } from '../../../entity/invoicing/plan/planState'; import { RootState } from '../../../rootStateTypes'; import { InvoicingCatalogItemFormLocalData, InvoicingCatalogItemKind } from './editInvoicingCatalogItemDetailViewState'; export declare const getEditInvoicingCatalogItemDetailViewState: (state: RootState) => FetchStateAndError; export declare const getSavedInvoicingCatalogItemId: (state: RootState) => ID | undefined; export declare const getSavedInvoicingCatalogItemKind: (state: RootState) => InvoicingCatalogItemKind | undefined; /** Picker option for a plan's `applicable_items` (add-ons / one-time charges). */ export interface ApplicableCatalogItemOption { id: string; label: string; subtitle?: string; } /** * Memoized add-on / one-time-charge options sourced from the catalog list slice. * Kept referentially stable across unrelated dispatches; the form view filters * out the item being edited (see `getInvoicingCatalogItemFormView`). */ export declare const getInvoicingApplicableCatalogItemOptions: (state: RootState) => ApplicableCatalogItemOption[]; /** * Bundled view for the catalog item create/edit form. Given only the parent * item `id`, it prefills the draft `localData` from the existing entity in edit * mode, exposes the enum option sets and the * `applicableItems` picker options, and carries the save fetch state/error plus * the id/kind last saved — so the consumer wires a single selector. */ export interface InvoicingCatalogItemFormView extends SelectorView { /** * The in-flight lifecycle action (archive, activate, …) for this item, so the * screen does not reach for the action slice itself. */ actionState: FetchStateAndError; applicabilityValues: readonly string[]; applicableItemOptions: ApplicableCatalogItemOption[]; /** Lifecycle option lists, folded in from the record view. */ catalogItemLifecycleActionOptions: InvoicingCatalogLifecycleActionOption[]; catalogProductLifecycleActionOptions: InvoicingCatalogLifecycleActionOption[]; /** * Backend help copy for this screen's field group, keyed by field code. * Folded in here so the screen never reaches for the config view itself. */ fieldHelp: InvoicingFieldHelpByCode; /** * True while the accounting lists are still loading, so the form can wait * instead of mounting pickers whose options are not there yet. */ isQboPickerDataLoading: boolean; localData: InvoicingCatalogItemFormLocalData; mode: 'create' | 'edit'; /** * Every request the page renders from, reduced to one state: the record, the * config behind the dropdowns and field help, and the account/class pickers. * The page holds a skeleton until this is `Completed`, so the form mounts * once with real values instead of re-seeding as each response lands. */ pageFetchState: FetchStateAndError; periodUnitOptions: InvoicingNamedOption[]; pricingModelValues: readonly string[]; prorationValues: readonly string[]; /** * Account and class trees for the price-point pickers, straight from the * shared accounting lists — the pickers drop the nodes they cannot submit. * Empty until QBO is connected: the form must not offer a mapping that cannot * be pushed. */ qboAccountHierarchy: NestedAccountHierarchyForReport[]; qboClassHierarchy: NestedClassHierarchyForReport[]; /** * Loading the item, as distinct from this view's own `fetchState`, which * tracks the save. */ recordState: FetchStateAndError; tierTypeValues: readonly string[]; trialEndActionOptions: InvoicingNamedOption[]; trialUnitOptions: InvoicingNamedOption[]; typeOptions: InvoicingNamedOption[]; /** * Backend tier-type choices per pricing model. Folded in here rather than left * for the screen to pull off `getInvoicingConfigView` itself, so the form wires * one selector and CES stays the only place that knows which slice each option * set lives in. */ catalogTierTypeOptionsByPricingModel?: InvoicingNamedOptionsByKey; kind?: InvoicingCatalogItemKind; plan?: InvoicingPlan; savedItemId?: ID; savedKind?: InvoicingCatalogItemKind; } export declare const getInvoicingCatalogItemFormView: (state: RootState, id?: ID) => InvoicingCatalogItemFormView;