A reservation module that allows users to select dates to reserve for a stay at a location in the Relaxly app.
- https://github.com/Relax-ly/Header-images
- https://github.com/Relax-ly/reviews-service
- https://github.com/Relax-ly/related-homes
From within the root directory:
npm installAll occurs from within the root directory:
-go to reservation-services/db/index.js to change mysql password
Create mysql tables
mysql -u root -p < ./db/schema.sqlSeed your database with seeding script:
npm run seedBuild react app with script:
npm run react-devRun server:
npm run server-devGo to url http://localhost:3000/ to view app
Post check in/check out dates, price, and guest info for specific home.
POST location/:id/reservations{
"id": 1
"checkin_date": "2020-01-03T08:00:00.000Z"
"checkout_date": "2020-01-19T08:00:00.000Z"
"adults": 4
"children": 0
"infants": 1
"price": 1152
"locationId": 1
}Get rate, review average, total reviews, service fee, and occupancy tax for specific home.
GET /location/:id{
"id": 1
"rate": 72
"review_avg": 3.39
"total_review": 143
"service_fee": 8
"occupancy_tax": 7
}Get check in/check out dates, price, and guest info for specific home.
GET location/:id/reservations{
"id": 1
"checkin_date": "2020-01-03T08:00:00.000Z"
"checkout_date": "2020-01-19T08:00:00.000Z"
"adults": 4
"children": 0
"infants": 1
"price": 1152
"locationId": 1
}Update check in/check out dates, price, and guest info for specific home.
PUT location/:id/reservations/:idOnly fields requested will be updated. Price will be updated to reflect changes.
{
"id": 1
"checkin_date": "2020-01-03T08:00:00.000Z"
"checkout_date": "2020-01-19T08:00:00.000Z"
"locationId": 1
}{
"id": 1
"checkin_date": "2020-01-03T08:00:00.000Z"
"checkout_date": "2020-01-19T08:00:00.000Z"
"adults": 4
"children": 0
"infants": 1
"price": 1152
"locationId": 1
}Delete check in/check out dates, price, and guest info for specific home.
DELETE location/:id/reservations/:id{
"id": 1
"locationId": 1
}