-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Description
An endpoint at /taskmaster/tasks
that accepts POST requests with a request body that can mapped to a TaskRequestPayload
should be created to allow for new task creation and persistence. The TaskRequestPayload
DTO is used for validation (most of which is already implemented using Validation API annotations) and exposes a method that returns a valid Task
object. A random UUID should be generated and used to set the ID of the extracted Task
object, and it should then be persisted to the data source.
Acceptance Criteria
- Provided implementation that passes all tests within
TaskCreationIntegrationTest
- run with IDE or using
mvn clean test
within a terminal - use the argument
-Dspring.profiles.active=test
when running tests to run them under the correct profile
- run with IDE or using
- Commit messages are descriptive and provide adequate context to the work performed
- Code is well-formatted and unnecessary comments/unused imports are removed
Validation Constraints
- No id is expected in the payload for creation requests
- A title value is expected in the request payload for task creation
- Task titles must not be empty and no more than 50 characters long
- A description value is expected in the request payload for task creation
- Task descriptions must not be empty strings
- Task priority level must be in the inclusive range: 1 - 4
- Task point values must be in the inclusive range: 1 - 100
- Task due dates must be a date in the future
- At least one label string is expected in the request payload for task creation
- The provided
creatorId
and anyassigneeIds
must belong to a user in the data source (seeMockDataInserter
)- if a provided creator or assignee ID does not belong to a known user, an
UnprocessableEntityException
should be thrown (handler already implemented)
- if a provided creator or assignee ID does not belong to a known user, an
- Task state must be one of the following:
- "UNASSIGNED"
- "READY TO START"
- "IN PROGRESS"
- "FOR REVIEW"
- "DONE"
- "BLOCKED"
Example Payloads
Valid TaskRequestPayload
JSON without task assignee IDs:
{
"title": "Valid Task Title",
"description": "This is a valid task description.",
"priority": 4,
"pointValue": 5,
"dueDate": "2022-07-27",
"state": "UNASSIGNED",
"labels": [
"ready to start",
"valid",
"test"
],
"creatorId": "manager-user-id"
}
Valid TaskRequestPayload
JSON with task assignee IDs:
{
"title": "Valid Task Title",
"description": "This is a valid task description.",
"priority": 4,
"pointValue": 5,
"dueDate": "2022-07-27",
"state": "UNASSIGNED",
"labels": [
"ready to start",
"valid",
"test"
],
"creatorId": "manager-user-id",
"assigneeIds": [
"dev-user-id",
"tester-user-id"
]
}
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers