feat(版本详情): 完善任务流程与风险预警

This commit is contained in:
Script Generator
2026-06-29 18:14:22 +08:00
parent b48a7e2049
commit b7d48f66aa
24 changed files with 3085 additions and 118 deletions

View File

@@ -1,5 +1,5 @@
import type { TestCase, TestCaseStatus } from './test-case';
import { canTcTransition, getTestCaseRoundNo } from './test-case';
import { canStartTestCase, canTcTransition, getTestCaseRoundNo } from './test-case';
export interface TestCaseWorkflowResult {
ok: boolean;
@@ -36,6 +36,10 @@ export function applyTestCaseTransition(
}
const nowIso = (options.now ?? new Date()).toISOString();
if (to === 'running' && !canStartTestCase(testCase)) {
return { ok: false, message: '开始测试前需要先领取并填写计划开始和计划结束时间' };
}
const patch: Partial<TestCase> = {
status: to,
aiDraft: false,