Skip to content

Commit 4d3a309

Browse files
#RI-2509-refactor
1 parent 4d10e62 commit 4d3a309

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

redisinsight/api/src/modules/workbench/models/command-execution.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2+
import { IsDefined } from 'class-validator';
23
import { CommandExecutionResult } from 'src/modules/workbench/models/command-execution-result';
34
import { ClusterNodeRole, RunQueryMode, ResultsMode } from 'src/modules/workbench/dto/create-command-execution.dto';
45
import { ClusterSingleNodeOptions } from 'src/modules/cli/dto/cli.dto';
56
import { Expose } from 'class-transformer';
67

7-
export type ResultsSummary = {
8+
export class ResultsSummary {
9+
@ApiProperty({
10+
description: 'Total number of commands executed',
11+
type: Number,
12+
})
13+
@IsDefined()
814
total: number;
15+
16+
@ApiProperty({
17+
description: 'Total number of successful commands executed',
18+
type: Number,
19+
})
20+
@IsDefined()
921
success: number;
22+
23+
@ApiProperty({
24+
description: 'Total number of failed commands executed',
25+
type: Number,
26+
})
27+
@IsDefined()
1028
fail: number;
1129
}
1230

@@ -57,7 +75,7 @@ export class CommandExecution {
5775

5876
@ApiPropertyOptional({
5977
description: 'Workbench executions summary',
60-
// type: () => ResultsSummary,
78+
type: () => ResultsSummary,
6179
})
6280
@Expose()
6381
summary?: ResultsSummary;

0 commit comments

Comments
 (0)