diff --git a/lib/features/push_notification/data/datasource/fcm_datasource.dart b/lib/features/push_notification/data/datasource/fcm_datasource.dart index 2c148e08b..2a13c25b3 100644 --- a/lib/features/push_notification/data/datasource/fcm_datasource.dart +++ b/lib/features/push_notification/data/datasource/fcm_datasource.dart @@ -1,5 +1,7 @@ +import 'package:fcm/model/type_name.dart'; import 'package:model/fcm/fcm_token_dto.dart'; +import 'package:jmap_dart_client/jmap/core/state.dart' as jmap; abstract class FCMDatasource { Future getFCMToken(String accountId); @@ -7,4 +9,10 @@ abstract class FCMDatasource { Future setFCMToken(FCMTokenDto fcmToken); Future deleteFCMToken(String accountId); + + Future storeStateToRefresh(TypeName typeName, jmap.State newState); + + Future getStateToRefresh(TypeName typeName); + + Future deleteStateToRefresh(TypeName typeName); } \ No newline at end of file diff --git a/lib/features/push_notification/domain/repository/fcm_repository.dart b/lib/features/push_notification/domain/repository/fcm_repository.dart index f8b759d34..596a56d79 100644 --- a/lib/features/push_notification/domain/repository/fcm_repository.dart +++ b/lib/features/push_notification/domain/repository/fcm_repository.dart @@ -1,4 +1,9 @@ +import 'package:fcm/model/type_name.dart'; +import 'package:jmap_dart_client/jmap/account_id.dart'; +import 'package:jmap_dart_client/jmap/core/properties/properties.dart'; import 'package:model/fcm/fcm_token_dto.dart'; +import 'package:tmail_ui_user/features/thread/domain/model/email_response.dart'; +import 'package:jmap_dart_client/jmap/core/state.dart' as jmap; abstract class FCMRepository { Future getFCMToken(String accountId); @@ -6,4 +11,19 @@ abstract class FCMRepository { Future setFCMToken(FCMTokenDto fcmTokenDto); Future deleteFCMToken(String accountId); + + Future getEmailChangesToPushNotification( + AccountId accountId, + jmap.State currentState, + { + Properties? propertiesCreated, + Properties? propertiesUpdated + } + ); + + Future storeStateToRefresh(TypeName typeName, jmap.State newState); + + Future getStateToRefresh(TypeName typeName); + + Future deleteStateToRefresh(TypeName typeName); } \ No newline at end of file