# RAMA AG — Phase 07 — GAV Rules & Vacation Accounting

Status: **DRAFT — BLOCKED on owner confirmation** (branch `develop/v1`; not yet activated on `:3400`).

## Implemented features
- `App\Domain\Smgv\RuleSet`: a versioned (`smgv_rule_sets`, valid_from/valid_to) and configurable rule structure. Every rule carries `verified`, `draft_apply` and a documented `source`.
- Verified from the PDF: target hours by weekday Pensum, holiday credit equal to the day's target hours, and the time-band boundaries.
- Unverified, applied as drafts: 8 h per day at 100 %, gross vacation 176 h per year, vacation proration (rounded up to 0.05 h), Vorjahr compensation until April.
- Unverified and **not applied** (contribute 0, with a warning): paid travel %, travel deduction, the 25 % / 100 % / 100 % time supplements.
- Any unverified rule makes the result a draft, shown with a banner and a PDF watermark. `/smgv/rules` shows every rule read-only; the UI can never mark a rule as verified.

## Modified / added files
`app/Domain/Smgv/RuleSet.php`, `app/Models/Smgv/RuleSetVersion.php`, `app/Livewire/Smgv/Rules.php`, `resources/views/livewire/smgv/rules.blade.php`

## Database changes
`smgv_rule_sets`, seeded with version `2026.1-draft` (`unverified`).

## Test results
Unit `tests/Unit/SmgvTimeEngineTest.php` (8), feature `tests/Feature/SmgvAccountingTest.php` (8), `tests/Feature/SmgvCenterTest.php` (6). Full regression: main 562 (464 passed, 98 skipped by design), memory 97 (96 + 1 skipped), upgrade 2: **0 failures**.

## Security considerations
All user-facing actions are Administrator-only: `admin` route middleware plus a fresh database check on every Livewire request (`SmgvContext::bootSmgvContext`) and a service-level `Actor::admin()`. Audit entries never contain personal values (no AHV, address or birth date). Isolation is unchanged: RAMA database and account only, no outbound mail or HTTP, and Quality was never touched.

## Technical decisions, assumptions and limitations
The 10 owner questions are listed in the tracker. Once confirmed, a new rule-set version with `status = verified` will be added through a reviewed migration or administrator action; closed months keep their old rule version.

## Outstanding blockers
The GAV/SMGV rule confirmations listed in `RAMA_AG_MASTER_DEVELOPMENT_TRACKER.md` remain open. Until they are answered, values are drafts (watermarked, with banners).
