Test project to implement some set of API's for an hospitality reservation booking system.
- Clone the repo.
- Make sure you have node and MySQL installed
- Install NPM packages
npm install
- Configure your environment. Run the command below to make an env file
npm run env:copy
- Update the env file with the config as stated
- Run database migrations
npm run migrate
- Run database seeds
npm run seed all
- Run the command below to start the project
npm run dev
Kindly create a database name carbon_hospitality_reservation_test
Run Test: npm run test
Run test coverage: npm run test:coverage
The API services is splitted into three feature components:
NOTE: {{serverUrl}} = {{baseUrl}}/api/v1/ e.g http://localhost:4000/api/v1
The customer's endpoint allows you create one, get all customers. more information on the endpoints below:
- Create Customer - POST
- Get All Customers - GET
- Get One Customer - GET
The rooms's endpoint allows you create one, get all rooms. more information on the endpoints below:
- Create Room - POST
- Get All Rooms - GET
- Get One Room - GET
The reservations's endpoint allows you create one, get all reservations. more information on the endpoints below:
- Create Reservation - POST
- Get All Reservations - GET (response includes computed overstay fees and hours)
- Get One Reservation - GET
- Checkin Reservation - PATCH
- Checkout Reservation - PATCH
All the endpoints both have the same response structure as described below:
{
"success": boolean, // true if everything goes well.
"message": string //description of the data,
"data": number | string | Array | object //data here can be string,array or object
}