@spaik/mcp-server-roi
Version:
MCP server for AI ROI prediction and tracking with Monte Carlo simulations
147 lines • 5.87 kB
TypeScript
export declare class TransactionService {
/**
* Creates a project with all its use cases atomically
* @param projectData Project details
* @param useCases Array of use cases
* @param implementationCosts Implementation cost breakdown
* @param timelineMonths Project timeline in months
* @param confidenceLevel Confidence level (0-1)
* @returns Transaction result with project and projection IDs
*/
static createProjectWithDetails(projectData: any, useCases: any[], implementationCosts: any, timelineMonths: number, confidenceLevel?: number): Promise<{
success: boolean;
error?: string | undefined;
message?: string | undefined;
project_id?: string | undefined;
total_investment?: number | undefined;
projection_id?: string | undefined;
use_case_count?: number | undefined;
error_detail?: string | undefined;
}>;
/**
* Updates a project and its use cases atomically
* @param projectId UUID of the project
* @param projectUpdates Optional project field updates
* @param useCasesToAdd Optional new use cases to add
* @param useCasesToUpdate Optional use cases to update (must include id)
* @param useCasesToDelete Optional array of use case IDs to delete
* @param regenerateProjection Whether to mark projections for recalculation
* @returns Transaction result with operation counts
*/
static updateProjectWithUseCases(projectId: string, projectUpdates?: any, useCasesToAdd?: any[], useCasesToUpdate?: any[], useCasesToDelete?: string[], regenerateProjection?: boolean): Promise<{
success: boolean;
error?: string | undefined;
project_id?: string | undefined;
error_detail?: string | undefined;
use_cases_added?: number | undefined;
use_cases_updated?: number | undefined;
use_cases_deleted?: number | undefined;
projection_marked_for_update?: boolean | undefined;
}>;
/**
* Deletes a project and all related data atomically
* @param projectId UUID of the project to delete
* @param confirmDelete Must be true to actually delete (false returns what would be deleted)
* @returns Transaction result with deletion summary
*/
static deleteProjectCascade(projectId: string, confirmDelete?: boolean): Promise<{
success: boolean;
error?: string | undefined;
message?: string | undefined;
project_id?: string | undefined;
error_detail?: string | undefined;
would_delete?: {
use_cases: number;
projections: number;
metrics: number;
simulations: number;
} | undefined;
deleted?: {
use_cases: number;
projections: number;
metrics: number;
simulations: number;
} | undefined;
}>;
/**
* Validates project and use case data before creation/update
* @param projectData Project details to validate
* @param useCases Array of use cases to validate
* @returns Validation result with errors and warnings
*/
static validateProjectData(projectData: any, useCases: any[]): Promise<{
errors: {
field: string;
message: string;
}[];
warnings: {
field: string;
message: string;
}[];
valid: boolean;
}>;
/**
* Creates a projection with optional simulation setup
* @param projectId UUID of the project
* @param projectionData Projection details
* @param runSimulation Whether to create a simulation placeholder
* @param simulationIterations Number of Monte Carlo iterations
* @returns Transaction result with projection ID
*/
static createProjectionWithSimulation(projectId: string, projectionData: any, runSimulation?: boolean, simulationIterations?: number): Promise<any>;
/**
* Performs a batch operation with automatic rollback on failure
* @param operations Array of operations to perform
* @returns Results of all operations
*/
static batchOperation(operations: Array<() => Promise<any>>): Promise<{
success: boolean;
results: any[];
}>;
}
export declare function createProjectTransaction(projectData: any, useCases: any[], implementationCosts: any, timelineMonths: number, confidenceLevel?: number): Promise<{
success: boolean;
error?: string | undefined;
message?: string | undefined;
project_id?: string | undefined;
total_investment?: number | undefined;
projection_id?: string | undefined;
use_case_count?: number | undefined;
error_detail?: string | undefined;
}>;
export declare function updateProjectTransaction(projectId: string, updates: {
project?: any;
addUseCases?: any[];
updateUseCases?: any[];
deleteUseCaseIds?: string[];
regenerateProjection?: boolean;
}): Promise<{
success: boolean;
error?: string | undefined;
project_id?: string | undefined;
error_detail?: string | undefined;
use_cases_added?: number | undefined;
use_cases_updated?: number | undefined;
use_cases_deleted?: number | undefined;
projection_marked_for_update?: boolean | undefined;
}>;
export declare function safeDeleteProject(projectId: string): Promise<{
success: boolean;
error?: string | undefined;
message?: string | undefined;
project_id?: string | undefined;
error_detail?: string | undefined;
would_delete?: {
use_cases: number;
projections: number;
metrics: number;
simulations: number;
} | undefined;
deleted?: {
use_cases: number;
projections: number;
metrics: number;
simulations: number;
} | undefined;
}>;
//# sourceMappingURL=transaction-service.d.ts.map