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

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

/// Backlog task paired with its source-list position for stable sorting.
class _IndexedTask {
  /// Creates a `_IndexedTask` instance with the values required by its invariants.
  /// Callers should pass already-normalized scheduler data because validation and defaulting belong at the model or service boundary, not in arbitrary UI code.
  const _IndexedTask({
    required this.task,
    required this.originalIndex,
  });

  /// Stores the `task` value for this object.
  /// This field is part of the explicit state that downstream scheduling, persistence, or UI code reads when composing behavior.
  final Task task;

  /// Stores the `originalIndex` value for this object.
  /// This field is part of the explicit state that downstream scheduling, persistence, or UI code reads when composing behavior.
  final int originalIndex;
}
