To create a feature complete REST API for time scheduling.
Tech requirements
Use an SQL Database with an ORM
Store data in related tables with foreign keys, don’t use json columns
Use a high level Javascript or PHP framework (NestJS, Laravel, Symfony, …)
Scope
Only backend APIs are in the scope of this hackathon, No frontend HTML/JS/CSS should be created.
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.

how do this step by step in laravel ?