implement transaction.go:Transactions:Sum as blind sum of .Amount
parent
58405fcdd8
commit
55422bb8af
|
|
@ -48,8 +48,11 @@ type Transactions []Transaction
|
|||
|
||||
// Sum adds all transactions together.
|
||||
func (trns Transactions) Sum() Amount {
|
||||
// TODO: Not implemented.
|
||||
return 0.0
|
||||
result := Amount(0.0)
|
||||
for i := range trns {
|
||||
result += trns[i].Amount
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// Count is the number of unique Transactions.
|
||||
|
|
|
|||
18
todo.yaml
18
todo.yaml
|
|
@ -15,6 +15,8 @@ todo:
|
|||
compatilble stuff
|
||||
- transaction.go:Transaction:String not clear if FormatUSD or amount currency should
|
||||
not be changed, or even what currency Amount is
|
||||
- transaction.go:Transaction:Sum again doesnt care about Amount currency or vendor/vendee
|
||||
drift
|
||||
scheduled: []
|
||||
done:
|
||||
- todo: hello world
|
||||
|
|
@ -416,3 +418,19 @@ done:
|
|||
- my `go mod tidy` actually cleared `go.mod` file, probably weird localhost backwards
|
||||
compatilble stuff
|
||||
ts: Sun Oct 15 11:24:56 MDT 2023
|
||||
- todo: go test
|
||||
subtasks:
|
||||
- TestAnalyzer_TransctionsSum
|
||||
- TestAnalyzer_LargestTransaction
|
||||
- TestAnalyzer_DuplicatesExcluded
|
||||
- TestAnalyzer_GroupByCategory
|
||||
- TestAnalyzer_BigSpendersReport
|
||||
- TestAnalyzer_TransactionsFromURLs
|
||||
- TestAnalyzer_TransactionsFromURLsConcurrent
|
||||
- amount.go:Rounded probably does NOT handle float precision well... it is float64
|
||||
tho...
|
||||
- my `go mod tidy` actually cleared `go.mod` file, probably weird localhost backwards
|
||||
compatilble stuff
|
||||
- transaction.go:Transaction:String not clear if FormatUSD or amount currency should
|
||||
not be changed, or even what currency Amount is
|
||||
ts: Sun Oct 15 11:27:47 MDT 2023
|
||||
|
|
|
|||
Loading…
Reference in New Issue