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 contractor, I should be able to delete equipment, so that I can remove old or inconsistent equipment entries #68

Open arafaysaleem opened 3 years ago

arafaysaleem commented 3 years ago

Summary

As a contractor, I should be able to delete equipment, so that I can remove old or inconsistent equipment entries.

Acceptance Criteria

GIVEN a contractor is deleting an equipment in the desktop app WHEN the app hits the equipment/:id endpoint with a valid DELETE request, containing the path parameter:

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 deleted successfully"
}
body: {}

Resources

Dev Notes

{Some complementary notes if necessary}

Testing Notes

Scenario 1: DELETE request is successful:

  1. Create a new equipment with a POST request to /equipment endpoint.
  2. With the id returned from the POST, make a DELETE request to /equipment/:id endpoint.
  3. A subsequent GET request to /equipment/:id endpoint should return a 404 not found status code.

Scenario 2: DELETE request is forbidden:

  1. Make a DELETE request to /equipment/:id endpoint using a inspector account token.
  2. Ensure the endpoint returns a 403 forbidden status code.