Audit finding
ConfigurationUseCases and VisualProfileUseCases are intentionally thin, but they repeat the same infrastructure around SettingsCoordinator:
- storing and validating the coordinator;
- exposing a defensive snapshot;
- forwarding the
Changed event;
- wrapping domain mutations in
Commit;
- returning closely related commit-result shapes.
SettingsCoordinator.Commit and PersistCurrent also repeat expected-exception classification and persistence failure handling.
The duplication is small, but it is transaction plumbing rather than product behavior and is likely to spread as additional configuration use cases are added.
Target state
Introduce one lightweight reusable transaction context/helper for application use cases and one private persistence execution path inside SettingsCoordinator.
Prefer composition and private helpers. Do not create a deep use-case inheritance hierarchy or generic command framework.
Acceptance criteria
Audit finding
ConfigurationUseCasesandVisualProfileUseCasesare intentionally thin, but they repeat the same infrastructure aroundSettingsCoordinator:Changedevent;Commit;SettingsCoordinator.CommitandPersistCurrentalso repeat expected-exception classification and persistence failure handling.The duplication is small, but it is transaction plumbing rather than product behavior and is likely to spread as additional configuration use cases are added.
Target state
Introduce one lightweight reusable transaction context/helper for application use cases and one private persistence execution path inside
SettingsCoordinator.Prefer composition and private helpers. Do not create a deep use-case inheritance hierarchy or generic command framework.
Acceptance criteria
Commitstill publishes exactly once only after persistence succeeds.PersistCurrentpreserves its current no-change-event behavior unless an explicit product decision changes it.