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 get all equipment, so that I can rent them in milestones #64

Open arafaysaleem opened 3 years ago

arafaysaleem commented 3 years ago

Summary

As a contractor, I should be able to get all equipment, so that I can rent them in milestones.

Acceptance Criteria

Scenario 1: Search for all possible equipment

GIVEN an contractor is requesting all possible equipment in the desktop app WHEN the app hits the /equipment endpoint with a valid GET request 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: "..."
}
body: [
    {
        eq_id: 0,
        eq_type: "heavy_vehicle"
        equipment: "extractor"
    },
    {
        eq_id: 1,
        eq_type: "machinery"
        equipment: "generator"
    },
    {
        eq_id: 2,
        eq_type: "tools"
        equipment: "shovels"
    },
    ....
]

Scenario 2: Search for all equipment by equipment type

GIVEN an contractor is requesting all equipment for an equipment type in the desktop app WHEN the app hits the /equipment endpoint with a valid GET request containing the query parameters:

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

Sample Request/Sample Response For query parameter eq_type=heavy_vehicles:

headers: {
    error: 0,
    message: "..."
}
body: [
    {
        eq_id: 0,
        equipment: "extractor"
        eq_type: "heavy_vehicles"
    },
    {
        eq_id: 0,
        equipment: "backhoe"
        eq_type: "heavy_vehicles"
    },
    ....
]

Resources

Dev Notes

This endpoint is going to be accessible and work the same way for the product owner as well.

Testing Notes

{notes for QA, with examples if applicable}