Backend Challenge
Introduction
As a software engineer in DZConseil team, you have to provide a reliable backend system to clients. Your task here is to implement a few features for a small Airbnb like rest api.
Requirement
We value a clean, simple working solution.
Good understanding for how git works.
Good understanding of REST API's.
No package should be added to the provided code.
Notes
Source code must be pushed as git branch in the provided project repository.
Your branch name should follow this scheme
challenge/lastname-firstname.CODE MUST NOT BE PUSHED AS PULL-REQUEST
Expectations
This challenge should take around 4 to 5 hours to complete.
All tests within your branch must pass.
Avoid over-engineering.
All responses should be in a JSON format.
Problem Statement

Following this diagram we want to implement a small api service that our frontend users can consume.
The reservation cost calculation methods
calculateCost()&calculateDiscount()should be implemented inListingmodel
Project Setup
In order to get a copy of this project on your machine you need to run the following command:
This will get you a copy of this project into a folder named dzconseil-challenge
Now you need to create a new branch to start working on, run the following command :
You will notice that we provided you with the project skeleton with almost everything included (routes, models , migration, factories, controllers, requests, resources, tests) all you need to do is to fill in the missing logic's and run the tests.
All tests within this project should pass before you push your code.
Endpoints
Show all listings
Request
URI :
/api/listingsMethod :
GET
Response
Status :
200Body :
Show a listing
Request
URI :
/api/listings/:uuidMethod :
GET
Response
Status :
200Body :
Create a new listing
Request
URI :
/api/listingsMethod :
POSTBody :
Response
Status :
201Body :
Update a listing
Request
URI :
/api/listings/:uuidMethod :
PUTBody:
Response
Status :
200Body :
Delete a listing
Request
URI :
/api/listings/:uuidMethod :
DELETE
Response
Status :
200Body :
Questions? Suggestions? We love to hear from you: [email protected]
Last updated
Was this helpful?