import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; import type { z } from "zod"; import type { insertPipelineSchema, insertStageSchema, pipelineListQuerySchema, stageListQuerySchema, updatePipelineSchema, updateStageSchema } from "../validation.js"; type PipelineListQuery = z.infer; type CreatePipelineInput = z.infer; type UpdatePipelineInput = z.infer; type StageListQuery = z.infer; type CreateStageInput = z.infer; type UpdateStageInput = z.infer; export declare class PipelineDeleteConflictError extends Error { readonly pipelineId: string; readonly dependentQuoteCount: number; constructor(pipelineId: string, dependentQuoteCount: number); } export declare const pipelinesService: { listPipelines(db: PostgresJsDatabase, query: PipelineListQuery): Promise>; getPipelineById(db: PostgresJsDatabase, id: string): Promise<{ id: string; entityType: "organization" | "person" | "quote" | "activity"; name: string; isDefault: boolean; sortOrder: number; createdAt: Date; updatedAt: Date; } | null>; createPipeline(db: PostgresJsDatabase, data: CreatePipelineInput): Promise<{ name: string; createdAt: Date; updatedAt: Date; id: string; entityType: "organization" | "person" | "quote" | "activity"; isDefault: boolean; sortOrder: number; } | undefined>; updatePipeline(db: PostgresJsDatabase, id: string, data: UpdatePipelineInput): Promise<{ id: string; entityType: "organization" | "person" | "quote" | "activity"; name: string; isDefault: boolean; sortOrder: number; createdAt: Date; updatedAt: Date; } | null>; deletePipeline(db: PostgresJsDatabase, id: string): Promise<{ id: string; } | null>; listStages(db: PostgresJsDatabase, query: StageListQuery): Promise>; getStageById(db: PostgresJsDatabase, id: string): Promise<{ id: string; pipelineId: string; name: string; sortOrder: number; probability: number | null; isClosed: boolean; isWon: boolean; isLost: boolean; createdAt: Date; updatedAt: Date; } | null>; createStage(db: PostgresJsDatabase, data: CreateStageInput): Promise<{ name: string; createdAt: Date; updatedAt: Date; id: string; sortOrder: number; pipelineId: string; probability: number | null; isClosed: boolean; isWon: boolean; isLost: boolean; } | undefined>; updateStage(db: PostgresJsDatabase, id: string, data: UpdateStageInput): Promise<{ id: string; pipelineId: string; name: string; sortOrder: number; probability: number | null; isClosed: boolean; isWon: boolean; isLost: boolean; createdAt: Date; updatedAt: Date; } | null>; deleteStage(db: PostgresJsDatabase, id: string): Promise<{ id: string; } | null>; }; export {};