Skip to content

UC001: Create Task

Overview

Property Value
ID UC001
Level User Goal
Primary Actor User
Trigger User submits the "Create Task" form in the web UI.
Precondition The task form is open and the User has filled in at least a title.
Success Guarantee A new Task exists in the system with the provided data and status TODO.
Related Rules BR-001, BR-002, BR-003, BR-004, BR-006
Related Feature features/UC001-create-task.feature

Goal

The User wants to add a new Task to their task list so they can track a unit of work. The system stores the task and returns it with its auto-generated ID and creation timestamp. This use case does not assign the task to anyone or trigger any notifications.

Main Success Scenario

  1. User opens the task creation form and fills in title, optionally description, status (defaults to TODO), and dueDate.
  2. User submits the form.
  3. System validates the input against BR-001, BR-002, BR-003, BR-004, BR-006.
  4. System creates a new Task with the provided fields, assigns an auto-generated id, and records createdAt.
  5. System persists the Task in the database.
  6. System responds with HTTP 201 and the persisted Task (including id and createdAt).
  7. System displays the new task in the task list.

Extensions (Alternate Flows)

3a. Title is blank (BR-001 violated):

  1. System returns HTTP 400 with error code TASK_TITLE_REQUIRED.
  2. UI displays the error message on the title field.
  3. Use case ends in failure; no Task is created.

3b. Title exceeds 100 characters (BR-002 violated):

  1. System returns HTTP 400 with error code TASK_TITLE_TOO_LONG.
  2. UI displays the error message on the title field.
  3. Use case ends in failure.

3c. Description exceeds 500 characters (BR-003 violated):

  1. System returns HTTP 400 with error code TASK_DESCRIPTION_TOO_LONG.
  2. UI displays the error message on the description field.
  3. Use case ends in failure.

3d. Due date is not a valid date (BR-006 violated):

  1. System returns HTTP 400 with error code TASK_DUE_DATE_INVALID.
  2. UI displays the error message on the due date field.
  3. Use case ends in failure.

Transaction Boundary

Single DB transaction covering validation → create → save of the Task aggregate. No distributed transaction required.

Sequence Diagram

BDD Scenarios

The feature file is the single source of truth for behaviour — it is also executed as an acceptance test. See features/UC001-create-task.feature.