Files
tm_app/lib/data/repositories/notification_repository.dart
T
2025-09-27 14:57:42 +03:30

43 lines
1.2 KiB
Dart

// notification_repository.dart
import 'package:tm_app/core/utils/result.dart';
import 'package:tm_app/data/services/model/notification__response/notification_response_model.dart';
import 'package:tm_app/data/services/notification_service.dart';
class NotificationsRepository {
NotificationsRepository({required NotificationsService notificationsService})
: _notificationsService = notificationsService;
final NotificationsService _notificationsService;
Future<Result<NotificationResponseModel>> getNotifications({
required int limit,
required int offset,
}) async {
return _notificationsService.getNotifications(limit: limit, offset: offset);
}
Future<Result<Map<String, dynamic>>> markAllAsRead() async {
return _notificationsService.markAllAsRead();
}
Future<Result<NotificationResponseModel>> getUnreadNotifications({
required int limit,
required int offset,
}) {
return _notificationsService.getUnreadNotifications(
limit: limit,
offset: offset,
);
}
Future<Result<NotificationResponseModel>> getImportantNotifications({
required int limit,
required int offset,
}) {
return _notificationsService.getImportantNotifications(
limit: limit,
offset: offset,
);
}
}