added description

This commit is contained in:
hannathkadher
2024-12-09 11:24:28 +04:00
parent acbd5d53f1
commit 54228c24eb
2 changed files with 12 additions and 9 deletions

View File

@ -1,15 +1,15 @@
import { ApiProperty } from '@nestjs/swagger'; import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
export class ProjectDto { export class ProjectDto {
@ApiProperty({ @IsString()
example: 'd7a44e8a-32d5-4f39-ae2e-013f1245aead', @IsNotEmpty()
description: 'UUID of the project',
})
uuid: string; uuid: string;
@ApiProperty({ @IsString()
example: 'Project 1', @IsNotEmpty()
description: 'Name of the project',
})
name: string; name: string;
@IsString()
@IsOptional()
public description?: string;
} }

View File

@ -17,6 +17,9 @@ export class ProjectEntity extends AbstractEntity<ProjectDto> {
}) })
public name: string; public name: string;
@Column({ length: 255, nullable: true })
description: string;
constructor(partial: Partial<ProjectEntity>) { constructor(partial: Partial<ProjectEntity>) {
super(); super();
Object.assign(this, partial); Object.assign(this, partial);