Project URL - https://zencar.herokuapp.com/ PLEASE USE GOOGLE CHROME TO TEST
*** Superadmin ***
username: superadmin@abc.com
password: password
*** Admin ***
username: admin@admin.com
password: password
PLEASE DON'T CHANGE THESE CREDENTIALS. If you want to test update password functionality, please unsure you change the passwords back to these preconfigured password. This will enable other peers as well to review our work.
- Click on 'sign up' on the homepage
- Enter details, and click 'sign up'
- Click on 'Edit profile' on the nav bar, top right
- Enter details, and click 'update'
- Current password is asked while updating details, for security purpose
- Click on 'Edit profile' on the nav bar, top right
- Click 'Cancel my account'
- Confirm delete action by clicking 'Yes' on the popup
- On the homepage, you will see a search bar. To view list of all cars, perform an empty search i.e. just click search without any filers
- Search for the car from search bar. The result will contain all attributes of the car.
- You can book any car, by clicking on "Reserve" button
- Note that a car may be reserved for a particular time, which is why it's status is "Reserved". But you can still book it for other time period. You can check for what time period car is available, by clicking on "Check Availability" button
- You can "Reserve" a car for a minimum of 1 hour, and maximum of 10 hours. Also, you cannot book a car more than 7 days in advance. These validation are being done.
- You cannot have more than 1 reservation at a time.
Screenshot
- Once you reserve a car, on your homepage you will see a "checkout" button. Similarly, once you check out the car, on the same place you will see an option to "return" the car
- Note that since reservation should be minimum 1 hour, if you return before 1 hour you will be charged for one hour.
- After successfully returning the car, you will see your total fee for previous successful rental displayed on the homepage
- On the homepage, you can check this by clicking "Order History"
Screenshot
- There's no separate login page, use the homepage form and above mentioned credentials.
- To edit, click on 'Edit profile' on the nav bar, top right
- Enter details, and click 'update'
- Current password is asked while updating details, for security purpose
- On the homepage, you will see "ADMINS" heading, that contains a list of all admins.
- You can create a new admin by clicking on"New Admin" button, and selecting the check box for admin flag.
- You can view and edit any admin. Also, you can delete other admins (except yourself)
- On the homepage, you will see "SUPERADMINS" heading, that contains a list of all superadmins.
- You can only view superadmins, neither edit nor delete them.
- On the homepage, you will see "CARS" heading, that contains a list of all cars.
- You can add a new car by clicking on "New Car" button, and entering appropriate details. Validations have ben done for this form, such as license plate number should be a 7-digit unique string.
- To view attributes of a car, click on "Show". You can also view the checkout history of a car by clicking on the "Show car history" button, that also displays user email for a particular reservation.
- To edit attributes of a car, click on "Edit" button on the homepage.
- To delete a car, click "Destroy". Note that you cannot delete resrerved or checked out car. Also, deleting any existing car will remove all its entries from reservation history.
- To change status of a car, you can reserve on behalf of the customer by searching for the car via search bar, and then clicking "Reserve". You will need to enter exact email id of the customer to book on his behalf.
- On the homepage, you will see "CUSTOMERS" heading, that contains a list of all customers.
- You can view all customer attributes, except password, by clicking on "Show"
- To view checkout history of customer, click on "Show" then "Order history"
- To delete, click on "Destroy". Note that you cannot delete a customer with an active reservation. Also, deleting any existing customer will remove all its entries from reservation history.
- On the homepage, you will see "RESERVATIONS" heading, that contains a list of all reservation.
- To checkout or return on behalf of the customer, you first need to check which customer does the reservation belong to. Then go his profile and you will see a "Check out" or "Return" button.
- You can edit or delete any reservation from this list.
- The system will cancel a reservation if customer doesn't check out a car in time with 30 minutes elasticity. The corresponding car can then be booked for that time slot.
- The system will return a car on behalf of customer, if he doesn't return on the specified time.
- Thoroughly tested car model and car controller. Unit test module for the same can be found here
test/unit/car_test.rb
- You can suggest a new car to be added to the system, by clicking on the "Provide car recommendation" button on the homepage. This will trigger a request sent to the admin, who can either approve or deny the request. Admin can also change the attributes of the recommended car.
Things you may want to cover:
-
Ruby version - 2.4.1p111
-
Rails version - 5.1.4
-
System dependencies - run 'bundle install' to install all the dependencies
-
Configuration
-
Database creation - using Postgre sql
-
Database initialization - an admin has to be created using rails console on the server
-
How to run the test suite - Run the following commands
rails db:test:prepare
rails test test/unit/car_test.rb
-
Services (job queues, cache servers, search engines, etc.) - It uses rails cron jobs to change the status of Reserved Car to Available when not checked out without half an hour of the said 'check out time'
-
Deployment instructions - Code is deployed to Heroku server from the Master branch of GIT