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

part of '../../task_actions.dart';

/// Result from applying a selected push destination.
///
/// The selected destination is included next to the [SchedulingResult] so UI and
/// tests can distinguish "moved later today" from "moved to tomorrow" even if
/// the low-level scheduling change shape is similar.
class PushDestinationResult {
  /// Creates a `PushDestinationResult` 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.
  PushDestinationResult({
    required this.destination,
    required this.schedulingResult,
    List<TaskActivity> activities = const <TaskActivity>[],
  }) : activities = List<TaskActivity>.unmodifiable(activities);

  /// Destination that was applied.
  final PushDestination destination;

  /// Full scheduler output: updated tasks, notices, changes, and overlaps.
  final SchedulingResult schedulingResult;

  /// Internal activities produced by applying the selected destination.
  final List<TaskActivity> activities;

  /// Convenience flag for UI copy or persistence behavior that cares about the
  /// tomorrow queue specifically.
  bool get placesAtTomorrowTopOfQueue {
    return destination == PushDestination.tomorrowTopOfQueue;
  }
}
