feat(scenario): add scenario runs, run steps, and step ordering

- add ScenarioRunEntity (pending|in_progress|pass|fail) and ScenarioRunStepEntity (waiting|pending|in_progress|pass|fail)
- add POST /scenarios/:id/run — creates run with first step pending, rest waiting
- add order field to ScenarioStepEntity and ScenarioRunStepEntity for deterministic sequential execution
- findOne and createRun now sort steps/stepRuns by order ASC
This commit is contained in:
2026-04-07 14:27:17 +03:00
parent d669bf1c59
commit caf120741d
9 changed files with 158 additions and 5 deletions
+10
View File
@@ -111,4 +111,14 @@ export class ScenarioController {
) {
return this.scenarioService.removeStep(id, stepId);
}
// ── Runs ──────────────────────────────────────────────────────────────────
@Post(':id/run')
@ApiOperation({ summary: 'Create a new run for a scenario' })
@ApiResponse({ status: 201, description: 'Run created with step runs' })
@ApiResponse({ status: 404, description: 'Scenario not found' })
createRun(@Param('id', ParseIntPipe) id: number) {
return this.scenarioService.createRun(id);
}
}