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

part of '../../../scheduler_db.dart';

/// Committed application operation rows used for idempotency.
@DataClassName('ApplicationOperationRow')
class ApplicationOperations extends Table {
  /// Returns the derived `tableName` value for this object.
  /// Keeping this as an accessor gives callers a stable read surface while the owning type controls how the value is calculated.
  @override
  String get tableName => 'application_operations';

  /// Returns the derived `operationId` value for this object.
  /// Keeping this as an accessor gives callers a stable read surface while the owning type controls how the value is calculated.
  TextColumn get operationId => text().named('operation_id')();

  /// Returns the derived `ownerId` value for this object.
  /// Keeping this as an accessor gives callers a stable read surface while the owning type controls how the value is calculated.
  TextColumn get ownerId => text().named('owner_id')();

  /// Returns the derived `operationName` value for this object.
  /// Keeping this as an accessor gives callers a stable read surface while the owning type controls how the value is calculated.
  TextColumn get operationName => text().named('operation_name')();

  /// Returns the derived `committedAtUtc` value for this object.
  /// Keeping this as an accessor gives callers a stable read surface while the owning type controls how the value is calculated.
  DateTimeColumn get committedAtUtc => dateTime().named('committed_at_utc')();

  /// Returns the derived `primaryKey` value for this object.
  /// Keeping this as an accessor gives callers a stable read surface while the owning type controls how the value is calculated.
  @override
  Set<Column<Object>> get primaryKey => {operationId};
}
