diff --git a/src/modules/task-manager/dto/project/create-project.dto.ts b/src/modules/task-manager/dto/project/create-project.dto.ts new file mode 100644 index 0000000..7c9c2c1 --- /dev/null +++ b/src/modules/task-manager/dto/project/create-project.dto.ts @@ -0,0 +1,40 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsOptional, IsNotEmpty, IsUUID, IsDateString, MaxLength } from "class-validator"; + +export class CreateProjectDto { + @ApiProperty({ description: "Name of the project", example: "Mobile App Redesign" }) + @IsString() + @IsNotEmpty() + @MaxLength(150) + name: string; + + @ApiProperty({ description: "Name of the project owner", example: "Jane Doe" }) + @IsString() + @IsNotEmpty() + @MaxLength(150) + ownerName: string; + + @ApiProperty({ description: "Description of the project", required: false, example: "Redesign of the mobile app UI/UX" }) + @IsString() + @IsOptional() + description?: string; + + @ApiProperty({ description: "Start date of the project", example: "2026-07-01" }) + @IsDateString() + @IsNotEmpty() + startDate: string; + + @ApiProperty({ + description: "Background picture URL of the project", + required: false, + example: "https://cdn.example.com/projects/bg1.png", + }) + @IsString() + @IsOptional() + backgroundPicture?: string; + + @ApiProperty({ description: "ID of the workspace this project belongs to", example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }) + @IsUUID() + @IsNotEmpty() + workspaceId: string; +} diff --git a/src/modules/task-manager/dto/project/update-project.dto.ts b/src/modules/task-manager/dto/project/update-project.dto.ts new file mode 100644 index 0000000..df437f1 --- /dev/null +++ b/src/modules/task-manager/dto/project/update-project.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/swagger'; +import { CreateProjectDto } from './create-project.dto'; + +export class UpdateProjectDto extends PartialType(CreateProjectDto) {} \ No newline at end of file diff --git a/src/modules/task-manager/entities/project.entity.ts b/src/modules/task-manager/entities/project.entity.ts index a4e761b..890870c 100644 --- a/src/modules/task-manager/entities/project.entity.ts +++ b/src/modules/task-manager/entities/project.entity.ts @@ -17,6 +17,9 @@ export class TMProject extends BaseEntity { @Column({ type: "timestamptz", nullable: true }) startDate: Date; + @Column({ type: "text", nullable: true }) + backgroundPicture: string; + // --- Relations --- @ManyToOne(() => TMWorkspace, (workspace) => workspace.projects, {