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

part of '../sqlite_repositories.dart';

/// SQLite repository set exposed inside one application unit of work.
final class _SqliteApplicationRepositories
    implements core.ApplicationUnitOfWorkRepositories {
  /// Creates a repository set for [db].
  _SqliteApplicationRepositories(
    SchedulerDb db, {
    required String defaultOwnerId,
  })  : tasks = _SqliteApplicationTaskRepository(
          db,
          defaultOwnerId: defaultOwnerId,
        ),
        projects = _SqliteApplicationProjectRepository(
          db,
          defaultOwnerId: defaultOwnerId,
        ),
        lockedBlocks = _SqliteApplicationLockedBlockRepository(
          db,
          defaultOwnerId: defaultOwnerId,
        ),
        schedulingSnapshots = _SqliteApplicationSnapshotRepository(
          db,
          defaultOwnerId: defaultOwnerId,
        ),
        taskActivities = _SqliteApplicationTaskActivityRepository(
          db,
          defaultOwnerId: defaultOwnerId,
        ),
        projectStatistics = _SqliteApplicationProjectStatisticsRepository(
          db,
          defaultOwnerId: defaultOwnerId,
        ),
        ownerSettings = _SqliteApplicationOwnerSettingsRepository(db),
        noticeAcknowledgements =
            _SqliteApplicationNoticeAcknowledgementRepository(db),
        operations = _SqliteApplicationOperationRepository(db);

  /// Repository for task documents.
  @override
  final core.TaskRepository tasks;

  /// Repository for project profiles.
  @override
  final core.ProjectRepository projects;

  /// Repository for locked blocks and overrides.
  @override
  final core.LockedBlockRepository lockedBlocks;

  /// Repository for scheduling snapshots.
  @override
  final core.SchedulingSnapshotRepository schedulingSnapshots;

  /// Repository for task activity facts.
  @override
  final core.TaskActivityRepository taskActivities;

  /// Repository for project statistics aggregates.
  @override
  final core.ProjectStatisticsRepository projectStatistics;

  /// Repository for owner settings.
  @override
  final core.OwnerSettingsRepository ownerSettings;

  /// Repository for notice acknowledgements.
  @override
  final core.NoticeAcknowledgementRepository noticeAcknowledgements;

  /// Repository for committed application operations.
  @override
  final core.ApplicationOperationRepository operations;
}
