# RAMA AG — Final Master Report

Release: **`rama-v1.0.0-rc1`**, live on `http://localhost:3400` since 27.11.2026 05:34.

**Status legend:**
- **IMPL**: fully implemented.
- **TESTED**: automated tests.
- **DEPLOYED**: live.
- **DRAFT**: draft-only.
- **AWAIT**: awaiting business validation.
- **BLOCKED**.
- **NOT**: not implemented.

This report does **not** claim 100 % completion: the GAV/SMGV accounting rules are still awaiting the owner's validation.

## 1. Executive summary

The RAMA AG Workforce platform now has exactly two roles (Administrator, Employee). It includes an integrated SMGV Arbeitszeitkontrolle centre: Basisblatt, monthly control, annual overview, absences, balances, monthly closing with immutable snapshots, a 14-page PDF export and a historical PDF import. The whole web application has a Black Titanium enterprise design.

Everything is DEPLOYED and TESTED. The SMGV values are DRAFT/AWAIT: watermarked, with a banner, and no compliance is claimed, until the 10 GAV questions are answered.

## 2. Completed phases

| Phase | Status |
| --- | --- |
| 01 Audit | IMPL |
| 02 Two roles | IMPL TESTED DEPLOYED (v0.2.0) |
| 02B Deployment | DEPLOYED |
| 03 PDF reverse engineering | IMPL (structure verified; formulas partly AWAIT) |
| 04 Database | IMPL TESTED DEPLOYED |
| 05 Basisblatt | IMPL TESTED DEPLOYED |
| 06 Engine | IMPL TESTED DEPLOYED (DRAFT values) |
| 07 GAV rules | IMPL as a versioned structure; rules AWAIT/BLOCKED |
| 08 Dashboard | IMPL TESTED DEPLOYED |
| 09 Monthly/annual | IMPL TESTED DEPLOYED (DRAFT) |
| 10 Closing/audit | IMPL TESTED DEPLOYED |
| 11 PDF export | IMPL TESTED DEPLOYED (DRAFT watermark) |
| 12 Historical import | IMPL TESTED DEPLOYED (opening values only) |
| Black Titanium | IMPL DEPLOYED (minor polish OPEN) |
| 13 Testing | TESTED |
| Final rebuild | DEPLOYED |

## 3. Application architecture

- Laravel 13, PHP 8.3, Livewire 4, Blade, Tailwind 4, Vite 8, MariaDB 10.11, Dompdf, PhpSpreadsheet. No dependency or lockfile changes.
- New code:
  - `App\Domain\Smgv` (pure `TimeEngine`, `RuleSet`).
  - `App\Services\Smgv` (Accounting, Employees, Lifecycle, Export, Import).
  - `App\Livewire\Smgv\*` (10 screens) and `AuditHistory`.
  - `App\Support\Pdf` (merger, text extractor).
  - `App\Support\Hours`.
  - Middleware `admin`.
- Isolation is unchanged (`RamaIsolationServiceProvider`). The schema gate now also requires the SMGV tables, so the code fails closed with 503 if they are missing.

## 4. Database architecture

- 49 tables: the 34 existing ones plus 15 `smgv_*` tables (see `RAMA_AG_SMGV_DATABASE_ARCHITECTURE.md`).
- Integer minutes and basis points; no floats.
- Effective-dated Pensum.
- Append-only corrections; immutable closings and reopenings (6 new triggers).
- Versioned rule sets.
- 19 migrations, all forward-only.

## 5. Role and permission matrix

| Area | Administrator | Employee |
| --- | --- | --- |
| Existing modules | As Phase 02 | As Phase 02 (own data) |
| SMGV Center (all 10 pages), exports, imports, downloads | Full | 403 |
| Audit history | Full | 403 |

Enforced at four levels: route middleware, a fresh check on every Livewire request, service `Actor::admin()`, and the download controller.

## 6. Implemented modules

- **SMGV:** Overview, Basisblatt, Monthly control, Annual (per employee and company), Vacation & absences, Overtime & compensation, Closing, Export center, Historical import, Rules & holidays.
- **System:** Audit history; grouped navigation.

## 7. Black Titanium design system

See `RAMA_AG_BLACK_TITANIUM_DESIGN_SYSTEM.md`: tokens, `bt-*` components, motion, accessibility, global legacy conversion.

## 8. Screenshots

