add full sync

This commit is contained in:
shenlong-tanwen
2024-09-02 02:16:47 +05:30
parent 877c3b028b
commit e81b61c98b
30 changed files with 333 additions and 179 deletions
@@ -1,10 +0,0 @@
abstract class IDatabaseRepository<T> {
/// Current version of the DB to aid with migration
int get schemaVersion;
/// Initializes the DB and returns the corresponding object
T init();
/// Check and migrate the DB to the latest schema
void migrateDB();
}
@@ -4,7 +4,7 @@ import 'package:immich_mobile/domain/models/log.model.dart';
abstract class ILogRepository {
/// Fetches all logs
FutureOr<List<LogMessage>> fetchLogs();
FutureOr<List<LogMessage>> fetchAll();
/// Inserts a new log into the DB
FutureOr<bool> add(LogMessage log);
@@ -0,0 +1,6 @@
import 'package:immich_mobile/domain/models/asset/remote_asset.model.dart';
abstract class IRemoteAssetRepository {
/// Batch insert asset
Future<bool> addAll(Iterable<RemoteAsset> assets);
}
@@ -4,8 +4,8 @@ import 'package:immich_mobile/domain/models/user.model.dart';
abstract class IUserRepository {
/// Fetches user
FutureOr<User?> getUser(String userId);
FutureOr<User?> fetch(String userId);
/// Insert user
FutureOr<bool> insertUser(User user);
FutureOr<bool> add(User user);
}