Last active
April 16, 2018 11:29
-
-
Save cdsap/4cf62217ec0f3b588f2c6ce6afd17533 to your computer and use it in GitHub Desktop.
SyncTradesImpl. Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SyncTradesImpl @Inject constructor(@Named("remote") private val remoteRepository: GetTradesRepository, | |
| @Named("local") private val localRepository: GetTradesRepository) | |
| : SyncTrades { | |
| override fun syncTrades(id: Long) { | |
| remoteRepository.getTrades(id).trades | |
| .map { TradeDb(it.trade_id, it.rate, it.amount, it.trade_date, it.trade_type) } | |
| .map { localRepository.save(it) } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment