import { SmrtObject } from '@happyvertical/smrt-core'; import { PipelineDefinitionOptions, PipelineStatus } from '../types.js'; /** * PipelineDefinition names an ordered set of {@link PipelineStage | stages} * that opportunities move through. Pipelines are configuration rows, not * code: tenants can run several (e.g. `default`, `enterprise`, `renewals`) * and reshape stages freely without any Lead/Opportunity model change. * * The natural key is `(tenant_id, key)` (`conflictColumns`), so re-seeding a * pipeline with the same key upserts instead of duplicating. The seeded * default pipeline (key `'default'`, 7 stages) comes from * `PipelineDefinitionCollection.ensureDefaultPipeline()`. * * @example * ```typescript * const pipelines = await PipelineDefinitionCollection.create({ db }); * const { pipeline, stages } = await pipelines.ensureDefaultPipeline(); * const enterprise = await pipelines.create({ * key: 'enterprise', * name: 'Enterprise motion', * }); * ``` */ export declare class PipelineDefinition extends SmrtObject { /** * Tenant ID for multi-tenant isolation. * Nullable to support both tenant-scoped and global pipelines. */ tenantId: string | null; /** * Stable machine key, unique per tenant (natural key with `tenantId`). * Required — e.g. `'default'`, `'enterprise'`. */ key: string; /** Human-readable pipeline name shown on CRM surfaces. */ name: string; /** * Marks the tenant's default pipeline. Informational for pickers/UI; the * seeded default pipeline sets it `true`. */ isDefault: boolean; /** `active` pipelines accept new opportunities; `archived` are read-only history. */ status: PipelineStatus; /** * Free-form JSON object stored as a string. Use * {@link getMetadata}/{@link setMetadata} instead of parsing manually. */ metadata: string; constructor(options?: PipelineDefinitionOptions); /** Whether the pipeline accepts new opportunities. */ isActive(): boolean; /** Parse the metadata JSON string; returns `{}` on malformed content. */ getMetadata(): Record; /** Serialize and store the metadata object. */ setMetadata(metadata: Record): void; } export default PipelineDefinition; //# sourceMappingURL=PipelineDefinition.d.ts.map