import { SmrtCollection } from '@happyvertical/smrt-core'; import { Opportunity } from '../models/Opportunity.js'; import { MoveToStageParams } from '../types.js'; export declare class OpportunityCollection extends SmrtCollection { static readonly _itemClass: typeof Opportunity; private stageCollectionPromise; private activityCollectionPromise; /** Sibling stage collection sharing this collection's DB connection. */ private getStageCollection; /** Sibling activity collection sharing this collection's DB connection. */ private getActivityCollection; /** * Opportunities originating from a given lead, oldest first (the first row * is the one `LeadCollection.qualify()` treats as canonical). */ findByLead(leadId: string): Promise; /** * Open (still in play) opportunities, optionally narrowed to one pipeline. */ findOpen(pipelineId?: string): Promise; /** * Move an opportunity to another stage of ITS pipeline, with the full * consequence set: * * - validates the target stage belongs to the opportunity's pipeline * (an opportunity created without a pipeline adopts the stage's); * - adopts the stage's default `probability` unless * `probabilityOverride` is given; * - terminal stages close the deal: `isWon` sets `status: 'won'` + * `wonAt`; `isLost` sets `status: 'lost'` + `lostAt` (record the loss * reason via `outcomeReason`); * - writes a `stage_change` SalesActivity carrying from/to detail. * * Moves after a terminal status are rejected — a closed deal's history is * settled; reopening is not supported (create a new opportunity instead). * * @returns The updated opportunity */ moveToStage(params: MoveToStageParams): Promise; } export default OpportunityCollection; //# sourceMappingURL=OpportunityCollection.d.ts.map