diff --git a/src/modules/task-manager/dto/attachment/create-attachment.dto.ts b/src/modules/task-manager/dto/attachment/create-attachment.dto.ts new file mode 100644 index 0000000..dcca8d4 --- /dev/null +++ b/src/modules/task-manager/dto/attachment/create-attachment.dto.ts @@ -0,0 +1,26 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsNotEmpty, IsUUID, IsEnum, MaxLength } from "class-validator"; +import { TMAttachmentType } from "../../enums/attachment-type.enum"; + +export class CreateAttachmentDto { + @ApiProperty({ description: "Title of the attachment", example: "Project Requirements Doc" }) + @IsString() + @IsNotEmpty() + @MaxLength(150) + title: string; + + @ApiProperty({ description: "Type of the attachment", enum: TMAttachmentType, example: TMAttachmentType.FILE }) + @IsEnum(TMAttachmentType) + @IsNotEmpty() + type: TMAttachmentType; + + @ApiProperty({ description: "File URL or path of the attachment", example: "https://cdn.example.com/files/requirements.pdf" }) + @IsString() + @IsNotEmpty() + file: string; + + @ApiProperty({ description: "ID of the task this attachment belongs to", example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }) + @IsUUID() + @IsNotEmpty() + taskId: string; +} diff --git a/src/modules/task-manager/dto/attachment/update-attachment.dto.ts b/src/modules/task-manager/dto/attachment/update-attachment.dto.ts new file mode 100644 index 0000000..977fed9 --- /dev/null +++ b/src/modules/task-manager/dto/attachment/update-attachment.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from "@nestjs/swagger"; +import { CreateAttachmentDto } from "./create-attachment.dto"; + +export class UpdateAttachmentDto extends PartialType(CreateAttachmentDto) {}