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

> Create and manage vacation date ranges (rangos) for individual employees within their active vacation period.

The Vacation Scheduling module is where HR staff define the specific date ranges an employee will take vacation. Each employee has a vacation schedule (cronograma) that tracks how many days they have available and how those days are split between flexible and block ranges.

Navigate to this module at `/registro-vacaciones`.

## How vacation periods work

Every employee has a vacation period (*periodo vacacional*) that begins one year after their hire date and lasts for one year. When you select an employee in this module, the system loads their existing schedule — or creates a new one automatically if none exists yet.

Each period allocates **30 days total**, divided into:

| Type                 | Days    | Rules                             |
| -------------------- | ------- | --------------------------------- |
| **Flexible**         | 7 days  | Used for ranges of 1–7 days       |
| **Block** (*Bloque*) | 23 days | Used for ranges of 7 or more days |

<Info>
  When you select an employee for the first time in this module and no schedule exists, the system automatically creates one and saves it to the server. No manual action is required.
</Info>

## The days available sidebar

Once you select an employee, the right-hand sidebar shows a live summary of their remaining days:

* **Total** — days not yet scheduled out of 30
* **Flexible remaining** — days left in the 7-day flexible pool
* **Block remaining** — days left in the 23-day block pool

The sidebar updates immediately after each range is added or removed.

## How to schedule a vacation range

<Steps>
  <Step title="Select an employee">
    Use the **Personal** dropdown to choose an employee. Their vacation period dates (start and end) appear in an info panel below the dropdown.
  </Step>

  <Step title="Set the start and end dates">
    In the **Agregar Rango de Vacaciones** card, enter a **Fecha Inicio** and **Fecha Fin**. Both dates must fall within the employee's vacation period.

    As soon as both dates are set, the system shows the total days requested and runs validation in real time.
  </Step>

  <Step title="Review validation feedback">
    Any errors (e.g. overlapping ranges, exceeding available days, starting on a weekend) are shown inline in red. Any warnings are shown in amber. The **Agregar Rango de Vacaciones** button is disabled until all errors are resolved.
  </Step>

  <Step title="Save the range">
    Click **Agregar Rango de Vacaciones**. The range is saved and appears in the **Vacaciones Programadas** list below the form.
  </Step>
</Steps>

## Range types

The system automatically classifies each range based on its length:

<Tabs>
  <Tab title="Flexible (1–7 days)">
    Any range of 1 to 7 days draws from the **flexible** pool (up to 7 days per period). Flexible days can be taken as individual days or short stretches.

    Once all 7 flexible days are used, remaining requests must be submitted as block ranges of at least 7 days.
  </Tab>

  <Tab title="Block (7+ days)">
    Any range of 7 or more consecutive days draws from the **block** pool (23 days per period). Block ranges must be at least 7 days long.
  </Tab>
</Tabs>

## Friday rule

<Warning>
  If you select a **Friday** as the start date, the end date is automatically extended to the following **Sunday**. The same applies if Friday is chosen as the end date. A notification appears to inform you of this automatic adjustment.

  This rule ensures that vacation ranges never end mid-weekend.
</Warning>

## Validation rules

The system checks the following before allowing a range to be saved:

* Start and end dates must be within the employee's vacation period
* Start date cannot be a Saturday or Sunday
* The range must not overlap with any existing range for the same employee
* Flexible ranges cannot exceed the remaining flexible days
* Block ranges cannot exceed the remaining block days
* Start date cannot be after end date

Errors are shown inline — the save button stays disabled until every error is cleared.

## Advance vacation (Adelanto)

The sidebar includes an **Adelanto de Vacaciones** panel. This feature lets you borrow days from a future period before the full year is complete.

Days accrue at **2.5 days per completed month** since the start of the vacation period. Advance days are added directly to the block pool and to the total available days.

<Note>
  Advance vacation days are tracked separately in `diasAdelanto` on the schedule. If an advance range is later deleted, the advance day count and totals are adjusted accordingly.
</Note>

## How to delete a range

In the **Vacaciones Programadas** list, click the trash icon on the range you want to remove. Ranges with a **Reprogramado** status cannot be deleted — the delete button is disabled for those rows.

## Related modules

<CardGroup>
  <Card title="Personal Registry" icon="users" href="/modules/personal-registry">
    Employees must be registered before they can be scheduled.
  </Card>

  <Card title="Vacation Overview" icon="calendar" href="/modules/vacation-overview">
    View a summary of scheduled and remaining days for any employee.
  </Card>

  <Card title="Rescheduling" icon="refresh-ccw" href="/modules/rescheduling">
    Move existing vacation ranges to new dates.
  </Card>
</CardGroup>
