# Bike Rental

# Objective

We will build a simple Bike rental application. In which a user can register and rent a bike based on bike type from any available location. Later user will return the bike at any of the available locations after which the charges can be paid. Charges are calculated on the bike type and duration for which the bike was rented. Any given user can rent a maximum of 3 bikes simultaneously. Admin will manage the available locations, bikes, number of bikes available in each location.

The application has the following requirements:

  • A user can register
    • condition: phone number and email of the user should be unique
  • Registered user can rent a bike from a particular location
    • condition: email of that user should exist
    • condition: selected bike type should exist
    • condition: selected pickup location should exist
    • condition: bike, bike type should be available at the pickup location
    • condition: user should not have more than 3 ongoing rentals
  • After renting user can return the bike
    • condition: email of that user should exist
    • condition: selected drop location should exist
    • condition: user should have ongoing rental.
    • condition: bike id must exist and user should have rented that bike
  • User should be able to pay the rental charge
    • condition: user should exist
    • condition: amount should be valid
    • condition: bike must exist and user should have rented and returned that bike
  • Bike type can be added
    • condition: bike type can be added only once
  • Bike of a particular bike type can be added
    • condition: bike id should be unique, bike type should exist
  • Bikes can be added to a location
    • condition: bike id must exist
    • condition: location must exist
    • condition: bike can be added to a location only once
  • A Location can be added.
    • condition: a location can only be added once
  • Bikes can be moved from one location to another.
    • condition: from and to locations must exist and should be different
    • condition: bike should exist and should be available in that location
    • conditoin: bike should not be rented