Files
Sharepoint-Toolbox/.planning/phases/10-branding-data-foundation/10-03-PLAN.md
Dev 1ffd71243e docs(10): create phase plan - 3 plans in 2 waves
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 11:50:59 +02:00

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
10-01
10-02
SharepointToolbox/App.xaml.cs
true
BRAND-01
BRAND-03
BRAND-06
truths artifacts key_links
BrandingRepository, BrandingService, and GraphUserDirectoryService are resolved by DI without runtime errors
The full test suite passes including all new and existing tests
path provides contains
SharepointToolbox/App.xaml.cs DI registration for Phase 10 services BrandingRepository
from to via pattern
SharepointToolbox/App.xaml.cs SharepointToolbox/Infrastructure/Persistence/BrandingRepository.cs AddSingleton registration BrandingRepository.*branding.json
from to via pattern
SharepointToolbox/App.xaml.cs SharepointToolbox/Services/BrandingService.cs AddSingleton registration AddSingleton<BrandingService>
from to via pattern
SharepointToolbox/App.xaml.cs SharepointToolbox/Services/GraphUserDirectoryService.cs AddTransient registration IGraphUserDirectoryService.*GraphUserDirectoryService
Register all Phase 10 services in the DI container and run the full test suite to confirm no regressions.

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.md

From 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>();
Task 1: Register Phase 10 services in DI and run full test suite SharepointToolbox/App.xaml.cs 1. Open `SharepointToolbox/App.xaml.cs` and locate the `RegisterServices` method.
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>
After completion, create `.planning/phases/10-branding-data-foundation/10-03-SUMMARY.md`