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

part of '../../scheduling_engine.dart';

/// One item in a placement queue.
///
/// [earliestStart] preserves a task's natural ordering constraint. For existing
/// scheduled tasks, this is usually their current start; for a pushed task, it is
/// the earliest time the push operation allows.
class _PlacementItem {
  /// Creates a `_PlacementItem` 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 _PlacementItem({
    required this.task,
    required this.duration,
    required this.earliestStart,
  });

  /// Task represented by this queue entry.
  final Task task;

  /// Duration the planner must reserve.
  final Duration duration;

  /// Earliest allowed start time for this item.
  final DateTime earliestStart;
}
