TenantAtlas/specs/010-admin-templates/spec.md
ahmido 61b0b1bc23 feat(010): Administrative Templates – restore from PolicyVersion + version visibility (#13)
Problem: Restore nutzt bisher den Snapshot aus dem BackupSet (BackupItem). Wenn der Snapshot “unvollständig”/nicht der gewünschte Stand ist, landen nach Restore nur wenige Admin-Template-Settings in Intune.
Lösung:
Neue Action “Restore to Intune” direkt an einer konkreten PolicyVersion (inkl. Dry-Run Toggle) → reproduzierbarer Rollback auf exakt diese Version.
Restore-UI zeigt jetzt PolicyVersion-Nummer (version: X) in der Item-Auswahl + BackupSet Items Tabelle hat eine Version-Spalte.
Implementierung:
RestoreService::executeFromPolicyVersion() erzeugt dafür einen kleinen, temporären BackupSet+BackupItem aus der Version und startet einen normalen RestoreRun.
Pest-Test: PolicyVersionRestoreToIntuneTest.php
Specs/TODO:
Offene Follow-ups sind dokumentiert in tasks.md unter “Open TODOs (Follow-up)”.
QA (GUI):
Inventory → Policies → <Policy> → Versions → Restore to Intune (erst Dry-Run, dann Execute)
Backups & Restore → Restore Runs → Create (bei Items steht version: X)
Backups & Restore → Backup Sets → <Set> (Version-Spalte)
Tests: PolicyVersionRestoreToIntuneTest.php

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local>
Reviewed-on: #13
2025-12-30 01:50:05 +00:00

53 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Feature Specification: Administrative Templates (Group Policy Configurations) (010)
**Feature Branch**: `feat/010-admin-templates`
**Created**: 2025-12-29
**Status**: Draft
**Input**: `.specify/spec.md` (groupPolicyConfiguration scope), `references/IntuneManagement-master` (definitionValues/presentationValues pattern)
## Overview
Add reliable coverage for **Administrative Templates** (`groupPolicyConfiguration`) in the existing inventory/backup/version/restore flows.
Administrative Templates are not fully represented by the base entity alone; the effective policy settings live in:
- `definitionValues` (with expanded `definition`)
- `presentationValues` per definitionValue (with expanded `presentation`)
## In Scope
- Policy type: `groupPolicyConfiguration` (`deviceManagement/groupPolicyConfigurations`)
- Snapshot capture hydrates:
- `definitionValues?$expand=definition`
- `presentationValues?$expand=presentation` for each definitionValue
- Restore supports “snapshot as source of truth” for Admin Templates settings:
- delete existing definitionValues
- recreate definitionValues + presentationValues from snapshot
- UI shows a readable “Normalized settings” view for Admin Templates (definitions + values).
## Out of Scope (v1)
- Translating every ADMX value into Intune-portal-identical wording for every template
- Advanced partial-restore / per-setting selection
## User Scenarios & Testing *(mandatory)*
### User Story 1 — Inventory + readable view (P1)
As an admin, I can open an Administrative Template policy and see its effective configured settings (not only metadata).
**Acceptance**
1. Policy detail shows a structured list/table of configured settings (definition + value).
2. Policy Versions store the hydrated settings and render them in “Normalized settings”.
### User Story 2 — Backup/Version capture includes definition values (P1)
As an admin, a backup/version of an Administrative Template includes the `definitionValues` + `presentationValues`.
**Acceptance**
1. Backup payload contains `definitionValues` array.
2. Each definitionValue includes expanded `definition` and a `presentationValues` collection (when present).
### User Story 3 — Restore settings (P1)
As an admin, restoring an Administrative Template brings the target tenants definition values back to the snapshot state.
**Acceptance**
1. Restore deletes existing definitionValues before recreate.
2. Restore recreates definitionValues and their presentationValues.
3. Clear per-item audit outcomes on failures.