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¶
- User opens the task creation form and fills in
title, optionallydescription,status(defaults toTODO), anddueDate. - User submits the form.
- System validates the input against BR-001, BR-002, BR-003, BR-004, BR-006.
- System creates a new
Taskwith the provided fields, assigns an auto-generatedid, and recordscreatedAt. - System persists the
Taskin the database. - System responds with HTTP 201 and the persisted
Task(includingidandcreatedAt). - System displays the new task in the task list.
Extensions (Alternate Flows)¶
3a. Title is blank (BR-001 violated):
- System returns HTTP 400 with error code
TASK_TITLE_REQUIRED. - UI displays the error message on the title field.
- Use case ends in failure; no
Taskis created.
3b. Title exceeds 100 characters (BR-002 violated):
- System returns HTTP 400 with error code
TASK_TITLE_TOO_LONG. - UI displays the error message on the title field.
- Use case ends in failure.
3c. Description exceeds 500 characters (BR-003 violated):
- System returns HTTP 400 with error code
TASK_DESCRIPTION_TOO_LONG. - UI displays the error message on the description field.
- Use case ends in failure.
3d. Due date is not a valid date (BR-006 violated):
- System returns HTTP 400 with error code
TASK_DUE_DATE_INVALID. - UI displays the error message on the due date field.
- 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.