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

part of '../../document_mapping.dart';

/// Common metadata decoded from a V1 top-level document.
class DocumentMetadata {
  /// Creates a `DocumentMetadata` 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 DocumentMetadata({
    required this.id,
    required this.ownerId,
    required this.revision,
    required this.createdAt,
    required this.updatedAt,
  });

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

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

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

  /// Stores the `createdAt` 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 createdAt;

  /// Stores the `updatedAt` 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 updatedAt;
}
