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

part of '../../backlog.dart';

/// Sort options for a unified backlog list.
///
/// Sort keys are intentionally product-facing rather than database-facing. For
/// example, `rewardVsEffort` maps to a simple derived score instead of a stored
/// field. Persistence can later index the underlying fields if needed.
enum BacklogSortKey {
  /// Preserve the source/read-model order supplied by persistence.
  custom,

  /// Highest priority first.
  priority,

  /// Best simple reward-minus-difficulty score first.
  rewardVsEffort,

  /// Oldest created task first.
  age,

  /// Lexicographic project id grouping. Future UI can replace this with project
  /// display order while keeping the same public key.
  project,

  /// Most frequently pushed tasks first.
  timesPushed,

  /// Shortest estimated duration first, with missing estimates last.
  duration,
}
