feat(FN-1733): add dedicated pause/resume APIs for projects

- Add pauseProject() and resumeProject() methods to ProjectEngineManager
- Wire pause and resume routes to engineManager with proper error handling
- Update frontend useProjectActions hook to use dedicated pause/resume APIs
- Add comprehensive tests for pause/resume in ProjectEngineManager
- Add route tests for project pause/resume with engineManager mocks
- Fix mock stubs for getProject/updateProject/updateProjectHealth
This commit is contained in:
Fusion
2026-04-15 19:53:22 -07:00
committed by gsxdsm
parent 01a221fbe8
commit 9bd437e166
7 changed files with 445 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
import { useCallback } from "react";
import { updateProject, unregisterProject } from "../api";
import { pauseProject, resumeProject, unregisterProject } from "../api";
import type { ProjectInfo } from "../api";
import type { ViewMode } from "./useViewState";
import type { ToastType } from "./useToast";
@@ -81,7 +81,7 @@ export function useProjectActions(options: UseProjectActionsOptions): UseProject
const handlePauseProject = useCallback(async (project: ProjectInfo) => {
try {
await updateProject(project.id, { status: "paused" });
await pauseProject(project.id);
addToast(`Project ${project.name} paused`, "success");
await refreshProjects();
} catch {
@@ -91,7 +91,7 @@ export function useProjectActions(options: UseProjectActionsOptions): UseProject
const handleResumeProject = useCallback(async (project: ProjectInfo) => {
try {
await updateProject(project.id, { status: "active" });
await resumeProject(project.id);
addToast(`Project ${project.name} resumed`, "success");
await refreshProjects();
} catch {