# RAMA AG — Phase 05 — Employee Contracts & Basisblatt

Status: **DONE** (branch `develop/v1`; not yet activated on `:3400`).

## Implemented features
- `/smgv/basisblatt`: personal data (street, postal code, city, birth date). The AHV number is validated (`756.XXXX.XXXX.XX`), stored encrypted with APP_KEY, and shown only masked (`756.****.****.NN`).
- Contract: entry and exit date, Ø hours per day at 100 % (default 8.00, unverified), automatic vacation calculation.
- Pensum per weekday (MO–SO, %), effective-dated: a change closes the previous period and starts a new one. History is never rewritten, and changes reaching into a closed month are refused.
- Previous-year carry-over (Stundensaldo, Ferien) per year.
- Company holiday calendar as a 12 × 31 grid, toggled like the client Basisblatt.
- Monthly Pensum table (Ø per weekday, effective employment %, target hours), as on the client sheet.

## Modified / added files
`app/Livewire/Smgv/Basisblatt.php`, `resources/views/livewire/smgv/basisblatt.blade.php`, `app/Services/Smgv/SmgvEmployees.php`, `app/Models/Smgv/{EmployeeProfile,Contract,EmploymentPeriod,OpeningBalance,Holiday,HolidayCalendar}.php`

## Database changes
`smgv_employee_profiles`, `smgv_contracts`, `smgv_employment_periods`, `smgv_opening_balances`, `smgv_holiday_calendars`, `smgv_holidays` (see the database architecture report).

## 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
See `RAMA_AG_MASTER_DEVELOPMENT_TRACKER.md` (Decisions, Known limitations).

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