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

part of '../../time_contracts.dart';

/// Test/application clock with a fixed instant.
class FixedClock implements Clock {
  /// Creates a `FixedClock` 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 FixedClock(this.instant);

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

  /// Performs the `now` behavior for this scheduler component.
  /// The method provides a named entry point for this operation so callers do not need to know the lower-level state or persistence steps involved.
  @override
  DateTime now() => instant;
}
