Cleaner Booking

Source: https://github.com/ricardoandrietta/cleaner_booking
and https://github.com/MasterHans/HomeWork (better!)

Installation:

  1. Clone the app

     
  2. Go to the new directory ‘cleaner_booking’ then use composer to install the dependencies

     
  3. Here i use sqlite (pls see /config/database.php file) as a default database

    and here is the configuration in the same file.

    The database ‘homework_database.sqlite’ in /database/ directory!
    NOTE: To open .sqlite file manually, I need to install ‘sqlitebrowser’ (ref:http://askubuntu.com/questions/805219/how-to-properly-view-a-sqlite-file-using-sqlite)

    The application menu in Programming -> SQLite database browser
  4. Modify the files permission in /storage/ and /bootstrap/ AND ALSO /database (because it need to update the sqlite database!) directories

    OR I CAN MODIFY /config/database.php on the ‘connection’ like this:

    Change ‘database_path’ to ‘storage_path’ (ref: http://stackoverflow.com/questions/30382554/sqlite-unable-to-open-database-file-laravel-windows)
  5. Test the app (refer to the below errors if exist!) http://localhost/works/laravel/cleaner_booking/public/cleaner-booking-frontand http://localhost/works/laravel/HomeWork/public/homehomework-frontFor registering an user: http://localhost/works/laravel/cleaner_booking/public/register. use user: ‘Admin’, email: ‘advcha@yahoo.com’ and password: ‘admin123’
    Admin Customer: http://localhost/works/laravel/HomeWork/public/admin/customer
    Admin Cleaner: http://localhost/works/laravel/HomeWork/public/admin/cleaner
    Admin Booking: http://localhost/works/laravel/HomeWork/public/admin/booking
    Admin City: http://localhost/works/laravel/HomeWork/public/admin/city
    Admin Time selection: http://localhost/works/laravel/HomeWork/public/admin/time-gaps
  6. Errors:

    Solution:
    I’ve tried many suggestion from here: https://www.digitalocean.com/community/questions/how-to-enable-extension-pdo-in-ubuntu-14-04. I checked if php5-mysql package is installed or not

    It’s installed. From this link https://www.drupal.org/docs/7/system-requirements/what-is-pdo, I modified my php.ini (sudo gedit /etc/php/5.6/apache2/php.ini), I added these two lines

    Then I checked my php info in http://localhost/info.php. The PDO MySQL is exist! But The above error still persist!.
    This link http://stackoverflow.com/questions/2852748/pdoexception-could-not-find-driver?rq=1 finally make it works. I need to install sqlite and php5-sqlite (for php 5.6) or php-sqlite3 (for php7)

    Check phpinfo, PDO SQLITE (pdo_sqlite) should be existed!
    Restart Apache server!

    Another error when trying to register: http://localhost/works/laravel/HomeWork/public/register

    Solution:

    BUT GOT ANOTHER ERROR:

    Solution: see #4 –> modify /database/ permission or modify /config/database.php
    Also modify .env file and remove ‘DB_…’ related setting but change

     

  7. TASK SUMMARY!
    For https://github.com/MasterHans/HomeWork
    Summary
    We are a local home cleaning company called Homework. Today we are keeping track of all our bookings using a spreadsheet and we want to move it into a web application. Our main goal with this project is to make it possible for customers to schedule a booking online. I’ve already created the scaffolding of the app for you and now I need you to add some functionality to it. This should take you about 1-2 hours, but you have up to 4 hours to complete it.
    Deliverables
    1. All models and columns should have validation as described in the model spec below, plus any common-sense validation you’ll put on new models.
    2. We need to split the site in to Admin-only and Customer-only. Right now all the admin functionality is exposed to the world.
    3. Currently we operate in 10 cities, but plan to expand quickly. We need a way to admin the list of cities we operate in and the ability to add to the list. You should create a new table to do this.
    4. On the admin cleaner form we need a way to select the cities a cleaner works in. This should be a checkbox list populated by the list of the cities we operate in. You may need to create a new table to store this data.
    5. We need a way for customers to signup and schedule a booking all on one form. To accomplish this you will need to do the following:
    – Make the site root a customer-facing form designed for customers to sign up and book a cleaner.
    – On this form, capture all the data needed to create a customer in the database (first name, last name, phone number).
    – If the customer already exists in the database (use phone number to determine this) use the existing record instead of creating a new one. You should probably add a validation to enforce this.
    – Let the customer select what city they are in from the cities table created earlier.
    – Let the customer specify a date and time when they would like their house cleaned.
    – When the user submits the form, look for cleaners that work in the specified city that do not have any bookings that conflict with the time specified.
    – If you can find an available cleaner, create the booking and display the name of the cleaner assigned to the booking.
    – If you can’t find an available cleaner, tell the user that we could not fulfill their request.
    6. Write tests for the parts of the application you feel need it the most.
    7. When you are done, please zip up the entire root directory including your SQLite database and vendor files — do not cherry-pick folders.
    Restrictions
    1. Do NOT switch the database from SQLite to MySQL.
    2. If you create a password-protected account, use credentials “admin@admin.com” and password “admin”.Existing Models
    1. customer
    – first_name (required)
    – last_name (required)
    – phone_number (optional)
    2. booking
    – customer (required, enforce referential integrity)
    – cleaner (required, enforce referential integrity)
    – date (required)
    3. cleaner
    – first_name (required)
    – last_name (required)
    – quality_score (required, must be a number between 0.0 and 5.0)

    Setup
    https://github.com/prehire/php-23093023909ad09a09
    For https://github.com/ricardoandrietta/cleaner_booking.
    Summary
    The following deliverables are not required but are nice-to-haves. If you choose to implement them, it should take around 1 hour but you must complete this section within 3 hours. You can complete any number of the bonus deliverables: you don’t need to complete all of them.Bonus Deliverables
    1. Use a free theme to make the application look a little better, especially the pages seen by our customers.
    2. Add security to the admin pages on our site. Customers and cleaners do not need to be able to login at the moment.
    3. The cleaner form should have one additional field: ’email’
    o Email should be required
    0 Check that it is a valid email address
    4. When a new booking is created, email the cleaner with information on the booking and customer.
    5. The Customer Show view should show all associated bookings below the form and link to them.
    6. The Cleaner Show view should show all associated bookings below the form and link to them.
    7. When you are done, please zip up the whole app directory with dependencies and upload it below.

Leave a Reply

Your email address will not be published. Required fields are marked *