cyntaria / ConstructionERP-Backend

A REST API backend system for the construction ERP software made with NodeJS
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

As a product owner, I should be able to update the details of a label, so that I can fix old or inconsistent labels #47

Open arafaysaleem opened 3 years ago

arafaysaleem commented 3 years ago

Summary

As a product owner, I should be able to update the details of a label, so that I can fix old or inconsistent labels.

Acceptance Criteria

GIVEN a product owner is editing a label in the desktop app WHEN the app hits the labels/:id endpoint with a valid PATCH request, containing:- The path parameter:

And any of the following body parameters:

THEN the app should receive a status 200 AND in the response, the following information should be returned:

Sample Request/Sample Response

headers: {
    error: 0,
    message: "The specified item was updated successfully"
}
body: {}

Resources

Dev Notes

{Some complementary notes if necessary}

Testing Notes

Scenario 1: PATCH request is successful

  1. Update a label with a PATCH request to /labels/:id endpoint
  2. A subsequent GET request to /labels/:id endpoint should return a status code 200 and the permission details with the updated information i.e. matching the initially sent body.

Scenario 2: PATCH request is forbidden

  1. Send a PATCH request to /labels/:id endpoint using a contractor account token.
  2. Ensure the response returns a 403 forbidden status code.