// SPDX-FileCopyrightText: 2026 FocusFlow contributors
// SPDX-License-Identifier: AGPL-3.0-only

part of '../../persistence.dart';

/// Repository contract for owner settings.
abstract interface class SettingsRepository {
  /// Return settings for [ownerId], or null when no settings have been saved.
  Future<RepoResult<core.OwnerSettings?>> findByOwner({
    required core.OwnerId ownerId,
  });

  /// Insert [settings] for [ownerId] and return the assigned revision.
  Future<RepoResult<core.Revision>> insert({
    required core.OwnerId ownerId,
    required core.OwnerSettings settings,
  });

  /// Save [settings] if [expectedRevision] still matches the stored record.
  Future<RepoResult<core.Revision>> save({
    required core.OwnerId ownerId,
    required core.OwnerSettings settings,
    required core.Revision expectedRevision,
  });
}
