Skip to content

Commit

Permalink
fix compile errors in TransactionRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeef committed Sep 24, 2024
1 parent dab1c1f commit 60bfcd1
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions MMEX/Repositories/TransactionRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,18 @@ extension TransactionRepository {
startDate: Date? = Calendar.current.date(byAdding: .month, value: -3, to: Date()),
endDate: Date? = Date()
) -> [TransactionData] {
var table = Self.repositoryTable

var filter = Expression<Bool?>(value: true)

if let accountId {
table = table.filter(Self.col_accountId == accountId || Self.col_toAccountId == accountId)
}
if let startDate {
filter = filter && (Self.col_transDate >= startDate.ISO8601Format())
table = table.filter(Self.col_transDate >= startDate.ISO8601Format())
}

//if let endDate {
// filter = filter && (Self.col_transDate <= endDate.ISO8601Format())
// table = table.filter(Self.col_transDate <= endDate.ISO8601Format())
//}

if let accountId {
filter = filter && ((Self.col_accountId == accountId) || (Self.col_toAccountId == accountId))
}

let table = Self.repositoryTable.filter(filter)

return selectData(from: table)
}
}

0 comments on commit 60bfcd1

Please sign in to comment.