refactor repositories

This commit is contained in:
shenlong-tanwen
2024-09-21 20:04:05 +05:30
parent d6495f014d
commit e810512285
23 changed files with 142 additions and 127 deletions
@@ -2,19 +2,19 @@ import 'dart:async';
import 'package:immich_mobile/domain/models/log.model.dart';
abstract class ILogRepository {
/// Fetches all logs
FutureOr<List<LogMessage>> fetchAll();
abstract interface class ILogRepository {
/// Inserts a new log into the DB
FutureOr<bool> add(LogMessage log);
FutureOr<bool> create(LogMessage log);
/// Bulk insert logs into DB
FutureOr<bool> addAll(List<LogMessage> log);
FutureOr<bool> createAll(List<LogMessage> log);
/// Fetches all logs
FutureOr<List<LogMessage>> getAll();
/// Clears all logs
FutureOr<bool> clear();
FutureOr<bool> deleteAll();
/// Truncates the logs to the most recent [limit]. Defaults to recent 250 logs
FutureOr<void> truncateLogs({int limit = 250});
FutureOr<void> truncate({int limit = 250});
}