app / de.uniks.codliners.stock_simulator.database / AccountDao

AccountDao

interface AccountDao

Dao that manages account entities in the database.

Author
Juri Lozowoj

Author
Jan Müller

Functions

deleteBalances

Deletes all Balances from the database.

abstract fun deleteBalances(): Unit

deleteDepot

Deletes all DepotQuotePurchases from the database.

abstract fun deleteDepot(): Unit

deleteDepotQuoteById

Deletes the DepotQuotePurchase with matching id from the database.

abstract fun deleteDepotQuoteById(id: String): Unit

deleteDepotQuotes

Deletes the given DepotQuotePurchases from the database.

abstract fun deleteDepotQuotes(vararg depotPurchase: DepotQuotePurchase): Unit

deleteDepotValues

Deletes all DepotValues from the database.

abstract fun deleteDepotValues(): Unit

getBalanceCount

Returns the amount Long of stored Balances.

abstract fun getBalanceCount(): Long

getBalancesLimited

Returns a limited amount of stored Balances.

abstract fun getBalancesLimited(limit: Int): LiveData<List<Balance>>

getDepotQuoteById

Returns the DepotQuotePurchase with the matching id.

abstract fun getDepotQuoteById(id: String): DepotQuotePurchase?

getDepotQuotePurchasesByIdOrderedByPrice

Returns the DepotQuotePurchases with the matching id as a List, in ascending order of their buying price.

abstract fun getDepotQuotePurchasesByIdOrderedByPrice(id: String): List<DepotQuotePurchase>

getDepotQuotePurchasesValuesOrderedByPrice

Returns all DepotQuotePurchases as a List, in ascending order of their buying price.

abstract fun getDepotQuotePurchasesValuesOrderedByPrice(): List<DepotQuotePurchase>

getDepotQuotes

Returns all DepotQuotes as a List, wrapped in LiveData. Conflates all DepotQuotePurchases with the same id String, symbol String, type Symbol.Type and returns them as DepotQuotes, whereby their amount Double is added up and the mean buyingPrice Double is bid from the buyingPrices Double.

abstract fun getDepotQuotes(): LiveData<List<DepotQuote>>

getDepotQuoteWithId

Returns the DepotQuote with the matching id, wrapped in LiveData. Conflates all DepotQuotePurchases with the matching id and returns them as one DepotQuote, whereby the amount Double is added up and the mean buyingPrice Double is bid from the buyingPrices Double.

abstract fun getDepotQuoteWithId(id: String): LiveData<DepotQuote>

getDepotValuesLimited

Returns the last {limit} DepotValues as a List, wrapped in LiveData.

abstract fun getDepotValuesLimited(limit: Int): LiveData<List<DepotValue>>

getLatestBalance

Returns the latest Balance, wrapped in LiveData.

abstract fun getLatestBalance(): LiveData<Balance>

getLatestBalanceValue

Returns the latest Balance.

abstract fun getLatestBalanceValue(): Balance

getLatestDepot

Returns the latest DepotValue.

abstract fun getLatestDepot(): DepotValue

getLatestDepotValue

Returns the latest DepotValue.

abstract fun getLatestDepotValue(): LiveData<DepotValue>

insertBalance

Inserts a Balance into the database.

abstract fun insertBalance(balance: Balance): Unit

insertDepotQuote

Inserts a DepotQuotePurchase into the database.

abstract fun insertDepotQuote(depotPurchase: DepotQuotePurchase): Unit

insertDepotValue

Inserts a DepotValue into the database.

abstract fun insertDepotValue(depotValue: DepotValue): Unit