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

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

/// Result from logging a surprise task.
class SurpriseTaskLogResult {
  /// Creates a `SurpriseTaskLogResult` 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 SurpriseTaskLogResult({
    required this.surpriseTask,
    required this.schedulingResult,
    this.activities = const <TaskActivity>[],
    this.requiredOverlaps = const <SchedulingOverlap>[],
    this.lockedOverlaps = const <TimeInterval>[],
    this.usedNormalPushRules = false,
  });

  /// Newly created completed surprise task.
  final Task surpriseTask;

  /// Updated task list, movement notices, changes, and visible overlaps.
  final SchedulingResult schedulingResult;

  /// Internal activities produced by logging the surprise task.
  final List<TaskActivity> activities;

  /// Critical/inflexible overlaps with the surprise interval.
  final List<SchedulingOverlap> requiredOverlaps;

  /// Locked overlaps tracked separately so they stay hidden by default.
  final List<TimeInterval> lockedOverlaps;

  /// Whether flexible movement was delegated to normal push behavior.
  final bool usedNormalPushRules;
}
