create the necessary migrations and seeds for the given database schema and Business stories and user stories in Laravel
	CREATE TABLE `appointments` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `service_id` bigint(20) unsigned NOT NULL,
 `start_time` datetime NOT NULL,
 `client_count` int(11) NOT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
 KEY `appointments_service_id_foreign` (`service_id`),
 CONSTRAINT `appointments_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
bookings	CREATE TABLE `bookings` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `service_id` bigint(20) unsigned NOT NULL,
 `slots_id` bigint(20) unsigned NOT NULL,
 `customer_id` bigint(20) unsigned NOT NULL,
 `booking_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`booking_details`)),
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
 KEY `bookings_service_id_foreign` (`service_id`),
 KEY `bookings_slot_id_foreign` (`slots_id`),
 KEY `bookings_customer_id_foreign` (`customer_id`),
 CONSTRAINT `bookings_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
 CONSTRAINT `bookings_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE,
 CONSTRAINT `bookings_slot_id_foreign` FOREIGN KEY (`slots_id`) REFERENCES `slots` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
breaks	CREATE TABLE `breaks` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `service_id` bigint(20) unsigned NOT NULL,
 `start_time` datetime NOT NULL,
 `end_time` datetime NOT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
 KEY `breaks_service_id_foreign` (`service_id`),
 CONSTRAINT `breaks_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
customers	CREATE TABLE `customers` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `first_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `last_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `customers_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
CREATE TABLE `off_times` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `start_time` datetime NOT NULL,
 `end_time` datetime NOT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
CREATE TABLE `services` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `duration` int(11) NOT NULL,
 `max_clients` int(11) NOT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
slots	CREATE TABLE `slots` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `service_id` bigint(20) unsigned NOT NULL,
 `day` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `start_time` time NOT NULL,
 `end_time` time NOT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
 KEY `slots_service_id_foreign` (`service_id`),
 CONSTRAINT `slots_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=163 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
users	CREATE TABLE `users` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `email_verified_at` timestamp NULL DEFAULT NULL,
 `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `created_at` timestamp NULL DEFAULT NULL,
 `updated_at` timestamp NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

User stories
As a user, I would like to book an appointment
As a user, I would like to select the date and see all available slots for this day
As a user, I want to open the scheduling page and book appointments for multiple people at once (think of
booking a haircut for yourself and your two kids)
Business stories
As a business administrator, I want to allow users to book for an appointment for available services.
As a business administrator, I want to show a calendar to users, with all available slots for booking for all
available services.
As a business administrator, I want to configure my bookable schedule (bookable calendar) for different
services all user stories below
Example: As an owner of Hair saloon, I want to create an online bookable calendar for Men haircut,
Women haircut and Hair colouring services.
As a business administrator, I want to configure opening hours which can differ from day to day
Example:
Monday to Friday men haircut can be booked from 08:00 to 20:00, and Women haircut can be booked
from 10:00 to 22:00
on Saturday, men haircut and women haircut, can be booked from 10:00 to 22:00
As a business administrator, I want to configure the duration of appointment that can be booked by users.
Example: For Men haircut, An appointment can be of 30 minutes and For Women haircut, An
appointment can be of 60 minutes.
As a business administrator, I want to have a configurable break between appointments.
Example: 5 minutes to clean the shop before next appointment of Men haircut, and 10 minutes to clean up
before next Women haircut.
As a business administrator, I want to allow users to book a time slot in x days in future but not for more
than x days, where x is configurable number of days.
Example: If a user tries to book a slot today, they can be allowed to book for 7 days in future but not for
8th day.
As a business administrator, I want to configure one or more breaks (Off time) when a service can’t be
booked.
Example: Lunch break 12:00 - 13:00, Coffee Break 17:00 - 17:30 etc.
As a business administrator, I want that a configurable number (1 or more) of clients can book one time
slot.
Example: A hair saloon, can serve 5 men haircuts and 3 women haircuts at same time.
As a business administrator, I would like to specify date and time duration when business is would be off,
these are different from weekly off. (These are planned off date and time duration.)
Example: Men and women haircut service, would remain closed in second half Christmas, full day on Eid
and Diwali. Women haircut service would remain closed on 25th January because our women’s hair
expert is on leave.
As a business administrator, I don’t want to allow users to book for an invalid slot. A requested slot is
invalid -
if requested slot is booked out
if requested slot doesn’t exist in bookable calendar
if requested slot falls between configured breaks
if requested slot falls between configured break between appointments.
if requested slot falls on a planned off date and time duration.
As a business administrator, I want to create multiple scheduling events with totally different
configurations (Men haircut, Women haircut, hair colouring, etc)
As a business administrator, I want those different events to be totally separate
As a business administrator, I want users to specify their personal details (First name, last name and email
address) for each individual in booking request.
Example: If a booking request is created for 3 people, booking request must contain 3 person’s details.
As a business administrator, I want to allow a person to book multiple times without any unique
restriction.
Example: A user should be allowed to make booking for 3 people, even if they don’t know the person’s
details, in such case they can copy their own details.
As another developer I want peace of mind and just run the automated test suite and know that I did not
break anything
Acceptance criteria
A time scheduling JSON based Rest API should be created
1 GET api which provides all data an SPA might need to display a calendar and a time selection.
1 POST api which creates a booking for 1 or more people for a single time slot
API should accept single slot for which booking needs to be created.
API should accept personal details (Email, First name and Last name) of one or multiple people to be
booked.
Implement automated testing that ensures the functionality of your code
Important: don't trust the frontend, validate the data so that the API returns an exception in case
something does not fit into the schema or is already booked out
For a men haircut
booking should not be possible at 7am because its before the shop opens.
booking at 8:02 should not be possible because its not fitting in any slot.
booking at 12:15 should not be possible as its lunch break.
…
Seed your database with the following scheduling using seeder files
Men Haircut
slots for the next 7 days, Sunday off.
from 08:00-20:00 Monday to Friday.
from 10:00-22:00 Saturday.
lunch break at 12:00-13:00.
cleaning break at 15:00-16:00.
max 3 clients per slot.
slots every 10 minutes.
5 minutes cleanup break between slots.
the third day starting from now is a public holiday.
Woman Haircut
slots for the next 7 days, Sunday off.
lunch break at 12:00-13:00.
from 08:00-20:00 Monday to Friday.
from 10:00-22:00 Saturday.
cleaning break at 15:00-16:00.
slots every 1 hour.
10 minutes cleanup break.
max 3 clients per slot.
the third day starting from now is a public holiday.