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

part of '../../application_layer.dart';

/// Persisted exactly-once operation record.
class ApplicationOperationRecord {
  /// Creates a `ApplicationOperationRecord` 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.
  ApplicationOperationRecord({
    required String operationId,
    required String ownerId,
    required String operationName,
    required this.committedAt,
  })  : operationId = _requiredTrimmed(operationId, 'operationId'),
        ownerId = _requiredTrimmed(ownerId, 'ownerId'),
        operationName = _requiredTrimmed(operationName, 'operationName');

  /// Exactly-once operation id.
  final String operationId;

  /// Authorization-neutral owner scope.
  final String ownerId;

  /// Stable use-case/command label.
  final String operationName;

  /// Commit instant.
  final DateTime committedAt;
}
