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

part of '../../today_state.dart';

/// Pending notice data surfaced through Today state.
class TodayPendingNotice {
  /// Creates a `TodayPendingNotice` 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.
  TodayPendingNotice({
    required this.noticeId,
    required this.snapshotId,
    required this.capturedAt,
    required this.message,
    required this.type,
    required Map<String, Object?> parameters,
    this.taskId,
    this.issueCode,
    this.movementCode,
    this.conflictCode,
  }) : parameters = Map<String, Object?>.unmodifiable(parameters);

  /// Stable id for acknowledgement/consume commands.
  final String noticeId;

  /// Source snapshot id.
  final String snapshotId;

  /// Snapshot capture time.
  final DateTime capturedAt;

  /// Existing neutral scheduler message. UI may localize from codes later.
  final String message;

  /// Notice category.
  final SchedulingNoticeType type;

  /// Related task id, if any.
  final String? taskId;

  /// Stable issue code, if any.
  final SchedulingIssueCode? issueCode;

  /// Stable movement code, if any.
  final SchedulingMovementCode? movementCode;

  /// Stable conflict code, if any.
  final SchedulingConflictCode? conflictCode;

  /// Structured notice parameters.
  final Map<String, Object?> parameters;
}
