using EnvelopeGenerator.Application.Common.Dto; namespace EnvelopeGenerator.Application.Common.Interfaces.Services; /// /// Manages per-user UI preferences (theme, dark mode, grid layouts). /// Preferences are stored in the distributed cache (dbo.TBDD_CACHE) as JSON. /// Cache key schema: "signflow.user-preferences:{username}" /// public interface IUserPreferencesService { /// /// Retrieves preferences for the given user. /// Always returns a valid object — never throws, never returns null. /// Returns defaults if no entry exists in cache. /// /// /// Cancellation token. Task GetOrCreateAsync(string id, CancellationToken ct = default); /// /// Persists the given preferences for the user in the distributed cache. /// Failures are non-fatal and silently ignored. /// /// /// The preferences to persist. /// Cancellation token. Task SaveAsync(string id, UserPreferencesDto preferences, CancellationToken ct = default); }