1- import { ApiProperty } from '@nestjs/swagger' ;
2- import { IsDateString , IsNotEmpty , IsOptional , IsString } from 'class-validator' ;
3- import { ChallengeStatus } from './challenge-status.enum' ;
4- import { Transform } from 'class-transformer' ;
5- import { transformArray } from 'src/common/validation.util' ;
6-
1+ import { ApiProperty } from "@nestjs/swagger" ;
2+ import {
3+ IsDateString ,
4+ IsNotEmpty ,
5+ IsOptional ,
6+ IsString ,
7+ } from "class-validator" ;
8+ import { ChallengeStatus } from "./challenge-status.enum" ;
9+ import { Transform } from "class-transformer" ;
10+ import { transformArray } from "src/common/validation.util" ;
711
812export class SubmissionLinksQueryDto {
9-
1013 @ApiProperty ( {
1114 required : true ,
1215 description : "Filter by challenge completion date (from)" ,
@@ -24,17 +27,17 @@ export class SubmissionLinksQueryDto {
2427 @IsDateString ( )
2528 completionDateTo ?: Date ;
2629
27- @ApiProperty ( {
28- required : false ,
29- enum : ChallengeStatus ,
30- example : [ ChallengeStatus . COMPLETED ] ,
31- isArray : true ,
32- } )
33- @IsOptional ( )
34- @IsString ( { each : true } )
35- @IsNotEmpty ( { each : true } )
36- @Transform ( transformArray )
37- challengeStatus ?: ChallengeStatus [ ] ;
30+ @ApiProperty ( {
31+ required : false ,
32+ enum : ChallengeStatus ,
33+ example : [ ChallengeStatus . COMPLETED ] ,
34+ isArray : true ,
35+ } )
36+ @IsOptional ( )
37+ @IsString ( { each : true } )
38+ @IsNotEmpty ( { each : true } )
39+ @Transform ( transformArray )
40+ challengeStatus ?: ChallengeStatus [ ] ;
3841}
3942
4043export class SubmissionLinksDto {
@@ -44,42 +47,44 @@ export class SubmissionLinksDto {
4447 challengeId : number ;
4548
4649 @ApiProperty ( {
47- description : "Status of the challenge"
50+ description : "Status of the challenge" ,
4851 } )
4952 challengeStatus : ChallengeStatus ;
5053
5154 @ApiProperty ( {
52- description : "The date at which the challenge is completed"
55+ description : "The date at which the challenge is completed" ,
5356 } )
5457 challengeCompletedDate : string | null ;
5558
5659 @ApiProperty ( {
57- description : "The registration handle of the submitter"
60+ description : "The registration handle of the submitter" ,
5861 } )
5962 registrantHandle : string ;
6063
6164 @ApiProperty ( {
62- description : "The final score received by the registrant on that submission"
65+ description :
66+ "The final score received by the registrant on that submission" ,
6367 } )
6468 registrantFinalScore : number ;
6569
6670 @ApiProperty ( {
67- description : "This denotes if the submission has passed. If the final score is greater than 98 then its considered pass"
71+ description :
72+ "This denotes if the submission has passed. If the final score is greater than 98 then its considered pass" ,
6873 } )
6974 didSubmissionPass : boolean ;
7075
7176 @ApiProperty ( {
72- description : "The link to the submission url"
77+ description : "The link to the submission url" ,
7378 } )
7479 submissionUrl : string ;
7580
7681 @ApiProperty ( {
77- description : "Submission ID"
82+ description : "Submission ID" ,
7883 } )
7984 submissionId : number ;
8085
8186 @ApiProperty ( {
82- description : "Submission creation date"
87+ description : "Submission creation date" ,
8388 } )
8489 submissionCreatedDate : string ;
8590}
0 commit comments