diff --git a/configurations/env.fcm b/configurations/env.fcm index 341f7206d..847e2b365 100644 --- a/configurations/env.fcm +++ b/configurations/env.fcm @@ -1,6 +1,23 @@ -FIREBASE_ANDROID_API_KEY=example -FIREBASE_ANDROID_APP_ID=example -FIREBASE_ANDROID_MESSAGING_SENDER_ID=example -FIREBASE_ANDROID_PROJECT_ID=example -FIREBASE_ANDROID_DATABASE_URL=https://example.com -FIREBASE_ANDROID_STORAGE_BUCKET=example.com \ No newline at end of file +FIREBASE_ANDROID_API_KEY=AIzaSyDPn3T4BMShrcedtqzA-8Lh3Fsm1EGB7S8 +FIREBASE_ANDROID_APP_ID=1:611786135906:android:6fa64d94eb8f8603e3743b +FIREBASE_ANDROID_MESSAGING_SENDER_ID=611786135906 +FIREBASE_ANDROID_PROJECT_ID=fir-jmap-poc +FIREBASE_ANDROID_DATABASE_URL=https://fir-jmap-poc-default-rtdb.asia-southeast1.firebasedatabase.app +FIREBASE_ANDROID_STORAGE_BUCKET=fir-jmap-poc.appspot.com + +FIREBASE_IOS_API_KEY=AIzaSyA_fAC-6rVLsQtj8AXxRRYjwsOHCKPTm6w +FIREBASE_IOS_APP_ID=1:611786135906:ios:d8b0899dc058dd2ae3743b +FIREBASE_IOS_MESSAGING_SENDER_ID=611786135906 +FIREBASE_IOS_PROJECT_ID=fir-jmap-poc +FIREBASE_IOS_DATABASE_URL=https://fir-jmap-poc-default-rtdb.asia-southeast1.firebasedatabase.app +FIREBASE_IOS_STORAGE_BUCKET=fir-jmap-poc.appspot.com +FIREBASE_IOS_CLIENT_ID=611786135906-2nqn5c537eer6c95rcujmlfmldbkqfqb.apps.googleusercontent.com +FIREBASE_IOS_BUNDLE_ID=com.linagora.ios.teammail + +FIREBASE_WEB_API_KEY=AIzaSyABpxntIXA2u_uFFMT4wvHYMgVm7UZPMrM +FIREBASE_WEB_APP_ID=1:611786135906:web:22d98cfd47b4fddde3743b +FIREBASE_WEB_MESSAGING_SENDER_ID=611786135906 +FIREBASE_WEB_PROJECT_ID=fir-jmap-poc +FIREBASE_WEB_DATABASE_URL=https://fir-jmap-poc-default-rtdb.asia-southeast1.firebasedatabase.app +FIREBASE_WEB_STORAGE_BUCKET=fir-jmap-poc.appspot.com +FIREBASE_WEB_AUTH_DOMAIN=fir-jmap-poc.firebaseapp.com \ No newline at end of file diff --git a/lib/features/thread/domain/repository/thread_repository.dart b/lib/features/thread/domain/repository/thread_repository.dart index f82e836cc..806186a75 100644 --- a/lib/features/thread/domain/repository/thread_repository.dart +++ b/lib/features/thread/domain/repository/thread_repository.dart @@ -54,4 +54,8 @@ abstract class ThreadRepository { ); Future getEmailById(AccountId accountId, EmailId emailId, {Properties? properties}); + + Future storelastTimeDismissedSpamReport(DateTime lastTimeDismissedSpamReport); + + Future getlastTimeDismissedSpamReport(); } \ No newline at end of file diff --git a/lib/features/thread/domain/state/get_last_time_dismissed_spam_reported_state.dart b/lib/features/thread/domain/state/get_last_time_dismissed_spam_reported_state.dart new file mode 100644 index 000000000..b5246a9e8 --- /dev/null +++ b/lib/features/thread/domain/state/get_last_time_dismissed_spam_reported_state.dart @@ -0,0 +1,22 @@ +import 'package:core/presentation/state/failure.dart'; +import 'package:core/presentation/state/success.dart'; + +class GetLastTimeDismissedSpamReportLoading extends UIState {} + +class GetLastTimeDismissedSpamReportSuccess extends UIState { + final DateTime lastTimeDismissedSpamReport; + + GetLastTimeDismissedSpamReportSuccess(this.lastTimeDismissedSpamReport); + + @override + List get props => []; +} + +class GetLastTimeDismissedSpamReportFailure extends FeatureFailure { + final dynamic exception; + + GetLastTimeDismissedSpamReportFailure(this.exception); + + @override + List get props => [exception]; +} \ No newline at end of file diff --git a/lib/features/thread/domain/state/store_last_time_dismissed_spam_report_state.dart b/lib/features/thread/domain/state/store_last_time_dismissed_spam_report_state.dart new file mode 100644 index 000000000..7a9509984 --- /dev/null +++ b/lib/features/thread/domain/state/store_last_time_dismissed_spam_report_state.dart @@ -0,0 +1,21 @@ +import 'package:core/presentation/state/failure.dart'; +import 'package:core/presentation/state/success.dart'; + +class StoreLastTimeDismissedSpamReportLoading extends UIState {} + +class StoreLastTimeDismissedSpamReportSuccess extends UIState { + + StoreLastTimeDismissedSpamReportSuccess(); + + @override + List get props => []; +} + +class StoreLastTimeDismissedSpamReportFailure extends FeatureFailure { + final dynamic exception; + + StoreLastTimeDismissedSpamReportFailure(this.exception); + + @override + List get props => [exception]; +} \ No newline at end of file diff --git a/lib/features/thread/domain/usecases/get_last_time_dismissed_spam_reported_interactor.dart b/lib/features/thread/domain/usecases/get_last_time_dismissed_spam_reported_interactor.dart new file mode 100644 index 000000000..0baffdc35 --- /dev/null +++ b/lib/features/thread/domain/usecases/get_last_time_dismissed_spam_reported_interactor.dart @@ -0,0 +1,23 @@ +import 'package:core/presentation/state/failure.dart'; +import 'package:core/presentation/state/success.dart'; +import 'package:dartz/dartz.dart'; +import 'package:tmail_ui_user/features/thread/domain/repository/thread_repository.dart'; +import 'package:tmail_ui_user/features/thread/domain/state/get_last_time_dismissed_spam_reported_state.dart'; + +class GetLastTimeDismissedSpamReportInteractor { + final ThreadRepository _threadRepository; + + GetLastTimeDismissedSpamReportInteractor(this._threadRepository); + + Stream> execute( + DateTime lastTimeDismissedSpamReport) async* { + try { + yield Right(GetLastTimeDismissedSpamReportLoading()); + final lastTimeDismissedSpamReport = await _threadRepository.getlastTimeDismissedSpamReport(); + yield Right( + GetLastTimeDismissedSpamReportSuccess(lastTimeDismissedSpamReport)); + } catch (e) { + yield Left(GetLastTimeDismissedSpamReportFailure(e)); + } + } +} \ No newline at end of file diff --git a/lib/features/thread/domain/usecases/store_last_time_dismissed_spam_reported_interactor.dart b/lib/features/thread/domain/usecases/store_last_time_dismissed_spam_reported_interactor.dart new file mode 100644 index 000000000..34b51f702 --- /dev/null +++ b/lib/features/thread/domain/usecases/store_last_time_dismissed_spam_reported_interactor.dart @@ -0,0 +1,21 @@ +import 'package:core/presentation/state/failure.dart'; +import 'package:core/presentation/state/success.dart'; +import 'package:dartz/dartz.dart'; +import 'package:tmail_ui_user/features/thread/domain/repository/thread_repository.dart'; +import 'package:tmail_ui_user/features/thread/domain/state/store_last_time_dismissed_spam_report_state.dart'; + +class StoreLastTimeDismissedSpamReportInteractor { + final ThreadRepository _threadRepository; + + StoreLastTimeDismissedSpamReportInteractor(this._threadRepository); + + Stream> execute(DateTime lastTimeDismissedSpamReport) async* { + try { + yield Right(StoreLastTimeDismissedSpamReportLoading()); + await _threadRepository.storelastTimeDismissedSpamReport(lastTimeDismissedSpamReport); + yield Right(StoreLastTimeDismissedSpamReportSuccess()); + } catch (e) { + yield Left(StoreLastTimeDismissedSpamReportFailure(e)); + } + } +} \ No newline at end of file