Coder Social home page Coder Social logo

mini-bookingsync-api's Introduction

README

RESTful JSON API with 2 endpoints: Rentals and Bookings with full CRUD.

Rental is something that you can book for a particular period of time (like a vacation villa or a hotel) and Booking is a reservation for given Rental for a particular period of time.

The API is authenticated by a token (hardcoded in ApplicationController).

Rental has name attribute, daily_rate attribute and has many bookings.

Booking has start_at and end_at datetime attributes which indicate the time period of the reservation, client_email attribute, just to know for whom it is supposed to be and price attribute, which will be the price for this booking.

Price calculation for the booking : only daily_rate is considered when calculating the price. If the rental's daily_price is equal to 100, the booking's price for 3 days should be equal to 300, for 5 days it should be 500 etc.

All attributes for both Rentals and Bookings are required.

Other validations:

  • the dates for bookings don't overlap
  • the price for given period is valid when creating a booking
  • the reservation should be possible for at least one night / day stay

Setup the Application

bundle install

rake db:setup

How to run the test suite

rspec spec

mini-bookingsync-api's People

Stargazers

 avatar

Watchers

James Cloos avatar Shardul Bhatt avatar Parth Barot avatar ParthivPatel-BTC avatar NishantUpadhyay-BTC avatar  avatar Ankur Vyas avatar Santosh Sharma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.