This commit refactors the data repositories to remove user-specific filtering. It simplifies the data access logic by retrieving all data from the Hive boxes and removing the need to filter by `userId` in the repository methods. This change makes the app function in single-user mode and removes the need to manage multiple user contexts within the data layer. Specifically: - Removes `userId` parameter from repository methods. - Updates the setting repository to use fixed keys. - Removes user ID filtering from queries. - Removes user ID parameters from Cubits and Blocs - Updates initial data creation
17 lines
791 B
Dart
17 lines
791 B
Dart
import '/models/transaction_record.dart';
|
|
|
|
abstract class ITransactionRepository {
|
|
// Старые методы (возможно, будут использоваться реже или будут удалены в будущем)
|
|
Future<List<TransactionRecord>> getAll();
|
|
Future<TransactionRecord?> getById(String id);
|
|
Future<void> add(TransactionRecord transaction);
|
|
Future<void> update(TransactionRecord transaction);
|
|
Future<void> delete(String id);
|
|
Future<List<TransactionRecord>> getByDateRange(DateTime from, DateTime to);
|
|
Future<List<TransactionRecord>> getByCategory(String categoryId);
|
|
Future<List<TransactionRecord>> getByTag(String tagId);
|
|
|
|
/// Добавить список транзакций
|
|
Future<void> addAll(List<TransactionRecord> transactions);
|
|
}
|