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 possible roles, so that I can assign one while creating a person/laborer account #33

Open arafaysaleem opened 3 years ago

arafaysaleem commented 3 years ago

Summary

As a contractor, I should be able to get all possible roles, so that I can assign one while creating a person/laborer account.

Acceptance Criteria

Scenario: Search for all possible roles

GIVEN an contractor is requesting all possible roles in the desktop app WHEN the app hits the /roles 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: [
    {
        role_id: 0,
        role: "contractor"
        role_type: "app_user"
    },
    {
        role_id: 5,
        role: "plumber"
        role_type: "laborer"
    },
    ....
]

Scenario: Search for all roles by role type

GIVEN an contractor is requesting all roles for a role type in the desktop app WHEN the app hits the /roles 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 role_type=app_user:

headers: {
    error: 0,
    message: "..."
}
body: [
    {
        role_id: 0,
        role: "contractor"
        role_type: "app_user"
    },
    {
        role_id: 5,
        role: "inspector"
        role_type: "app_user"
    },
    ....
]

Resources

Dev Notes

{Some complementary notes if necessary}

Testing Notes

{notes for QA, with examples if applicable}