Currently, get email flow and search email flow are using the same api/data source/repository methods.
To better separate the concern of each flow, and implement Search snippet, search email flow will now using different api/data source/repository methods.
The search email api method now combine Email/query, SearchSnippet/get and Email/get, which returns SearchEmailsResponse, extending EmailsResponse, with additional property SearchSnippet.
ThreadRepositoryImpl's searchEmails method, instead of using getAllEmail from data source, now use search email method and returning List<SearchEmail>, in which SearchEmail extends from Email with 2 additional properties String? searchSubject and String? searchPreview.
DoDs
[ ] Implement API, data source & repository layers
[ ] Write unit tests
[ ] Create SearchPresentationEmail extend PresentationEmail, with 2 additional properties String? searchSubject and String? searchPreview.
[ ] Write an extension of SearchEmail called toSearchPresentationEmail which transform SearchEmail to SearchPresentationEmail, and unit test this method
Description
get email
flow andsearch email
flow are using the same api/data source/repository methods.search email
flow will now using different api/data source/repository methods.search email
api method now combineEmail/query
,SearchSnippet/get
andEmail/get
, which returnsSearchEmailsResponse
, extendingEmailsResponse
, with additional propertySearchSnippet
.ThreadRepositoryImpl
'ssearchEmails
method, instead of usinggetAllEmail
from data source, now usesearch email
method and returningList<SearchEmail>
, in whichSearchEmail
extends fromEmail
with 2 additional propertiesString? searchSubject
andString? searchPreview
.DoDs
SearchPresentationEmail
extendPresentationEmail
, with 2 additional propertiesString? searchSubject
andString? searchPreview
.SearchEmail
calledtoSearchPresentationEmail
which transformSearchEmail
toSearchPresentationEmail
, and unit test this method