`D:\- CLAUD PROJECTS\RAMA AG\phase02b-evidence\v1\screens\` (14 v1 screenshots: login, dashboard, SMGV pages at 1440 / 1920, tablet, mobile employee).

## 9–12. Basisblatt, engine, monthly and annual reporting

See the reports for phases 05, 06, 07 and 09. Relationships verified against the client PDF:
- Target hours = days × 8 h × Pensum.
- Total = productive + supplements + unproductive.
- Vergleich = Total − Soll.
- Kumuliert = running sum.
- Ferien total / Übertrag.

Formulas not shown in the PDF are configurable and DRAFT or not applied.

## 13. PDF export fidelity

- A4 portrait Basisblatt plus 13 A4 landscape pages per employee: 14 pages each, 140 for 10 employees.
- The reference layout and terminology are reproduced on a print-friendly white background.
- Overflow is refused.
- A watermark is printed while the rules are drafts.
- The SMGV logo is omitted pending the owner's decision.

## 14. Historical import

- Upload → classification → extraction of the Vorjahr opening values → review → explicit confirmation.
- Reads the client reference correctly (140 pages, 10 employees) without importing anything.
- The export → import round trip is tested.

## 15–16. Migrations and integrity triggers

- One new forward migration, applied live in batch 4 (≈ 2 s).
- The 26 original triggers are byte-identical, plus 6 SMGV guards.

## 17–18. Automated, browser and responsive results

- main 562 (464 passed, 98 skipped), memory 97 (96 + 1 skipped), upgrade 2/2: **0 failures**.
- Browser checks were SIMULATED at five viewports: no overflow, no console errors, employee 403s confirmed.
- See `RAMA_AG_FINAL_QA_REPORT.md`.

## 19. Security validation

- CSRF returns 419.
- Private SHA-256-checked downloads; validated uploads; AHV encrypted and masked.
- No personal data in audit entries; Excel string cells.
- Outbound mail blocked (`array`); debug off.

## 20. Performance

- The annual overview computes 12 months per employee from the event data; it took well under a second per employee in tests.
- A full PDF renders per employee to keep memory bounded.
- A 2-employee full export took ≈ 4 s.
- Large exports are synchronous (no queue worker): a known limitation.

## 21. Backups and checksums

| Backup | Location / checksum |
| --- | --- |
| v1 pre-deploy | `D:\- CLAUD PROJECTS\RAMA AG\backups\v1-predeploy-20261127-053100\` (SHA256SUMS verified) |
| Final dump | `db-final/rama_workforce_laravel.sql`, sha256 `b24dcdd9b90caf4a0bfca44029f274e1887f6ad72b0caa7c97b81b993f30c3b8` |
| Rehearsal | `backups\v1-rehearsal-20261127-030216\` |
| Phase 02B | `backups\phase02b-predeploy-20261126-220045\` |

## 22. Git release

- `rama-v1.0.0-rc1` → `4e7a50a` (local, annotated). `rama-v0.2.0` is kept.
- Branch `develop/v1`; worktree `D:\- CLAUD PROJECTS\RAMA AG\dev-v1`. Nothing was pushed.

## 23–25. Rebuild, availability and Quality isolation

- See `RAMA_AG_FINAL_REBUILD_REPORT.md`. RAMA was offline ≈ 51 s; health is 200.
- Quality was never accessed, queried or restarted.

## 26. Unverified accounting rules (AWAIT, owner input needed)

1. Which GAV version and articles apply?
2. Is 8.00 h per day at 100 % correct?
3. The maximum working time and night window for supplements 1–3.
4. Paid travel and the travel deduction.
5. Vacation entitlement and rounding.
6. The Vorjahr compensation deadline, the RPBK duty and the next-year opening "Rest".
7. Karenz rules.
8. The canton holiday calendar.
9. Use of the SMGV logo.
10. The real RAMA logo.

## 27. Remaining limitations

- Owner login and smoke test still to be done.
- No real-device GPS test.
- Synchronous exports.
- Minor contrast polish on legacy widgets.
- No server auto-start.
- Config is cached: re-cache after any `.env` change.
- Composer autoload optimisation was not run.

## 28. Future recommendations

1. Answer the GAV questions, then publish rule set `2026.1` as `verified` through a reviewed change, re-run the reconciliation tests against confirmed client examples, and release `rama-v1.0.0`.
2. Enter real contracts and Basisblatt data, and optionally import the opening balances from the client PDF after review.
3. Run a real-phone GPS acceptance test.
4. Add a queue worker for large exports.
5. Install the server as a Windows service.
6. Add the real logo.
