automation fixes

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-03 12:24:59 +00:00
parent aa8b8a9756
commit 316cafab1b
14 changed files with 1079 additions and 225 deletions

View File

@@ -47,6 +47,13 @@ export interface RunHistoryItem {
current_stage: number;
}
export interface PipelineStage {
number: number;
name: string;
pending: number;
type: 'AI' | 'Local' | 'Manual';
}
function buildUrl(endpoint: string, params?: Record<string, any>): string {
let url = `/v1/automation${endpoint}`;
if (params) {
@@ -141,4 +148,11 @@ export const automationService = {
}> => {
return fetchAPI(buildUrl('/estimate/', { site_id: siteId }));
},
/**
* Get pipeline overview with pending counts for all stages
*/
getPipelineOverview: async (siteId: number): Promise<{ stages: PipelineStage[] }> => {
return fetchAPI(buildUrl('/pipeline_overview/', { site_id: siteId }));
},
};