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 {
@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;
}

View File

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