You are on page 1of 3

Web Developer Recruitment – Preliminary Test 2021

(Laravel)

Your Task
1. Develop a set of API endpoints, listed under User Stories below
a. Your code must be hosted on Github, or any other similar services that
are publicly accessible
2. Your code should contain a README.md that includes the instruction for
running local instance of your server; we need to be able to run and test
your solution locally
3. Please use Laravel/Lumen for the backend code
4. Please use PostgreSql as the database
5. Please use an ORM or query builder

Assessment Criteria
1. We will assess your submission based on the following:
a. Readability and code cleanliness
b. Code structure/design
c. Normalised database design
d. Input validation
2. Your API will be subjected to automated test tools, so please follow the
specs closely

Page 1 of 2
User Stories
1. As an Admin, I should be able to create user(s) so that I can added product to
koli

 Endpoint: POST /api/register


 Headers: Content-type: application/json
 Success response status: 204 No Content

Example Request
{
Users: [“example1@email.com”,”example2@email.com”]
}

2. As an Admin, I should be able to put in item(s) to koli under user so that they
know their existing item

 Endpoint: POST /api/putin


 Headers: Content-type: application/json
 Success response status: 204 No Content

Example Request
{
user: “example1@email.com”,
koli: “Power Tools”,
item: [{name: “Impact Wrench”, qty: “2 unit”}, { name: “Electric Screwdriver”,
qty: “10 unit”}, { name: “Rotary Tool”, qty: “4 unit” }, { name: “Jigsaw”, qty:
“34 unit” } ]
}

3. As an Admin, I should be able to remove item(s) from user and koli so that their
list are updated

 Endpoint: POST /api/takeout


 Headers: Content-type: application/json
 Success response status: 204 No Content

Example Request
{
user: “example1@email.com”,
koli: “Power Tools”,
item: [{ name: “Rotary Tool”, qty: “10 unit” }, { name: “Jigsaw”, qty: “7
unit” }]
}

4. As an Admin, I should be able to list all common koli of 2 users (e.g. if 2


users has “Power Tools” and “Cable” as common koli, I should be able to see it
in a list)

 Endpoint: GET /api/koli/common


 Headers: Content-type: application/json
 Success response status: 200

Example Request
{
user: [“example1@email.com”, “example2@email.com”]
}

Example Response
{
koli: { “Power Tools”, item: [{ name: “Rotary Tool”, qty: “10 unit” }, { name:
“Jigsaw”, qty: “7 unit” }]},
“koli”: {“Cable”, item: [{name: “Lotusku”, qty: “5 roll”]
}
__Thank You__

Page 2 of 2

You might also like