Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CKoldo/Vacaciones-front/llms.txt

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

A schedule (CronogramaVacaciones) represents one vacation year for a single employee. It tracks the total days available, how many flexible and block days have been used, and the approval state. The actual vacation date ranges are stored separately and linked to the schedule — see Ranges. Each employee gets exactly 30 total vacation days per period:
  • Up to 7 flexible days — short ranges of 1–7 days
  • 23 block days — continuous ranges of 7 or more days
All endpoints require a valid Authorization: Bearer <token> header. See Authentication for details.

List all schedules

Returns every schedule in the system across all employees.

GET /api/schedules

No request body. ResponseCronogramaVacaciones[]
id
string
required
Unique identifier for the schedule.
personalId
string
required
ID of the employee this schedule belongs to.
anioVacacional
string
required
Vacation year label (e.g. "2026-2027").
fechaInicioAnio
string
required
ISO 8601 date string for when the vacation period begins.
fechaFinAnio
string
required
ISO 8601 date string for when the vacation period ends.
diasTotales
number
required
Total vacation days in the period. Always 30.
diasFlexiblesDisponibles
number
required
Maximum flexible days available. Always 7.
diasFlexiblesUsados
number
required
Flexible days already scheduled.
diasBloqueDisponibles
number
required
Block days available. Always 23.
diasBloqueUsados
number
required
Block days already scheduled.
diasAdelanto
number
required
Days used as an advance (adelanto) against this period.
rangos
RangoVacaciones[]
required
Vacation date ranges belonging to this schedule. May be an empty array if ranges have not been fetched separately.
estado
string
required
Approval status: "pendiente", "aprobado", or "rechazado".
curl http://localhost:5175/api/schedules \
  -H "Authorization: Bearer <token>"

List schedules for an employee

Returns all schedules that belong to a specific employee. Use this when you need only the records for one person.

GET /api/schedules/:personalId

personalId
string
required
The UUID of the employee whose schedules you want to retrieve.
No request body. ResponseCronogramaVacaciones[] filtered to the given employee. The response shape is identical to List all schedules.
Ranges are not embedded in this response. Fetch them separately with GET /api/ranges/:scheduleId for each schedule returned.
curl http://localhost:5175/api/schedules/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer <token>"

Create a schedule

Creates a new vacation schedule for an employee. Send all schedule fields except rangos — ranges are managed through the Ranges API.

POST /api/schedules

id
string
required
Client-generated UUID for the schedule.
personalId
string
required
ID of the employee this schedule belongs to.
anioVacacional
string
required
Vacation year label (e.g. "2026-2027").
fechaInicioAnio
string
required
ISO 8601 start date of the vacation period.
fechaFinAnio
string
required
ISO 8601 end date of the vacation period.
diasTotales
number
default:"30"
required
Total vacation days. Always 30.
diasFlexiblesDisponibles
number
default:"7"
required
Maximum flexible days. Always 7.
diasFlexiblesUsados
number
default:"0"
required
Flexible days already used. Set to 0 on creation.
diasBloqueDisponibles
number
default:"23"
required
Block days available. Always 23.
diasBloqueUsados
number
default:"0"
required
Block days already used. Set to 0 on creation.
diasAdelanto
number
default:"0"
required
Advance days already deducted. Set to 0 on creation.
estado
string
default:"pendiente"
required
Initial approval status. One of "pendiente", "aprobado", "rechazado".
Response — the created CronogramaVacaciones object.
curl -X POST http://localhost:5175/api/schedules \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "sched-001",
    "personalId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "anioVacacional": "2026-2027",
    "fechaInicioAnio": "2026-06-01",
    "fechaFinAnio": "2027-05-31",
    "diasTotales": 30,
    "diasFlexiblesDisponibles": 7,
    "diasFlexiblesUsados": 0,
    "diasBloqueDisponibles": 23,
    "diasBloqueUsados": 0,
    "diasAdelanto": 0,
    "estado": "pendiente"
  }'

Update a schedule

Updates day counters and approval status on an existing schedule. This endpoint is called whenever a range is added, deleted, or rescheduled to keep the schedule’s counters in sync.

PUT /api/schedules/:id

id
string
required
The UUID of the schedule to update.
id
string
required
Schedule ID (must match the path parameter).
personalId
string
required
ID of the employee.
anioVacacional
string
required
Vacation year label.
fechaInicioAnio
string
required
ISO 8601 start date.
fechaFinAnio
string
required
ISO 8601 end date.
diasTotales
number
required
Total vacation days.
diasFlexiblesDisponibles
number
required
Maximum flexible days available.
diasFlexiblesUsados
number
required
Updated flexible days used.
diasBloqueDisponibles
number
required
Block days available.
diasBloqueUsados
number
required
Updated block days used.
diasAdelanto
number
required
Updated advance days.
estado
string
required
Approval status: "pendiente", "aprobado", or "rechazado".
Response — the updated CronogramaVacaciones object.
curl -X PUT http://localhost:5175/api/schedules/sched-001 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "sched-001",
    "personalId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "anioVacacional": "2026-2027",
    "fechaInicioAnio": "2026-06-01",
    "fechaFinAnio": "2027-05-31",
    "diasTotales": 30,
    "diasFlexiblesDisponibles": 7,
    "diasFlexiblesUsados": 3,
    "diasBloqueDisponibles": 23,
    "diasBloqueUsados": 14,
    "diasAdelanto": 0,
    "estado": "aprobado"
  }'

Build docs developers (and LLMs) love