| 1 | import { ApiProperty } from '@nestjs/swagger'; |
| 2 | import { Type } |
| 3 | import { |
| 4 | IsISO8601, |
| 5 | IsNotEmpty, |
| 6 | IsString, |
| 7 | MaxLength, |
| 8 | ValidateNested, |
| 9 | } from 'class-validator'; |
| 10 | |
| 11 | export class PullRequestCommentDTO |
| 12 | @ApiProperty() |
| 13 | @IsString() |
| 14 | id: string; |
| 15 | |
| 16 | @ApiProperty({ description |
| 17 | @IsString() |
| 18 | body: string; |
| 19 | |
| 20 | @ApiProperty() |
| 21 | @IsString() |
| 22 | authorUsername: string; |
| 23 | |
| 24 | @ApiProperty() |
| 25 | @IsISO8601() |
| 26 | createdAt: string; |
| 27 | |
| 28 | @ApiProperty() |
| 29 | @IsISO8601() |
| 30 | updatedAt: string; |
| 31 | } |
| 32 | |
| 33 | export class CreatePullRequestCommentRequestDTO |
| 34 | @ApiProperty({ maxLength |
| 35 | @IsString() |
| 36 | @IsNotEmpty() |
| 37 | @MaxLength(20000) |
| 38 | body: string; |
| 39 | } |
| 40 | |
| 41 | export class GetPullRequestCommentsResponseDTO |
| 42 | @ApiProperty({ type |
| 43 | @ValidateNested({ each |
| 44 | @Type(() => |
| 45 | comments: PullRequestCommentDTO |
| 46 | } |