Repository navigation
[NMA-806] Merchants search results - #775
Conversation
| <!-- <item name="elevation">0dp</item>--> | ||
| <!-- <item name="android:windowTranslucentStatus">true</item>--> |
There was a problem hiding this comment.
will this be used later?
There was a problem hiding this comment.
Probably not, so I removed it. According to the design we have a shadow under appbar but not when the results panel is fully expanded. I'm not sure this will be easy to do, probably better to just leave the shadow always on, we'll see.
| import org.mockito.Mockito.mock | ||
|
|
||
|
|
||
| class ExploreViewModelTest { |
There was a problem hiding this comment.
I like the idea of adding tests.
HashEngineering
left a comment
There was a problem hiding this comment.
Source files are missing a license/copyright header at the top of the files. This can be added later.
| import org.dash.wallet.features.exploredash.data.model.MerchantFTS | ||
|
|
||
| @Dao | ||
| interface MerchantDao { |
There was a problem hiding this comment.
I don't think it's necessary to have the suspend modifier here in your Dao. From the MerchantRepository it appears the calls to these functions are also done in suspending functions; I believe it's a little bit redundant. I think it would have made sense to have this modifier here in the Dao if the functions in the repository were not suspending. In this case, we would have made the calls to these DAO functions in a dispatcher (an IO to be precise); as it is the case in our viewmodels.
Removing the suspending modifier here and leaving the repository as it is should just work fine
There was a problem hiding this comment.
Sorry, I didn't quite get it, MerchantRepository is for interacting with Firebase database, what does dao has to do with it?
Suspend functions in Dao exist so that you can call them from any context (including Main) and they don't block, because Room runs them in IO internally.
There was a problem hiding this comment.
Ok, I get what's the reason for this confusion. Let's discuss this in slack.
There was a problem hiding this comment.
Sorry got confused: I saw a repository implementation (FirebaseMerchantTable) and I now understand it's for firebase and not for local DB
| } | ||
|
|
||
| @Entity(tableName = "merchant") | ||
| data class Merchant( |
There was a problem hiding this comment.
If the variable name is the same as the property name, there's no need to specify it again
There was a problem hiding this comment.
It's not, it's lowercase.
There was a problem hiding this comment.
my bad didn't notice it
|
|
||
| package org.dash.wallet.features.exploredash.di | ||
|
|
||
| import dagger.Binds |
There was a problem hiding this comment.
Perhaps in the future, for consistency, we could agree on naming the implementation of our interfaces directly from the name of the implemented interface. i.e something like this: MerchantRepositoryInt -> MerchantRepositoryImpl
There was a problem hiding this comment.
I'm not a fan of InterfaceImpl convention as it's not informative. MerchantRepository interface describes methods for retrieving merchants, but the specific implementations can use Firebase, can do REST requests, or use local SQLite db, therefore implementing class has to describe this in its name and not just repeat interface name.
There was a problem hiding this comment.
Forgot that there are 3 data sources here
|
@HashEngineering I'm good with the review as well |
Search results and filters for merchants in the Explore Dash feature.
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: