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 range (RangoVacaciones) is a single block of vacation dates within a schedule. Ranges are linked to a schedule via scheduleId and to an employee via personalId. Multiple ranges make up an employee’s vacation plan for the year.

Range types

TypeDescription
flexibleShort vacation of 1–7 days. Up to 7 flexible days can be taken per period.
bloqueContinuous vacation of 7 or more days. Uses days from the 23-day block allocation.
The type is determined automatically by the number of days requested. If diasSolicitados <= 7 and the employee still has flexible days remaining, the type is flexible; otherwise it is bloque.

Range states

StateDescription
activoThe range is active and has not been rescheduled.
reprogramadoThe range was replaced by a new range. The original is kept for audit purposes and its reprogramadoPor field points to the replacement.

Reschedule linkage

When a range is rescheduled, the system creates a new range and marks the original as reprogramado:
  • reprogramadoPor — ID of the new range that replaced this one (set on the original).
  • reprogramadoDesde — array of IDs of original ranges that were merged or replaced to create this new range (set on the new range).
All endpoints require a valid Authorization: Bearer <token> header. See Authentication for details.

List ranges for a schedule

Returns all vacation ranges belonging to a specific schedule.

GET /api/ranges/:scheduleId

scheduleId
string
required
The UUID of the schedule whose ranges you want to retrieve.
No request body. ResponseRangoVacaciones[]
id
string
required
Unique identifier for the range.
scheduleId
string
ID of the schedule this range belongs to.
personalId
string
ID of the employee this range belongs to.
fechaInicio
string
required
ISO 8601 start date of the vacation range (e.g. "2026-07-14").
fechaFin
string
required
ISO 8601 end date of the vacation range (e.g. "2026-07-20").
diasSolicitados
number
required
Number of vacation days in this range.
tipo
string
required
Range type: "flexible" or "bloque".
incluye_finde
boolean
true if the range was extended to include a weekend because the start or end date fell on a Friday.
estado
string
"activo" or "reprogramado". Defaults to "activo".
esAdelanto
boolean
true if this range was created as a vacation advance (adelanto) against a future period.
reprogramadoDesde
string[]
IDs of the original ranges that were replaced or merged to create this range. Present only on rescheduled replacement ranges.
reprogramadoPor
string | null
ID of the replacement range that rescheduled this range. null if the range is still active.
esinadId
string | null
ID of the linked ESINAD document, if any.
curl http://localhost:5175/api/ranges/sched-001 \
  -H "Authorization: Bearer <token>"

Create a range

Creates a new vacation date range and associates it with a schedule.

POST /api/ranges

id
string
required
Client-generated identifier for the range.
scheduleId
string
required
ID of the schedule this range belongs to.
personalId
string
required
ID of the employee this range belongs to.
fechaInicio
string
required
ISO 8601 start date (e.g. "2026-07-14").
fechaFin
string
required
ISO 8601 end date (e.g. "2026-07-20"). Must be on or after fechaInicio.
diasSolicitados
number
required
Number of vacation days being requested.
tipo
string
required
"flexible" for ranges up to 7 days; "bloque" for 7 or more days.
incluye_finde
boolean
Whether the range extends over a weekend because a Friday was selected.
estado
string
default:"activo"
Initial state. Use "activo" for new ranges.
esAdelanto
boolean
default:"false"
Set to true when creating a vacation advance.
reprogramadoPor
string | null
default:"null"
ID of the range that rescheduled this one. Pass null for new ranges.
esinadId
string | null
default:"null"
ID of a linked ESINAD document. Pass null if not applicable.
After creating a range, update the parent schedule’s day counters with PUT /api/schedules/:id to keep diasFlexiblesUsados and diasBloqueUsados accurate.
Response — the created RangoVacaciones object.
curl -X POST http://localhost:5175/api/ranges \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "VAC-2026-001",
    "scheduleId": "sched-001",
    "personalId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fechaInicio": "2026-07-14",
    "fechaFin": "2026-07-20",
    "diasSolicitados": 7,
    "tipo": "flexible",
    "incluye_finde": false,
    "estado": "activo",
    "esAdelanto": false,
    "reprogramadoPor": null,
    "esinadId": null
  }'

Delete a range

Deletes a vacation range by its ID.

DELETE /api/ranges/:id

id
string
required
The ID of the range to delete.
No request body. Response200 OK on success.
Ranges with estado: "reprogramado" are kept for audit purposes and cannot be deleted through the front end. However, the API will accept the delete request if called directly. After deleting a range, update the parent schedule’s day counters with PUT /api/schedules/:id.
curl -X DELETE http://localhost:5175/api/ranges/VAC-2026-001 \
  -H "Authorization: Bearer <token>"

Rescheduling workflow

Rescheduling a range involves two coordinated API calls:
1

Create the replacement range(s)

POST /api/ranges for each new range, setting reprogramadoDesde to the IDs of the original ranges being replaced, and estado: "activo".
2

Delete the original ranges

DELETE /api/ranges/:id for each original range being replaced. The front end archives these by removing them and storing rescheduling metadata client-side.
3

Update the schedule counters

PUT /api/schedules/:id with the recalculated diasFlexiblesUsados and diasBloqueUsados values to keep the schedule in sync.
The reprogramadoDesde array on the new range records which original ranges it replaced. This linkage powers the rescheduling history displayed in the Vacation Overview module.

Build docs developers (and LLMs) love