SF-74: Domain/Application — UserPreferences DTO, interface, Sender role constant

This commit is contained in:
2026-09-03 14:57:21 +02:00
parent 7fc2c14f9c
commit 0fdfe991ea
3 changed files with 23 additions and 5 deletions

View File

@@ -14,16 +14,16 @@ public interface IUserPreferencesService
/// Always returns a valid object — never throws, never returns null.
/// Returns defaults if no entry exists in cache.
/// </summary>
/// <param name="username">The sender's username (ClaimTypes.Name from JWT).</param>
/// <param name="id"></param>
/// <param name="ct">Cancellation token.</param>
Task<UserPreferencesDto> GetAsync(string username, CancellationToken ct = default);
Task<UserPreferencesDto> GetOrCreateAsync(string id, CancellationToken ct = default);
/// <summary>
/// Persists the given preferences for the user in the distributed cache.
/// Failures are non-fatal and silently ignored.
/// </summary>
/// <param name="username">The sender's username (ClaimTypes.Name from JWT).</param>
/// <param name="id"></param>
/// <param name="preferences">The preferences to persist.</param>
/// <param name="ct">Cancellation token.</param>
Task SaveAsync(string username, UserPreferencesDto preferences, CancellationToken ct = default);
Task SaveAsync(string id, UserPreferencesDto preferences, CancellationToken ct = default);
}