# Alarm Vacation Ranges Specification ## Purpose Active vacation-range detection, per-alarm pause-impact computation, upcoming ranges, past-ranges history, and the summary-row entry point from the Alarmas root into a dedicated Vacaciones manager screen. Traceable to WU8 (summary row), WU9 (manager screen + `EstadoAlarmas` queries). ## Requirements ### Requirement: Active Range Detection `EstadoAlarmas` MUST expose a query returning the currently-active vacation range (if today falls within one), including days remaining. It MUST return no active range when today falls within none. #### Scenario: Today falls within a range - GIVEN a vacation range whose start-to-end span includes today - WHEN the active-range query runs - THEN it returns that range with a computed days-remaining count #### Scenario: No active range - GIVEN no configured range includes today - WHEN the active-range query runs - THEN it returns no active range ### Requirement: Per-Alarm Pause-Impact Computation For the currently-active range, the system MUST compute which alarms are paused (`sonarEnVacaciones == false`) and which are unaffected (`sonarEnVacaciones == true`), producing data sufficient to render an impact line (e.g. "Pausa 07:30 y 13:45 ยท 08:15 sigue"). #### Scenario: Mixed paused and unaffected alarms - GIVEN 3 alarms exist, 2 with `sonarEnVacaciones == false` and 1 with `true`, during an active range - WHEN the impact computation runs - THEN it lists exactly those 2 as paused and exactly that 1 as unaffected ### Requirement: Upcoming Ranges Query `EstadoAlarmas` MUST expose a query returning ranges that have not yet started, ordered soonest-first. #### Scenario: Two future ranges - GIVEN 2 ranges with future start dates - WHEN the upcoming-ranges query runs - THEN both are returned, ordered by soonest start date first ### Requirement: Past-Ranges History Query `EstadoAlarmas` MUST expose a query returning ranges whose end date has already passed, distinct from the active and upcoming queries. #### Scenario: A range that ended yesterday - GIVEN a range whose end date was yesterday - WHEN the past-ranges query runs - THEN that range appears in the past-ranges result and in neither the active nor upcoming result ### Requirement: Vacation Summary Row Replaces the Inline Panel The Alarmas root MUST show a summary row (range count and next-range countdown) in place of the current full inline vacation-ranges list. Tapping the row MUST push the dedicated Vacaciones manager screen. #### Scenario: Tapping the summary row opens the manager screen - GIVEN the Alarmas root shows the vacation summary row - WHEN the user taps it - THEN the Vacaciones manager screen opens as a second-level (push-chrome) screen with no tab bar