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 controls booking availability at the individual day level. Each barber has independent Workday records that define whether they are working on a given date and, if so, during which hours. Until a barber’s workday is explicitly opened for a date, that date shows no available slots to customers. This model gives staff full control over scheduling without requiring a fixed weekly template.

How workday records work

A Workday record stores four pieces of information: the barber_id, the day (date), an is_open flag, and start_time/end_time values. The staff panel writes these records through POST /staff/workdays/set, which uses updateOrCreate internally — so running the same request twice updates the existing record rather than creating a duplicate. Slots displayed to customers are calculated at query time in 30-minute increments between start_time and end_time. For example, a workday from 09:00 to 13:00 produces eight slots: 09:00, 09:30, 10:00, 10:30, 11:00, 11:30, 12:00, and 12:30.
If no Workday record exists for a given date and barber, the booking form treats that date as unavailable and hides it entirely from customers.

Opening a workday

1

Select the barber tab

In the staff panel at /dashboard, click the tab for the barber whose workday you want to configure.
2

Pick the date

Use the date picker to choose the date you want to open.
3

Set shift hours

Enter the shift start time and end time using the time inputs in the workday controls section.
4

Click ABRIR DÍA

Click the ABRIR DÍA button. This sends a POST request to /staff/workdays/set with is_open = true and the times you set. The slot grid updates immediately to show the generated slots in blue.

Closing a workday

1

Select the barber tab and date

Navigate to the relevant barber tab and select the date you want to close.
2

Click CERRAR DÍA

Click the CERRAR DÍA button. This sends a POST request to /staff/workdays/set with is_open = false. All slots for that date are immediately hidden from the customer-facing booking form.
Closing a workday does not automatically cancel existing appointments for that date. Check the appointments table before closing a day and cancel or reschedule any confirmed bookings manually.

Updating an already-open workday

Because setWorkday uses updateOrCreate, you can safely re-submit the form for a date that already has a Workday record. For example, to extend a shift from 13:00 to 15:00, simply update the end time and click ABRIR DÍA again. The record is updated in place and new slots become available without affecting existing appointments.

POST /staff/workdays/set

POST /staff/workdays/set
Content-Type: application/x-www-form-urlencoded
Authorization: session cookie (auth middleware)
Parameters
barber_id
number
required
The ID of the barber whose workday is being set. Must be a valid user ID with role = 'barber'.
day
string
required
The date to configure, in YYYY-MM-DD format.
is_open
boolean
required
Set to true to open the workday and make slots available, or false to close it and hide all slots.
start_time
string
required
Shift start time in HH:MM (24-hour) format. Required when is_open is true.
end_time
string
required
Shift end time in HH:MM (24-hour) format. Must be after start_time. Required when is_open is true.
Example — opening a workday
curl --request POST \
  --url https://your-barbershop.com/staff/workdays/set \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'barber_id=3&day=2026-06-01&is_open=1&start_time=09:00&end_time=18:00'
Example — closing a workday
curl --request POST \
  --url https://your-barbershop.com/staff/workdays/set \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'barber_id=3&day=2026-06-01&is_open=0&start_time=09:00&end_time=18:00'

Checking availability

You can query a barber’s generated slots for any date using the GET /staff/availability endpoint. This is the same data source used by the customer-facing booking form.
GET /staff/availability?barber_id=3&date=2026-06-01
Authorization: session cookie (auth middleware)
Response
{
  "slots": [
    { "time": "09:00", "available": true,  "status": "available" },
    { "time": "09:30", "available": false, "status": "occupied"  },
    { "time": "10:00", "available": true,  "status": "available" }
  ]
}
Each object in the slots array represents a 30-minute window. A slot with status: "occupied" has a confirmed appointment and cannot be booked again.

Build docs developers (and LLMs) love