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
29 lines
1.7 KiB
Dart
29 lines
1.7 KiB
Dart
import '../../../models/sms_handler_settings.dart';
|
|
|
|
/// Абстрактный класс (интерфейс) для репозитория настроек обработки СМС.
|
|
/// Определяет контракт, по которому UI и бизнес-логика будут взаимодействовать
|
|
/// с данными о настройках, не зная деталей их реализации (Hive, Firebase, etc).
|
|
abstract class ISmsHandlerRepository {
|
|
/// Получает настройки обработки СМС для указанного пользователя.
|
|
///
|
|
Future<SmsHandlerSettings?> getSmsHandlerSettings();
|
|
|
|
/// Сохраняет или обновляет настройки обработки СМС для пользователя.
|
|
///
|
|
/// [settings] - Объект с настройками, который нужно сохранить.
|
|
Future<void> saveSmsHandlerSettings(SmsHandlerSettings settings);
|
|
|
|
/// Добавляет или обновляет правило для конкретного отправителя.
|
|
///
|
|
/// [userId] - ID пользователя.
|
|
/// [sender] - Идентификатор отправителя (например, 'SBERBANK').
|
|
/// [rule] - Правило обработки.
|
|
Future<void> saveRuleForSender(String sender, SmsProcessingRule rule);
|
|
|
|
/// Удаляет правило для конкретного отправителя.
|
|
///
|
|
/// [userId] - ID пользователя.
|
|
/// [sender] - Идентификатор отправителя, чье правило нужно удалить.
|
|
Future<void> deleteRuleForSender(String sender);
|
|
}
|