Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/OswalSnow/AR-Barber/llms.txt

Use this file to discover all available pages before exploring further.

AR Barbería’s booking system lets customers reserve a chair directly from the website without needing to call or message in advance. This page walks through the full flow — from landing on the homepage to receiving a confirmation — and explains the rules that govern slot availability, rate limiting, and what happens if you hit the appointment cap.

Booking flow

1

Visit the homepage

Navigate to the AR Barbería site. The homepage lists all available barbers with their names and profile information. This is your entry point for starting a reservation.
2

Choose a barber

Click the booking button next to the barber you want. This takes you to the booking form at /agendar/{id}, where {id} is the barber’s user ID.
3

Select a service

Choose one of the three available services. Each has a different duration that affects which time slots are shown to you.
ServiceDescriptionDuration
corteHaircut30 minutes
barbaBeard trim30 minutes
ambosHaircut + beard trim60 minutes
Selecting ambos filters the slot list to show only openings with at least 60 minutes of clear time.
4

Pick a date

Use the date picker (powered by Flatpickr) to select the day you want. Dates in the past are disabled.
The date picker auto-selects the next available workday when the form loads, so in most cases you can skip directly to picking a time slot.
5

Pick a time slot

After selecting a date, the form fetches available slots from the availability API:
GET /api/disponibilidad/{user_id}/{fecha}?duration=30
The API returns only slots that are genuinely open — it skips past times (for today), excludes slots that would overlap with existing appointments, and stays within workday hours. Slots are shown in 30-minute intervals (e.g., 10:00, 10:30, 11:00).
6

Enter your contact details

Fill in your name and a 10-digit phone number. The phone number is used to look up existing appointments and to cap the number of active bookings per customer.
7

Submit the form

Click confirm. The form POSTs to /confirmar-cita. If everything validates, the appointment is saved and you are redirected to the homepage with a success message.

How slot availability works

The availability endpoint (/api/disponibilidad/{user_id}/{fecha}) calculates open slots dynamically on every request. It does the following:
  • Loads all existing appointments for the selected barber on that date.
  • Iterates through workday hours in 30-minute increments.
  • Skips any slot where the time has already passed (only relevant when the selected date is today).
  • Skips any slot where a new appointment of the requested duration would overlap with an existing one.
  • Returns the remaining slots as an array of time strings, for example: ["10:00", "10:30", "11:00"].
You can call the endpoint directly with the duration query parameter set to 30 or 60 depending on the service:
GET /api/disponibilidad/3/2026-05-24?duration=60
["10:00", "11:00", "14:00", "15:00"]
Slots are fetched when you load the form, not when you submit. If another customer books the same slot while you are filling out the form, you will receive a conflict error on submission. If this happens, reload the form to see the updated availability.

Anti-spam appointment limit

To prevent a single phone number from holding many time slots at once, the system enforces a maximum of 2 active appointments per phone number. If you try to book a third appointment with the same phone number, the form returns a validation error with the key límite. When this limit is reached, the page displays a WhatsApp button that deep-links to the barber’s WhatsApp with a pre-filled message, letting you coordinate directly if you have a special situation.

Rate limiting on form submission

The /confirmar-cita endpoint is protected by Laravel’s throttle middleware:
throttle:3,1
This means a maximum of 3 POST requests per minute per IP address. Exceeding this returns an HTTP 429 Too Many Requests response. Wait 60 seconds before trying again.

Validation rules

The booking form enforces the following rules on submission:
FieldRule
customer_nameRequired, string, max 255 characters
customer_phoneRequired, exactly 10 digits
servicioRequired, one of: corte, barba, ambos
fechaRequired, valid date, must be today or in the future
horaRequired
user_idRequired, must exist in the users table

Build docs developers (and LLMs) love