Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Realated transaction repository functions were not loading, now added #3649

Closed
wants to merge 5 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,35 @@ class TransactionRepository @Inject constructor(
accountId: AccountId,
startDate: Instant,
endDate: Instant
): List<Transaction> = retrieveTrns(
dbCall = {
transactionDao.findAllByAccountAndBetween(
accountId = accountId.value,
startDate = startDate,
endDate = endDate
)
): List<Transaction> = withContext(dispatchersProvider.io) {
val transactions = transactionDao.findAllByAccountAndBetween(
accountId = accountId.value,
startDate = startDate,
endDate = endDate
)
val tagAssociationMap = getTagsForTransactionIds(transactions)
transactions.mapNotNull {
val tags = tagAssociationMap[it.id] ?: emptyList()
with(mapper) { it.toDomain(tags = tags).getOrNull() }
}
)
}

suspend fun findAllToAccountAndBetween(
toAccountId: AccountId,
startDate: Instant,
endDate: Instant
): List<Transaction> = retrieveTrns(
dbCall = {
transactionDao.findAllToAccountAndBetween(
toAccountId = toAccountId.value,
startDate = startDate,
endDate = endDate
)
): List<Transaction> = withContext(dispatchersProvider.io) {
viratde marked this conversation as resolved.
Show resolved Hide resolved
val transactions = transactionDao.findAllToAccountAndBetween(
toAccountId = toAccountId.value,
startDate = startDate,
endDate = endDate
)
val tagAssociationMap = getTagsForTransactionIds(transactions)
transactions.mapNotNull {
val tags = tagAssociationMap[it.id] ?: emptyList()
with(mapper) { it.toDomain(tags = tags).getOrNull() }
}
)
}

suspend fun findAllDueToBetween(
startDate: Instant,
Expand Down