The service provides a booking system to manage cleaners when the companies give a cleaning service to their clients.
PHP 7.3 or higher, Composer, SQL Database
To setup the project quickly follow the instructions below.
This project requires the composer package manager and 7.3
or greater versions of PHP
.
- To install the composer:
https://getcomposer.org/download/
- To install the
PHP
from official documentation:https://www.php.net/manual/en/install.php
git clone https://github.com/muratbaskicioglu/mop-masters.git
composer install
php bin/console doctrine:database:create
php bin/console make:migration
php bin/console doctrine:migrations:migrate
- Write auto generated sample data into
Company
andCleaner
tables by executing:
php bin/console doctrine:fixtures:load
symfony server:start
That's it. The API documentation can be found at: http://localhost:8000/api/doc
- All configurations below needs to be set inside
.env
file. Also, you can create.env.local
file to prevent remote changes.
Set your database connection:
DATABASE_URL=<database_connection_string>
You should set a timezone according to the a service area:
TIME_ZONE=Asia/Dubai
Provide time limits for service available hours to the Booking service:
BOOKING_DATE_FORMAT= # app's default date format(Y-m-d)
HOLIDAY_OF_WEEK_IN_NUMBER= # day of week for holiday(5)
BOOKING_TIME_FORMAT= # time format(H:i:s)
BOOKING_START_TIME_STRING= # service start time(08:00:00)
BOOKING_END_TIME_STRING= # end time 22:00:00
This service has a few endpoints to fetch cleaners info and previously created bookings, also make a new booking, and update them with new dates. The project already has an automatically generated API documentation but I will give below short explanation about services.
You can use /cleaners
with GET
to get a list of all cleaners.
Use /cleaners/{cleanerId}/unavailable-times
with GET
to get unavailable date times of specific cleaner.
Use /bookings
with POST
and booking detail parameters. You should specify which cleaners(cleanerIds
) you would book within a specified date
, startTime
, and duration
of the cleaning service.
You can use /bookings/{bookingId}
to update current booking date times and duration with giving same parameters.
Company Cleaner
+------+--------------+-----+ +------------+--------------+-----+
| id | int | PRI | | id | int | PRI |
| name | varchar(255) | | | company_id | int | MUL |
+------+--------------+-----+ | name | varchar(255) | |
+------------+--------------+-----+
Booking BookingAssignment
+------------+----------+-----+ +------------+------+-----+
| id | int | PRI | | id | int | PRI |
| start_date | datetime | | | cleaner_id | int | MUL |
| end_date | datetime | | | booking_id | int | MUL |
+------------+----------+-----+ +------------+------+-----+