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:
@@ -1,8 +1,13 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
import { IsIn, IsInt, IsNotEmpty, IsOptional, IsString, Min } from 'class-validator';
|
||||
import { StepType } from '../scenario-step.entity';
|
||||
|
||||
export class CreateScenarioStepDto {
|
||||
@ApiProperty({ example: 0, description: 'Execution order (ascending)' })
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
order: number;
|
||||
|
||||
@ApiProperty({ enum: ['login', 'exec'], example: 'exec' })
|
||||
@IsIn(['login', 'exec'])
|
||||
type: StepType;
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
import { IsIn, IsInt, IsNotEmpty, IsOptional, IsString, Min } from 'class-validator';
|
||||
import { StepType } from '../scenario-step.entity';
|
||||
|
||||
export class UpdateScenarioStepDto {
|
||||
@ApiPropertyOptional({ example: 0 })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
order?: number;
|
||||
|
||||
@ApiPropertyOptional({ enum: ['login', 'exec'] })
|
||||
@IsOptional()
|
||||
@IsIn(['login', 'exec'])
|
||||
|
||||
Reference in New Issue
Block a user