@@ -8,56 +8,64 @@ import { IgnoreAreaDto } from '../test/dto/ignore-area.dto';
88@ApiTags ( 'test-runs' )
99@Controller ( 'test-runs' )
1010export class TestRunsController {
11- constructor ( private testRunsService : TestRunsService ) { }
12-
13- @Get ( )
14- @ApiQuery ( { name : 'buildId' , required : true } )
15- @ApiBearerAuth ( )
16- @UseGuards ( JwtAuthGuard )
17- get ( @Query ( 'buildId' , new ParseUUIDPipe ( ) ) buildId : string ) : Promise < TestRun [ ] > {
18- return this . testRunsService . findMany ( buildId ) ;
19- }
20-
21- @Get ( 'recalculateDiff/:id' )
22- @ApiParam ( { name : 'id' , required : true } )
23- @ApiBearerAuth ( )
24- @UseGuards ( JwtAuthGuard )
25- recalculateDiff ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
26- return this . testRunsService . recalculateDiff ( id ) ;
27- }
28-
29- @Get ( 'approve/:id' )
30- @ApiParam ( { name : 'id' , required : true } )
31- @ApiBearerAuth ( )
32- @UseGuards ( JwtAuthGuard )
33- approveTestRun ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
34- return this . testRunsService . approve ( id ) ;
35- }
36-
37- @Get ( 'reject/:id' )
38- @ApiParam ( { name : 'id' , required : true } )
39- @ApiBearerAuth ( )
40- @UseGuards ( JwtAuthGuard )
41- rejectTestRun ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
42- return this . testRunsService . reject ( id ) ;
43- }
44-
45- @Delete ( '/:id' )
46- @ApiParam ( { name : 'id' , required : true } )
47- @ApiBearerAuth ( )
48- @UseGuards ( JwtAuthGuard )
49- deleteTestRun ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
50- return this . testRunsService . delete ( id ) ;
51- }
52-
53- @Put ( 'ignoreArea/:testRunId' )
54- @ApiParam ( { name : 'testRunId' , required : true } )
55- @ApiBearerAuth ( )
56- @UseGuards ( JwtAuthGuard )
57- updateIgnoreAreas (
58- @Param ( 'testRunId' , new ParseUUIDPipe ( ) ) testRunId : string ,
59- @Body ( ) ignoreAreas : IgnoreAreaDto [ ] ,
60- ) : Promise < TestRun > {
61- return this . testRunsService . updateIgnoreAreas ( testRunId , ignoreAreas ) ;
62- }
11+ constructor ( private testRunsService : TestRunsService ) { }
12+
13+ @Get ( )
14+ @ApiQuery ( { name : 'buildId' , required : true } )
15+ @ApiBearerAuth ( )
16+ @UseGuards ( JwtAuthGuard )
17+ get ( @Query ( 'buildId' , new ParseUUIDPipe ( ) ) buildId : string ) : Promise < TestRun [ ] > {
18+ return this . testRunsService . findMany ( buildId ) ;
19+ }
20+
21+ @Get ( 'recalculateDiff/:id' )
22+ @ApiParam ( { name : 'id' , required : true } )
23+ @ApiBearerAuth ( )
24+ @UseGuards ( JwtAuthGuard )
25+ recalculateDiff ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
26+ return this . testRunsService . recalculateDiff ( id ) ;
27+ }
28+
29+ @Get ( 'approve/:id' )
30+ @ApiParam ( { name : 'id' , required : true } )
31+ @ApiBearerAuth ( )
32+ @UseGuards ( JwtAuthGuard )
33+ approveTestRun ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
34+ return this . testRunsService . approve ( id ) ;
35+ }
36+
37+ @Get ( 'reject/:id' )
38+ @ApiParam ( { name : 'id' , required : true } )
39+ @ApiBearerAuth ( )
40+ @UseGuards ( JwtAuthGuard )
41+ rejectTestRun ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
42+ return this . testRunsService . reject ( id ) ;
43+ }
44+
45+ @Delete ( '/:id' )
46+ @ApiParam ( { name : 'id' , required : true } )
47+ @ApiBearerAuth ( )
48+ @UseGuards ( JwtAuthGuard )
49+ deleteTestRun ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestRun > {
50+ return this . testRunsService . delete ( id ) ;
51+ }
52+
53+ @Put ( 'ignoreArea/:testRunId' )
54+ @ApiParam ( { name : 'testRunId' , required : true } )
55+ @ApiBearerAuth ( )
56+ @UseGuards ( JwtAuthGuard )
57+ updateIgnoreAreas (
58+ @Param ( 'testRunId' , new ParseUUIDPipe ( ) ) testRunId : string ,
59+ @Body ( ) ignoreAreas : IgnoreAreaDto [ ]
60+ ) : Promise < TestRun > {
61+ return this . testRunsService . updateIgnoreAreas ( testRunId , ignoreAreas ) ;
62+ }
63+
64+ @Put ( 'comment/:testRunId' )
65+ @ApiParam ( { name : 'testRunId' , required : true } )
66+ @ApiBearerAuth ( )
67+ @UseGuards ( JwtAuthGuard )
68+ updateComment ( @Param ( 'testRunId' , new ParseUUIDPipe ( ) ) testRunId : string , @Body ( ) comment : string ) : Promise < TestRun > {
69+ return this . testRunsService . updateComment ( testRunId , comment ) ;
70+ }
6371}
0 commit comments