5.6 KiB
5.6 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 10-branding-data-foundation | 03 | execute | 2 |
|
|
true |
|
|
Purpose: Without DI registration, none of the new services are available at runtime. This plan wires BrandingRepository, BrandingService, and GraphUserDirectoryService into App.xaml.cs following established patterns.
Output: Updated App.xaml.cs with Phase 10 DI registrations. Full test suite green.
<execution_context> @C:/Users/dev/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/dev/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/10-branding-data-foundation/10-01-SUMMARY.md @.planning/phases/10-branding-data-foundation/10-02-SUMMARY.mdFrom SharepointToolbox/App.xaml.cs:
private static void RegisterServices(HostBuilderContext ctx, IServiceCollection services)
{
var appData = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"SharepointToolbox");
services.AddSingleton(_ => new ProfileRepository(Path.Combine(appData, "profiles.json")));
services.AddSingleton(_ => new SettingsRepository(Path.Combine(appData, "settings.json")));
services.AddSingleton<MsalClientFactory>();
services.AddSingleton<SessionManager>();
// ... more registrations ...
services.AddSingleton<GraphClientFactory>();
// ... more registrations ...
}
From 10-RESEARCH.md Pattern 7:
// Phase 10: Branding Data Foundation
services.AddSingleton(_ => new BrandingRepository(Path.Combine(appData, "branding.json")));
services.AddSingleton<IBrandingService, BrandingService>();
services.AddTransient<IGraphUserDirectoryService, GraphUserDirectoryService>();
2. Add a new section comment and three registrations AFTER the existing `SettingsRepository` registration (around line 79) and BEFORE the `MsalClientFactory` line. Place them logically with the other repository/service registrations:
```csharp
// Phase 10: Branding Data Foundation
services.AddSingleton(_ => new BrandingRepository(Path.Combine(appData, "branding.json")));
services.AddSingleton<IBrandingService, BrandingService>();
services.AddTransient<IGraphUserDirectoryService, GraphUserDirectoryService>();
```
3. Add the necessary `using` statements at the top of the file if not already present:
- `using SharepointToolbox.Infrastructure.Persistence;` (likely already present for ProfileRepository/SettingsRepository)
- `using SharepointToolbox.Services;` (likely already present for other service registrations)
4. Rationale for lifetimes per RESEARCH:
- `BrandingRepository`: Singleton — single file, shared SemaphoreSlim lock (same as ProfileRepository and SettingsRepository).
- `BrandingService` (as `IBrandingService`): Singleton — stateless after construction, depends on singleton repository.
- `GraphUserDirectoryService` (as `IGraphUserDirectoryService`): Transient — stateless, per-call usage, different tenants.
5. Build and run the full test suite to confirm zero regressions:
```bash
dotnet build --no-restore -warnaserror
dotnet test
```
dotnet build --no-restore -warnaserror && dotnet test
App.xaml.cs has Phase 10 DI registrations. Full build succeeds with zero warnings. Full test suite passes with zero failures.
```bash
dotnet build --no-restore -warnaserror
dotnet test
```
Both must succeed. Zero warnings, zero test failures. This is the phase gate.
<success_criteria>
- App.xaml.cs registers BrandingRepository (Singleton, branding.json), IBrandingService/BrandingService (Singleton), IGraphUserDirectoryService/GraphUserDirectoryService (Transient)
- Full build passes with -warnaserror
- Full test suite passes (all existing + all new tests) </success_criteria>