From db61030b44c8e1c261b56c9e832a672535964f0d Mon Sep 17 00:00:00 2001 From: realrafi Date: Wed, 1 Jul 2026 16:16:39 +0330 Subject: [PATCH] feat: added check list item DTOs --- .../create-check-list-item.dto.ts | 20 +++++++++++++++++++ .../update-check-list-item.dto.ts | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 src/modules/task-manager/dto/check-list-item/create-check-list-item.dto.ts create mode 100644 src/modules/task-manager/dto/check-list-item/update-check-list-item.dto.ts diff --git a/src/modules/task-manager/dto/check-list-item/create-check-list-item.dto.ts b/src/modules/task-manager/dto/check-list-item/create-check-list-item.dto.ts new file mode 100644 index 0000000..8966881 --- /dev/null +++ b/src/modules/task-manager/dto/check-list-item/create-check-list-item.dto.ts @@ -0,0 +1,20 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { IsString, IsNotEmpty, IsUUID, IsBoolean, MaxLength } from "class-validator"; + +export class CreateCheckListItemDto { + @ApiProperty({ description: "Title of the check list item", example: "Write unit tests" }) + @IsString() + @IsNotEmpty() + @MaxLength(150) + title: string; + + @ApiProperty({ description: "Whether the check list item is done", example: false }) + @IsBoolean() + @IsNotEmpty() + isDone: boolean; + + @ApiProperty({ description: "ID of the task this check list item belongs to", example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }) + @IsUUID() + @IsNotEmpty() + taskId: string; +} diff --git a/src/modules/task-manager/dto/check-list-item/update-check-list-item.dto.ts b/src/modules/task-manager/dto/check-list-item/update-check-list-item.dto.ts new file mode 100644 index 0000000..c171e29 --- /dev/null +++ b/src/modules/task-manager/dto/check-list-item/update-check-list-item.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/swagger'; +import { CreateCheckListItemDto } from './create-check-list-item.dto'; + +export class UpdateCheckListItemDto extends PartialType(CreateCheckListItemDto) {} \ No newline at end of file