From e1c9361d1522d09f0f119b4f1dcbb192cfbd773f Mon Sep 17 00:00:00 2001 From: Hamilton LaPides Date: Mon, 13 Apr 2026 18:48:33 -0400 Subject: [PATCH 1/2] added check to enforce start date --- src/backend/src/services/tasks.services.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/src/services/tasks.services.ts b/src/backend/src/services/tasks.services.ts index 1f1b3b9bf5..462ccdcd2b 100644 --- a/src/backend/src/services/tasks.services.ts +++ b/src/backend/src/services/tasks.services.ts @@ -94,6 +94,10 @@ export default class TasksService { if (!isUnderWordCount(title, 15)) throw new HttpException(400, 'Title must be less than 15 words'); if (!isUnderWordCount(notes, 250)) throw new HttpException(400, 'Notes must be less than 250 words'); + if (startDate && deadline && startDate > deadline) { + throw new HttpException(400, 'Start date must be before or on the same day as the deadline') + } + if (status === 'IN_PROGRESS' && (!deadline || assignees.length === 0)) { throw new HttpException(400, 'Tasks in progress must have a dealine and assignees'); } From ea415b14f789f78d149024a5995334eb62204e7d Mon Sep 17 00:00:00 2001 From: Hamilton LaPides Date: Fri, 17 Apr 2026 11:20:45 -0400 Subject: [PATCH 2/2] Applied prettier code --- src/backend/src/services/tasks.services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/src/services/tasks.services.ts b/src/backend/src/services/tasks.services.ts index 462ccdcd2b..68d07ed24e 100644 --- a/src/backend/src/services/tasks.services.ts +++ b/src/backend/src/services/tasks.services.ts @@ -95,7 +95,7 @@ export default class TasksService { if (!isUnderWordCount(notes, 250)) throw new HttpException(400, 'Notes must be less than 250 words'); if (startDate && deadline && startDate > deadline) { - throw new HttpException(400, 'Start date must be before or on the same day as the deadline') + throw new HttpException(400, 'Start date must be before or on the same day as the deadline'); } if (status === 'IN_PROGRESS' && (!deadline || assignees.length === 0)) {