TF-1933 Add GetStoredSendingEmail interactor

(cherry picked from commit bcf27cbaa5fbc62767a82e658e543339c5197991)
This commit is contained in:
dab246
2023-06-27 21:50:44 +07:00
committed by Dat Vu
parent 04a8274b49
commit 2fcfc4ff0b
8 changed files with 108 additions and 6 deletions
@@ -219,4 +219,9 @@ class EmailDataSourceImpl extends EmailDataSource {
Future<List<SendingEmail>> deleteMultipleSendingEmail(AccountId accountId, UserName userName, List<String> sendingIds) {
throw UnimplementedError();
}
@override
Future<SendingEmail> getStoredSendingEmail(AccountId accountId, UserName userName, String sendingId) {
throw UnimplementedError();
}
}
@@ -279,4 +279,12 @@ class EmailHiveCacheDataSourceImpl extends EmailDataSource {
return await _sendingEmailCacheManager.deleteMultipleSendingEmail(accountId, userName, sendingIds);
}).catchError(_exceptionThrower.throwException);
}
@override
Future<SendingEmail> getStoredSendingEmail(AccountId accountId, UserName userName, String sendingId) {
return Future.sync(() async {
final sendingEmailCache = await _sendingEmailCacheManager.getStoredSendingEmail(accountId, userName, sendingId);
return sendingEmailCache.toSendingEmail();
}).catchError(_exceptionThrower.throwException);
}
}