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

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

/// Bounded diagnostic schedule snapshots.
@DataClassName('SnapshotRow')
class Snapshots extends Table {
  /// Returns the derived `id` 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 id => text()();

  /// 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 `capturedAtUtc` 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 capturedAtUtc => dateTime().named('captured_at_utc')();

  /// 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').nullable()();

  /// Returns the derived `sourceDate` 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 sourceDate => text().named('source_date').nullable()();

  /// Returns the derived `targetDate` 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 targetDate => text().named('target_date').nullable()();

  /// Converts scheduler data for `windowJson` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  TextColumn get windowJson => text().named('window_json')();

  /// Converts scheduler data for `tasksJson` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  TextColumn get tasksJson => text().named('tasks_json')();

  /// Converts scheduler data for `lockedIntervalsJson` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  TextColumn get lockedIntervalsJson => text().named('locked_intervals_json')();

  /// Converts scheduler data for `requiredVisibleIntervalsJson` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  TextColumn get requiredVisibleIntervalsJson =>
      text().named('required_visible_intervals_json')();

  /// Converts scheduler data for `noticesJson` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  TextColumn get noticesJson => text().named('notices_json')();

  /// Converts scheduler data for `changesJson` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  TextColumn get changesJson => text().named('changes_json')();

  /// Converts scheduler data for `overlapsJson` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  TextColumn get overlapsJson => text().named('overlaps_json')();

  /// Returns the derived `retentionExpiresUtc` 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 retentionExpiresUtc =>
      dateTime().named('retention_expires_utc')();

  /// Returns the derived `truncated` 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.
  BoolColumn get truncated => boolean()();

  /// Returns the derived `revision` 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.
  IntColumn get revision => integer()();

  /// Returns the derived `createdAtUtc` 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 createdAtUtc => dateTime().named('created_at_utc')();

  /// Returns the derived `updatedAtUtc` 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 updatedAtUtc => dateTime().named('updated_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 => {id};
}
