Implement single account transaction-list
This commit is contained in:
@ -27,45 +27,3 @@ func Connect(server string, user string, password string, database string) (*Que
|
||||
|
||||
return New(conn), conn, nil
|
||||
}
|
||||
|
||||
func (tx Transaction) GetAmount() float64 {
|
||||
var amount float64
|
||||
err := tx.Amount.AssignTo(&amount)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return amount
|
||||
}
|
||||
|
||||
func (tx Transaction) GetPositive() bool {
|
||||
amount := tx.GetAmount()
|
||||
return amount >= 0
|
||||
}
|
||||
|
||||
func (tx GetTransactionsForBudgetRow) GetAmount() float64 {
|
||||
var amount float64
|
||||
err := tx.Amount.AssignTo(&amount)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return amount
|
||||
}
|
||||
|
||||
func (tx GetTransactionsForBudgetRow) GetPositive() bool {
|
||||
amount := tx.GetAmount()
|
||||
return amount >= 0
|
||||
}
|
||||
|
||||
func (tx GetAccountsWithBalanceRow) GetBalance() float64 {
|
||||
var balance float64
|
||||
err := tx.Balance.AssignTo(&balance)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return balance
|
||||
}
|
||||
|
||||
func (tx GetAccountsWithBalanceRow) GetPositive() bool {
|
||||
balance := tx.GetBalance()
|
||||
return balance >= 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user