Problem
Several entity fields use raw string for domain concepts that have strongly-typed wrappers already defined in Persistence/ValueObjects/ with registered converters in SqliteTypeConverters:
| Entity |
Field |
Should be |
SyncRuleEntity |
RemotePath (string) |
RemotePath |
SyncedItemEntity |
RemotePath (string) |
RemotePath |
SyncedItemEntity |
LocalPath (string) |
LocalPath |
SyncJobEntity |
RemotePath (string) |
RemotePath |
SyncJobEntity |
LocalPath (string) |
LocalPath |
SyncConflictEntity |
RemoteItemId (string) |
OneDriveItemId |
Also: SyncConflictEntity.State, SyncJobEntity.Status, and SyncJobEntity.JobType are raw strings with values like "Pending" / "Resolved" / "Download" / "Upload". These should be enums (SyncConflictState, SyncJobStatus, SyncJobType) with HasConversion<string>() in the entity configurations. This removes the private string constants scattered in SyncRepository.cs (lines 12–14).
Additionally: FileClassificationRuleEntity.Id and SyncedItemClassificationEntity.Id use raw string as primary key with no strongly-typed wrapper. Define FileClassificationRuleId and SyncedItemClassificationId wrappers and update entity, configuration, and IFileClassificationRuleRepository.DeleteAsync signature.
Required fix
For each entity:
- Change the property type to the wrapper
- Add
HasConversion(SqliteTypeConverters.XxxConverter) in the entity's IEntityTypeConfiguration class
- Update all repository methods that query or filter on these fields
For the enum cases:
- Define the enums in the
Persistence/Entities/ folder
- Apply
HasConversion<string>() in entity configs
- Remove the private string constants from
SyncRepository
Rule reference
@.claude/rules/onedrive-persistence.md — Strongly-typed domain value types + EF Core value converter registration
Problem
Several entity fields use raw
stringfor domain concepts that have strongly-typed wrappers already defined inPersistence/ValueObjects/with registered converters inSqliteTypeConverters:SyncRuleEntityRemotePath(string)RemotePathSyncedItemEntityRemotePath(string)RemotePathSyncedItemEntityLocalPath(string)LocalPathSyncJobEntityRemotePath(string)RemotePathSyncJobEntityLocalPath(string)LocalPathSyncConflictEntityRemoteItemId(string)OneDriveItemIdAlso:
SyncConflictEntity.State,SyncJobEntity.Status, andSyncJobEntity.JobTypeare raw strings with values like"Pending"/"Resolved"/"Download"/"Upload". These should be enums (SyncConflictState,SyncJobStatus,SyncJobType) withHasConversion<string>()in the entity configurations. This removes the private string constants scattered inSyncRepository.cs(lines 12–14).Additionally:
FileClassificationRuleEntity.IdandSyncedItemClassificationEntity.Iduse rawstringas primary key with no strongly-typed wrapper. DefineFileClassificationRuleIdandSyncedItemClassificationIdwrappers and update entity, configuration, andIFileClassificationRuleRepository.DeleteAsyncsignature.Required fix
For each entity:
HasConversion(SqliteTypeConverters.XxxConverter)in the entity'sIEntityTypeConfigurationclassFor the enum cases:
Persistence/Entities/folderHasConversion<string>()in entity configsSyncRepositoryRule reference
@.claude/rules/onedrive-persistence.md— Strongly-typed domain value types + EF Core value converter registration