import { InvoicingCatalogItemFormLocalData, InvoicingNamedOption, InvoicingNamedOptionsByKey, NestedAccountHierarchyForReport, NestedClassHierarchyForReport } from '@zeniai/client-epic-state'; import { FieldHelpByCode } from '../../formElements/fieldHelp/FieldHelpContext'; /** * Catalog item types as shown to the user. All three are parent catalog items; * the type controls the parent and nested sub-family payload fields. */ export type CatalogFormType = "addon" | "charge" | "plan"; export interface InvoicingCatalogApplicableItemOption { id: string; label: string; subtitle?: string; } export interface InvoicingCatalogItemFormPageProps { applicabilityValues: readonly string[]; isSubmitting: boolean; localData: InvoicingCatalogItemFormLocalData; mode: "create" | "edit"; periodUnitOptions: InvoicingNamedOption[]; pricingModelValues: readonly string[]; prorationValues: readonly string[]; tierTypeValues: readonly string[]; trialEndActionOptions: InvoicingNamedOption[]; trialUnitOptions: InvoicingNamedOption[]; typeOptions: InvoicingNamedOption[]; applicableItemOptions?: InvoicingCatalogApplicableItemOption[]; /** * Pre-selects (and locks) the catalog item type when creating, so each * catalog tab opens a dedicated "Add Plan / Add Add-on / Add One-time Charge" * form rather than a single combined form. */ defaultType?: CatalogFormType; errorMessage?: string; /** * Backend help copy for the `catalog` field group, keyed by field code. * Absent means no help is available, and no icons render. */ fieldHelp?: FieldHelpByCode; /** * True while the accounting lists are still loading. The form waits rather * than render: the accounting fields choose between a picker and a text input * from these lists, and swapping one for the other on a mounted form replaces * a plain string value with a grouped one under the same field name. */ isQboPickerDataLoading?: boolean; /** * Account and class trees the price-point pickers render as grouped options. * The account tree is already narrowed to the income accounts a price may * post to, so this page does no filtering of its own. */ qboClassHierarchy?: NestedClassHierarchyForReport[]; qboIncomeAccountHierarchy?: NestedAccountHierarchyForReport[]; /** * `catalog_tier_type_options_by_pricing_model` from the invoicing config; the * tier `Type` column is driven by it. `undefined` until the config loads. */ tierTypeOptionsByPricingModel?: InvoicingNamedOptionsByKey; onCancel: () => void; onChange: (localData: InvoicingCatalogItemFormLocalData) => void; onSubmit: () => void; onBack?: () => void; } /** * Presentational create/edit form for an invoicing catalog item. Built on the * shared {@link InvoicingFormShell} (one react-hook-form + back arrow + sticky * footer) and the common `formElements/Labeled*` primitives, mirroring the other * invoicing forms. The whole form syncs back to the CES draft (`localData`) on * every change; the save payload is derived from the draft in CES. */ export declare function InvoicingCatalogItemFormPage({ applicabilityValues, fieldHelp, applicableItemOptions, defaultType, errorMessage, isSubmitting, localData, mode, onBack, onCancel, onChange, onSubmit, periodUnitOptions, pricingModelValues, prorationValues, isQboPickerDataLoading, qboClassHierarchy, qboIncomeAccountHierarchy, tierTypeOptionsByPricingModel, tierTypeValues, trialEndActionOptions, trialUnitOptions, typeOptions, }: Readonly): import("react/jsx-runtime").JSX.Element; export default InvoicingCatalogItemFormPage;