Skip to content

Update endpoint #6

@mwarman

Description

@mwarman

Describe the story

Create an API endpoint backed by a Lambda function which allows an item, i.e. a Task, to be updated.

Requirements

  • The endpoint signature is PUT /tasks/{taskId}
  • The request body should contain:
    • title - required. string. max length 100.
    • detail - optional. string. max length 1000.
    • dueAt - optional. ISO8601 timestamp.
    • isComplete - required. boolean.
  • The request body should be modeled as a DTO
  • The request should be validated
  • If detail or dueAt are not present in the request, they should be removed from the DynamoDB item
  • If the item is successfully updated, return the updated Task and status code 200
  • If the request is not valid, return status code 400 and a meaningful message
  • If the task is not found, return status code 404
  • If any other error occurs, return status code 500 and a meaningful message
  • Update the project infrastructure
  • Update the project documentation such as configuration or infrastructure as needed based upon the updates to the project.

Acceptance criteria

GIVEN the update endpoint is called
WHEN the system updates the Task successfully
THEN the system returns the Task as JSON
AND returns status code 200

WHEN the request validation fails
THEN the system returns status code 400
AND the response body contains a meaningful message

WHEN the Task is not found
THEN the system returns status code 404

WHEN the update fails
THEN the system returns status code 500
AND the response body contains a meaningful message

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions