diff --git a/src/backend/src/services/tasks.services.ts b/src/backend/src/services/tasks.services.ts index 1f1b3b9bf5..68d07ed24e 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'); }