feat(tests): types and API client for red/blue review workflow

This commit is contained in:
kitos
2026-07-06 12:02:07 +02:00
parent 8a028bf0ed
commit 82033b5037
2 changed files with 40 additions and 0 deletions
+25
View File
@@ -197,6 +197,31 @@ export async function startBlueWork(testId: string): Promise<Test> {
return data;
}
// ── Lead Review Gates (red_review / blue_review) ────────────────────
export interface RedReviewPayload {
decision: "approve" | "reopen";
notes?: string;
}
export interface BlueReviewPayload {
decision: "approve" | "reopen" | "gap";
notes?: string;
system_gaps?: string;
}
/** Assigned Red Lead approves or reopens a test sitting in red_review. */
export async function reviewAsRedLead(testId: string, payload: RedReviewPayload): Promise<Test> {
const { data } = await client.post<Test>(`/tests/${testId}/review-red`, payload);
return data;
}
/** Assigned Blue Lead approves, reopens, or flags a capability gap on a test in blue_review. */
export async function reviewAsBlueLead(testId: string, payload: BlueReviewPayload): Promise<Test> {
const { data } = await client.post<Test>(`/tests/${testId}/review-blue`, payload);
return data;
}
// ── Lead Validation ────────────────────────────────────────────────
/** Red Lead approves/rejects the red side. */