> ## 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.

# Vacation periods

> Understand how the system calculates and manages the annual vacation period for each employee, including the 30-day allocation and status lifecycle.

A **vacation period** (called a `CronogramaVacaciones` in the system) is the one-year window in which an employee is entitled to take their 30 vacation days. Every employee has exactly one active period at a time.

## How a period is calculated

The system determines the vacation period from the employee's hire date (`fechaIngreso`). The period does not start on the hire date itself — it starts **exactly one year later**, once the employee has completed their first year of service.

<Steps>
  <Step title="Employee is registered">
    An HR administrator registers the employee in the **Personal Registry** module, entering their hire date.
  </Step>

  <Step title="Employee is selected in scheduling">
    When you open the **Vacation Scheduling** module and select the employee from the dropdown, the system automatically checks for an existing vacation period.
  </Step>

  <Step title="Period is created automatically">
    If no period exists yet, the system creates one immediately using the employee's hire date. No manual input is required. The new period is saved to the server via `POST /api/schedules`.
  </Step>

  <Step title="Period spans one full year">
    `fechaInicioAnio` is set to the one-year anniversary of the hire date. `fechaFinAnio` is set to exactly one year after that. Both are stored as ISO date strings.
  </Step>
</Steps>

### Period label

The period is identified by `anioVacacional`, a human-readable string of the form `"YYYY-YYYY"` — for example, `"2025-2026"`. This label is shown throughout the scheduling interface.

<Note>
  All vacation ranges scheduled for an employee must fall within their `fechaInicioAnio` and `fechaFinAnio`. The date pickers in the scheduling form are automatically constrained to this window.
</Note>

## Day allocation

Each period always starts with 30 total days, split into two buckets:

| Bucket                                     | Days   | Usage rules                                      |
| ------------------------------------------ | ------ | ------------------------------------------------ |
| Flexible days (`diasFlexiblesDisponibles`) | 7      | Short breaks of 1–7 consecutive days             |
| Block days (`diasBloqueDisponibles`)       | 23     | Extended vacations of 7 or more consecutive days |
| **Total**                                  | **30** | —                                                |

As vacation ranges are added, the system increments `diasFlexiblesUsados` or `diasBloqueUsados` accordingly. The sidebar in the scheduling module always shows the current balance for each bucket.

<Info>
  Advance vacations can increase the total beyond 30. See [Advance vacations (Adelanto)](/concepts/advance-vacations) for details.
</Info>

## Period statuses

Every period carries a `estado` field that reflects its approval state in the HR workflow.

| Status      | Meaning                                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `pendiente` | The period has been created and ranges may be added, but it has not been reviewed yet. This is the default status for all new periods. |
| `aprobado`  | An administrator has approved the full schedule.                                                                                       |
| `rechazado` | The schedule was reviewed and rejected. Ranges may need to be revised.                                                                 |

<Note>
  Status transitions are managed in the **Administration** module. The scheduling module creates periods with `pendiente` status by default.
</Note>

## One period per employee

The system enforces a one-to-one relationship between an employee and their current period. When you select an employee in the scheduling module, the system:

1. Searches existing schedules for a record matching the employee's ID (`personalId`).
2. If a match is found, loads it and its saved ranges.
3. If no match is found, creates a new period automatically.

This means you never need to create a period manually — selecting the employee is sufficient.
