diff --git a/backend/src/project/dto/epic/EpicCreateRequest.dto.ts b/backend/src/project/dto/epic/EpicCreateRequest.dto.ts index 775039a..4acff8f 100644 --- a/backend/src/project/dto/epic/EpicCreateRequest.dto.ts +++ b/backend/src/project/dto/epic/EpicCreateRequest.dto.ts @@ -1,9 +1,17 @@ import { Type } from 'class-transformer'; -import { IsEnum, IsNotEmpty, IsString, Matches, ValidateNested } from 'class-validator'; +import { + IsEnum, + IsNotEmpty, + IsString, + Length, + Matches, + ValidateNested, +} from 'class-validator'; import { EpicColor } from 'src/project/entity/epic.entity'; class Epic { @IsString() + @Length(1, 10) name: string; @IsEnum(EpicColor) diff --git a/backend/src/project/dto/epic/EpicUpdateRequest.dto.ts b/backend/src/project/dto/epic/EpicUpdateRequest.dto.ts index abce63f..29cf6e2 100644 --- a/backend/src/project/dto/epic/EpicUpdateRequest.dto.ts +++ b/backend/src/project/dto/epic/EpicUpdateRequest.dto.ts @@ -7,6 +7,7 @@ import { IsString, Matches, ValidateNested, + Length, } from 'class-validator'; import { EpicColor } from 'src/project/entity/epic.entity'; @@ -17,6 +18,7 @@ class Epic { @IsOptional() @IsString() + @Length(1, 10) name?: string; @IsOptional() diff --git a/backend/src/project/dto/story/StoryCreateRequest.dto.ts b/backend/src/project/dto/story/StoryCreateRequest.dto.ts index 13cdb9f..71bf166 100644 --- a/backend/src/project/dto/story/StoryCreateRequest.dto.ts +++ b/backend/src/project/dto/story/StoryCreateRequest.dto.ts @@ -4,16 +4,22 @@ import { IsInt, IsNotEmpty, IsString, + Length, Matches, + Max, + Min, ValidateNested, } from 'class-validator'; import { StoryStatus } from 'src/project/entity/story.entity'; class Story { @IsString() + @Length(1, 100) title: string; @IsInt() + @Min(0) + @Max(100) point: number; @IsEnum(StoryStatus) diff --git a/backend/src/project/dto/story/StoryUpdateRequest.dto.ts b/backend/src/project/dto/story/StoryUpdateRequest.dto.ts index 4e4d22a..cea3c75 100644 --- a/backend/src/project/dto/story/StoryUpdateRequest.dto.ts +++ b/backend/src/project/dto/story/StoryUpdateRequest.dto.ts @@ -5,7 +5,10 @@ import { IsNotEmpty, IsOptional, IsString, + Length, Matches, + Max, + Min, ValidateNested, } from 'class-validator'; import { StoryStatus } from 'src/project/entity/story.entity'; @@ -20,10 +23,13 @@ class Story { @IsOptional() @IsString() + @Length(1, 100) title?: string; - + @IsOptional() @IsInt() + @Min(0) + @Max(100) point?: number; @IsOptional() diff --git a/backend/src/project/dto/task/TaskCreateRequest.dto.ts b/backend/src/project/dto/task/TaskCreateRequest.dto.ts index 40b1625..e2486c5 100644 --- a/backend/src/project/dto/task/TaskCreateRequest.dto.ts +++ b/backend/src/project/dto/task/TaskCreateRequest.dto.ts @@ -41,7 +41,7 @@ export function IsOneDecimalPlace(validationOptions?: ValidationOptions) { class Task { @IsString() - @Length(0, 100, { message: 'Title must be 100 characters or less' }) + @Length(1, 100, { message: 'Title must be 100 characters or less' }) title: string; @IsOptional() diff --git a/backend/src/project/dto/task/TaskUpdateRequest.dto.ts b/backend/src/project/dto/task/TaskUpdateRequest.dto.ts index ce444aa..72b867d 100644 --- a/backend/src/project/dto/task/TaskUpdateRequest.dto.ts +++ b/backend/src/project/dto/task/TaskUpdateRequest.dto.ts @@ -5,6 +5,7 @@ import { IsNotEmpty, IsOptional, IsString, + Length, Matches, ValidateNested, } from 'class-validator'; @@ -21,6 +22,7 @@ class Task { @IsOptional() @IsString() + @Length(1, 100) title?: string; @IsOptional() diff --git a/backend/src/project/entity/epic.entity.ts b/backend/src/project/entity/epic.entity.ts index 3fbe3ce..5823ccd 100644 --- a/backend/src/project/entity/epic.entity.ts +++ b/backend/src/project/entity/epic.entity.ts @@ -33,7 +33,7 @@ export class Epic { @JoinColumn({ name: 'project_id' }) project: Project; - @Column({ type: 'varchar', length: 255, nullable: false }) + @Column({ type: 'varchar', length: 10, nullable: false }) name: string; @Column({ type: 'varchar', length: 255, nullable: false }) diff --git a/backend/src/project/entity/story.entity.ts b/backend/src/project/entity/story.entity.ts index e0a2506..6747180 100644 --- a/backend/src/project/entity/story.entity.ts +++ b/backend/src/project/entity/story.entity.ts @@ -35,7 +35,7 @@ export class Story { @JoinColumn({ name: 'epic_id' }) epic: Epic; - @Column({ type: 'varchar', length: 255, nullable: false }) + @Column({ type: 'varchar', length: 100, nullable: false }) title: string; @Column({ type: 'int', nullable: false }) diff --git a/backend/src/project/entity/task.entity.ts b/backend/src/project/entity/task.entity.ts index 63901e7..e13aed8 100644 --- a/backend/src/project/entity/task.entity.ts +++ b/backend/src/project/entity/task.entity.ts @@ -34,7 +34,7 @@ export class Task { @JoinColumn({ name: 'story_id' }) story: Story; - @Column({ type: 'varchar', length: 99, nullable: false }) + @Column({ type: 'varchar', length: 100, nullable: false }) title: string; @Column({ type: 'int', nullable: false })