feat: added attachment DTOs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from "@nestjs/swagger";
|
||||
import { CreateAttachmentDto } from "./create-attachment.dto";
|
||||
|
||||
export class UpdateAttachmentDto extends PartialType(CreateAttachmentDto) {}
|
||||
Reference in New Issue
Block a user