-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Describe the story
Add a create task API endpoint which will use Lambda to save a new task item into the DynamoDB table.
Requirements
- Should use a DTO to model the create task request body.
- Create task DTO has the following attributes:
title- required. max length 100detail- optional. max length 1000dueAt- optional. ISO8601 timestampisComplete- optional. boolean. default isfalse
- Should validate the DTO and return status 400 if invalid.
- Should set
createdAtwhen item is saved. - Should set the
pkvalue when item is saved. - Should return the full saved
Taskwith status 201 when successful.
Additional requirements
- Create or update unit tests
- Review and update project documentation if needed for new configuration or infrastructure
Acceptance criteria
GIVEN a client sends a request to POST /tasks
WHEN the API Gateway receives this request
THEN the API Gateway sends the request to the create task Lambda function
GIVEN the create task Lambda function receives a request
WHEN the request validation fails
THEN the function returns status 400 with an error message describing the problem
WHEN the request validation succeeds
THEN the function saves the task in the DynamoDB table
AND returns status 201 with the created Task in the response body
WHEN the request fails for any other reason
THEN the function returns status 500 with an error message describing the problem
Additional context
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request