# Implementation Plan: Apps (008)

**Branch**: `feat/008-apps-app-management`  
**Date**: 2025-12-29  
**Spec Source**: [spec.md](./spec.md)

## Summary
Make `mobileApp` reliable in the existing Policy/Backup/Restore flows by:

- Extending Graph contract registry with app assignment endpoints and a realistic `@odata.type` family.
- Enforcing metadata-only snapshots during capture (contract-driven filtering).
- Adding targeted Pest tests for contracts + snapshot behavior.

## Execution Steps
1. Update `config/graph_contracts.php` for `mobileApp`:
   - Add assignments list + assign action endpoints and payload key.
   - Expand `type_family` using known app types.
2. Update `app/Services/Intune/PolicySnapshotService.php`:
   - For metadata-only types, request/select and persist only metadata keys (even if Graph falls back).
3. Add/extend tests:
   - `tests/Unit/GraphContractRegistryActualDataTest.php` for `mobileApp` contract coverage.
   - `tests/Unit/PolicySnapshotServiceTest.php` for metadata-only filtering behavior.
4. Run formatting + tests:
   - `./vendor/bin/pint --dirty`
   - `./vendor/bin/sail artisan test tests/Unit/GraphContractRegistryActualDataTest.php tests/Unit/PolicySnapshotServiceTest.php`

