MindFlow’s Task Module gives each student a private workspace for their academic workload. Every task is owned by the authenticated student — the JWT in the request identifies the owner, and the service enforces that ownership on every operation. Attempting to read, update, or delete a task that belongs to another student returnsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/J0S3-LEON/pf_pruebasAseguramientoCalid_SDD/llms.txt
Use this file to discover all available pages before exploring further.
403 Forbidden without revealing whether the task exists. Tasks are never permanently removed from the database; deletion is always logical, preserving the audit trail of any micro-objectives that were generated during EMA sessions.
Student-scoped task CRUD
All task operations extract thestudentId from the verified JWT payload attached to request.user by the global JwtAuthGuard. The service then filters every database query by that studentId, so students can only ever see and modify their own data.
Create
POST /api/v1/tasks — creates a new task with a name, optional description, and an ISO 8601 deadline.List
GET /api/v1/tasks — returns all active (non-deleted) tasks sorted by deadline ascending, with their active micro-objectives included.Update
PATCH /api/v1/tasks/:taskId — partially updates a task. All fields are optional; only the provided fields are changed.Soft delete
DELETE /api/v1/tasks/:taskId — sets is_deleted = true on the task and is_audit_only = true on all linked micro-objectives.Creating a task
Send aPOST request to /api/v1/tasks with the task details. The name and deadline fields are required.
Request body
| Field | Type | Required | Rules |
|---|---|---|---|
name | string | ✅ Yes | Non-empty, maximum 255 characters |
description | string | No | Optional free-text description |
deadline | string | ✅ Yes | ISO 8601 UTC timestamp (e.g. "2025-08-01T23:59:00Z") |
Listing tasks
GET /api/v1/tasks returns all active tasks for the authenticated student, sorted by deadline in ascending order. Each task object includes its active micro-objectives (those with isAuditOnly = false).
Updating a task
PATCH /api/v1/tasks/:taskId applies a partial update. Only the fields included in the request body are changed; all other fields are left unchanged.
Soft delete
DELETE /api/v1/tasks/:taskId marks the task as deleted without removing any data. Both operations happen atomically inside a database transaction:
is_deleted = trueis set on the task record.is_audit_only = trueis set on all associated micro-objectives.
204 No Content on success.
Micro-objectives sub-resource
Micro-objectives are generated automatically by the Task Decomposer when a student’s fatigue score is ≥ 4. They are accessible through the task sub-resource endpoints below.List micro-objectives
isAuditOnly = false) for the specified task, ordered by creation time ascending. Returns 403 if the task belongs to another student, 404 if the task does not exist.
Mark a micro-objective complete
{ "isCompleted": true } in the request body to mark a micro-objective as done. The dashboard reflects this change within 2 seconds.
Ownership and access control
The Task Service verifies ownership on every mutating operation. If thestudentId extracted from the JWT does not match the studentId stored on the task record, the service throws a ForbiddenException and the API Gateway responds with 403 Forbidden — without disclosing that the task exists for another student.
Validation errors
The globalValidationPipe enforces the DTO rules before the request reaches the service layer. Validation failures return 422 Unprocessable Entity with a field-level error message.
| Condition | Status |
|---|---|
name is missing or empty | 422 Unprocessable Entity |
deadline is not a valid ISO 8601 string | 422 Unprocessable Entity |
name exceeds 255 characters | 422 Unprocessable Entity |
| Task belongs to a different student | 403 Forbidden |
| Task ID does not exist | 404 Not Found |