Problem
Domain/OneDriveAccount.cs line 18: public string? DriveId { get; init; }. The DriveId wrapper (readonly record struct from Persistence/ValueObjects/DriveId) exists and has a registered converter. Using raw string? here is primitive obsession and is the direct cause of the ?? string.Empty guard needed in AccountOnboardingService.
Required fix
// Domain/OneDriveAccount.cs
public DriveId? DriveId { get; init; }
Update all call sites: AuthService, AccountOnboardingService, WorkspaceViewModel, AddAccountWizardViewModel. With a typed DriveId?, the null guard in onboarding becomes cleaner:
if (account.DriveId is null)
return new Fail<OneDriveAccount, PersistenceError>(
PersistenceErrorFactory.Unexpected("Cannot onboard account: DriveId is missing."));
Rule reference
@.claude/rules/onedrive-persistence.md — Required domain value types table
Problem
Domain/OneDriveAccount.csline 18:public string? DriveId { get; init; }. TheDriveIdwrapper (readonly record structfromPersistence/ValueObjects/DriveId) exists and has a registered converter. Using rawstring?here is primitive obsession and is the direct cause of the?? string.Emptyguard needed inAccountOnboardingService.Required fix
Update all call sites:
AuthService,AccountOnboardingService,WorkspaceViewModel,AddAccountWizardViewModel. With a typedDriveId?, the null guard in onboarding becomes cleaner:Rule reference
@.claude/rules/onedrive-persistence.md— Required domain value types table