diff --git a/libs/common/src/modules/project/dtos/project.dto.ts b/libs/common/src/modules/project/dtos/project.dto.ts index a5931af..ef08e55 100644 --- a/libs/common/src/modules/project/dtos/project.dto.ts +++ b/libs/common/src/modules/project/dtos/project.dto.ts @@ -1,15 +1,15 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; export class ProjectDto { - @ApiProperty({ - example: 'd7a44e8a-32d5-4f39-ae2e-013f1245aead', - description: 'UUID of the project', - }) + @IsString() + @IsNotEmpty() uuid: string; - @ApiProperty({ - example: 'Project 1', - description: 'Name of the project', - }) + @IsString() + @IsNotEmpty() name: string; + + @IsString() + @IsOptional() + public description?: string; } diff --git a/libs/common/src/modules/project/entities/project.entity.ts b/libs/common/src/modules/project/entities/project.entity.ts index 7eb1956..ff324b2 100644 --- a/libs/common/src/modules/project/entities/project.entity.ts +++ b/libs/common/src/modules/project/entities/project.entity.ts @@ -17,6 +17,9 @@ export class ProjectEntity extends AbstractEntity { }) public name: string; + @Column({ length: 255, nullable: true }) + description: string; + constructor(partial: Partial) { super(); Object.assign(this, partial);