Created
April 16, 2018 10:47
-
-
Save cdsap/86062477ba9a335cb5496ac1bc9d21b6 to your computer and use it in GitHub Desktop.
SyncTrades Server
This file contains 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(private val localRepository: GetTradesRepository, | |
private val remoteRepository: GetTradesRepository) : SyncTrades { | |
override fun syncTrades(id: Long) { | |
remoteRepository.getTrades(id).trades | |
.map { TradeStore(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