implement analyzer.go:Analyzer:BigSPenderReport which assumes no clobber on FirstInitial LastName

main
bel 2023-10-15 12:55:11 -06:00
parent afa51d915e
commit 6e17faf4b1
4 changed files with 411 additions and 15 deletions

View File

@ -1,5 +1,12 @@
package analyzer package analyzer
import (
"fmt"
"sort"
"gonum.org/v1/gonum/stat"
)
// Analyzer processes Transactions and generates reports. // Analyzer processes Transactions and generates reports.
type Analyzer struct { type Analyzer struct {
// The list of Transactions available to analyze. // The list of Transactions available to analyze.
@ -51,6 +58,18 @@ func (anz *Analyzer) LargestTransaction() (Transaction, error) {
return anz.transactions[largestIdx], nil return anz.transactions[largestIdx], nil
} }
// byCardholder groups the transactions by cardholder and returns a map of
// cardholder name to the list of transactions that are part of that cardholder.
func (anz *Analyzer) byCardholder() map[string]Transactions {
result := map[string]Transactions{}
for i := range anz.transactions {
transactionsForCardholder := result[anz.transactions[i].stringifyCardholder()]
transactionsForCardholder = append(transactionsForCardholder, anz.transactions[i])
result[anz.transactions[i].stringifyCardholder()] = transactionsForCardholder
}
return result
}
// ByCategory groups the transactions by category and returns a map of // ByCategory groups the transactions by category and returns a map of
// category name to the list of transactions that are part of that category. // category name to the list of transactions that are part of that category.
func (anz *Analyzer) ByCategory() map[string]Transactions { func (anz *Analyzer) ByCategory() map[string]Transactions {
@ -63,6 +82,27 @@ func (anz *Analyzer) ByCategory() map[string]Transactions {
return result return result
} }
type cardholderAndSum struct {
cardholder string
sum Amount
}
type cardholderAndSums []cardholderAndSum
func (cardholderAndSums cardholderAndSums) Len() int {
return len(cardholderAndSums)
}
func (cardholderAndSums cardholderAndSums) Less(i, j int) bool {
if cardholderAndSums[i].sum == cardholderAndSums[j].sum {
return cardholderAndSums[i].cardholder > cardholderAndSums[j].cardholder
}
return cardholderAndSums[i].sum > cardholderAndSums[j].sum
}
func (cardholderAndSums cardholderAndSums) Swap(i, j int) {
cardholderAndSums[i], cardholderAndSums[j] = cardholderAndSums[j], cardholderAndSums[i]
}
// BigSpenderReport generates our Big Spender Report. // BigSpenderReport generates our Big Spender Report.
// //
// "Big spenders" are defined as those people who, in aggregate // "Big spenders" are defined as those people who, in aggregate
@ -72,19 +112,51 @@ func (anz *Analyzer) ByCategory() map[string]Transactions {
// The method determines who they are and generates a well-formatted // The method determines who they are and generates a well-formatted
// report to call them out. // report to call them out.
func (anz *Analyzer) BigSpenderReport() string { func (anz *Analyzer) BigSpenderReport() string {
report := ` if len(anz.transactions) == 0 {
Digits Big Spenders Report return anz.formatCardholderAmountsAsUSD("Digits Big Spenders Report", nil)
}
meanSpend, stddevSpend := anz.spendMeanStdDevPerCardholder()
cardholderAndSums := make(cardholderAndSums, 0)
for cardholder, transactionsForCardholder := range anz.byCardholder() {
cardholderSpendSum := transactionsForCardholder.Sum()
if cardholderSpendSum-2*stddevSpend > meanSpend {
cardholderAndSums = append(cardholderAndSums, cardholderAndSum{cardholder: cardholder, sum: cardholderSpendSum})
}
}
sort.Slice(cardholderAndSums, cardholderAndSums.Less)
return anz.formatCardholderAmountsAsUSD("Digits Big Spenders Report", cardholderAndSums)
}
func (anz *Analyzer) spendMeanStdDevPerCardholder() (mean, stdddev Amount) {
spendPerCardholder := anz.spendPerCardholder()
meanf64, stdf64 := stat.MeanStdDev(spendPerCardholder, nil)
return Amount(meanf64), Amount(stdf64)
}
func (anz *Analyzer) spendPerCardholder() []float64 {
values := []float64{}
for _, transactions := range anz.byCardholder() {
values = append(values, float64(transactions.Sum()))
}
return values
}
func (anz *Analyzer) formatCardholderAmountsAsUSD(title string, cardholderAndSums []cardholderAndSum) string {
report := fmt.Sprintf(`
%s
------------------------------------------------------ ------------------------------------------------------
Name Amount Name Amount
------------------------------------------------------` ------------------------------------------------------`, title)
for i := range cardholderAndSums {
// TODO: Not implemented. report = fmt.Sprintf("%s\n%-30s%s",
// TODO: As a reminder, we're looking for well-factored, well-organized report,
// code. We encourage you to refactor, change, or add to any part cardholderAndSums[i].cardholder,
// of the non-test code as you see fit! cardholderAndSums[i].sum.FormatUSD(),
report += "" )
}
return report return fmt.Sprintf("%s\n------------------------------------------------------", report)
} }
// New creates a new Analyzer with an empty set of transactions // New creates a new Analyzer with an empty set of transactions

View File

@ -2,4 +2,7 @@ module github.com/digits/WorkSample-Go
go 1.13 go 1.13
require golang.org/x/text v0.13.0 require (
golang.org/x/text v0.13.0
gonum.org/v1/gonum v0.14.0 // indirect
)

View File

@ -1,32 +1,141 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY=
github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks=
github.com/go-fonts/latin-modern v0.3.0/go.mod h1:ysEQXnuT/sCDOAONxC7ImeEDVINbltClhasMAqEtRK0=
github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
github.com/go-fonts/liberation v0.3.0/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY=
github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U=
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9/go.mod h1:gWuR/CrFDDeVRFQwHPvsv9soJVB/iqymhuZQuJ3a9OM=
github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
github.com/goccmack/gocc v0.0.0-20230228185258-2292f9e40198/go.mod h1:DTh/Y2+NbnOVVoypCCQrovMPDKUGp4yZpSbWg5D0XIM=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY=
github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4=
golang.org/x/image v0.6.0/go.mod h1:MXLdDR43H7cDJq5GEGXEVeeNhPgi+YYEQ2pC1byI1x0=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0=
gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0=
gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY=
gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

218
todo.yaml
View File

@ -2,7 +2,6 @@ todo:
- review readme tail to finish // answer 3 questions, gofmt - review readme tail to finish // answer 3 questions, gofmt
- todo: go test - todo: go test
subtasks: subtasks:
- TestAnalyzer_BigSpendersReport
- TestAnalyzer_TransactionsFromURLs - TestAnalyzer_TransactionsFromURLs
- TestAnalyzer_TransactionsFromURLsConcurrent - TestAnalyzer_TransactionsFromURLsConcurrent
- amount.go:Rounded probably does NOT handle float precision well... it is float64 - amount.go:Rounded probably does NOT handle float precision well... it is float64
@ -37,8 +36,10 @@ todo:
each category's size. Makes code look weird, though. Hm. each category's size. Makes code look weird, though. Hm.
- analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum - analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum
- analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum - analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum
- analyzer.go:Analyzer:BigSpenderReport I ASSUME is spend-specific--the previous - analyzer.go:Analyzer:tranasctionsMean I ASSUME arithmetic mean (sum/count), but
implementation of largestTransaction incldues refunds and should be ignored could be another mean not specified (ie geometric)
- analyzer.go:Analyzer:BigSpendersReport assumes no overlapping FirstInitial LastName
cardholders
scheduled: [] scheduled: []
done: done:
- todo: hello world - todo: hello world
@ -753,3 +754,214 @@ done:
- analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum - analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum
- analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum - analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum
ts: Sun Oct 15 11:57:55 MDT 2023 ts: Sun Oct 15 11:57:55 MDT 2023
- todo: go test
subtasks:
- 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
- transaction.go:Transaction:Sum again doesnt care about Amount currency or vendor/vendee
drift
- analyzer.go:Analyzer:LargestTransaction doesn't specify how to break ties; stable
or latest?
- analyzer.go:Analyzer:Add should dedupe transactions added, but transactions.go:FromFile
will load duplicate transactions from json file so hmmmm
- todo: analyzer.go:Analzyer:Add dedupes each transaction, which is O(n**2)
details: |
* BUT there's no indicator whether order of the array matters, so it's unsafe for me to sort/heapify that stuff
* OR I can store a second copy of all entries in a map, but that risks drift syncing the two
* SO I could create a UniqueTransactions struct {
transactions []Transaction
dedupes map[Transaction]struct{}
}
but that's just doubling RAM usage in a thing that sounds like it could scale infinitely over time
SO I could do a [hash(Transaction)][]*Transaction and compare just a subset. Because it's in RAM and computed live, the hash cardinality could be changed on any release
<------------------ if I have time, do this
- analyzer.go:Analyzer:Add dedupes but what is a duplicate transaction? Transactions
can be pending and then later disappear to have their date updated OR be like
pre-charges on credit cards that later disappear
- analyzer.go:Analyzer:Add is not concurrency-safe
- analyzer.go:Analyzer:ByCategory probably allocates big slices out the gate and
expends to way-too-big-slices by end time. Could do 2 passes (still O(n)) to pre-compute
each category's size. Makes code look weird, though. Hm.
- analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum
- analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum
- analyzer.go:Analyzer:BigSpenderReport I ASSUME is spend-specific--the previous
implementation of largestTransaction incldues refunds and should be ignored
ts: Sun Oct 15 12:04:58 MDT 2023
- todo: go test
subtasks:
- 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
- transaction.go:Transaction:Sum again doesnt care about Amount currency or vendor/vendee
drift
- analyzer.go:Analyzer:LargestTransaction doesn't specify how to break ties; stable
or latest?
- analyzer.go:Analyzer:Add should dedupe transactions added, but transactions.go:FromFile
will load duplicate transactions from json file so hmmmm
- todo: analyzer.go:Analzyer:Add dedupes each transaction, which is O(n**2)
details: |
* BUT there's no indicator whether order of the array matters, so it's unsafe for me to sort/heapify that stuff
* OR I can store a second copy of all entries in a map, but that risks drift syncing the two
* SO I could create a UniqueTransactions struct {
transactions []Transaction
dedupes map[Transaction]struct{}
}
but that's just doubling RAM usage in a thing that sounds like it could scale infinitely over time
SO I could do a [hash(Transaction)][]*Transaction and compare just a subset. Because it's in RAM and computed live, the hash cardinality could be changed on any release
<------------------ if I have time, do this
- analyzer.go:Analyzer:Add dedupes but what is a duplicate transaction? Transactions
can be pending and then later disappear to have their date updated OR be like
pre-charges on credit cards that later disappear
- analyzer.go:Analyzer:Add is not concurrency-safe
- analyzer.go:Analyzer:ByCategory probably allocates big slices out the gate and
expends to way-too-big-slices by end time. Could do 2 passes (still O(n)) to pre-compute
each category's size. Makes code look weird, though. Hm.
- analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum
- analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum
- analyzer.go:Analyzer:BigSpenderReport I ASSUME is spend-specific--the previous
implementation of largestTransaction incldues refunds and should be ignored
- analyzer.go:Analyzer:tranasctionsMean I ASSUME arithmetic mean (sum/count), but
could be another mean not specified (ie geometric)
ts: Sun Oct 15 12:16:17 MDT 2023
- todo: go test
subtasks:
- 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
- transaction.go:Transaction:Sum again doesnt care about Amount currency or vendor/vendee
drift
- analyzer.go:Analyzer:LargestTransaction doesn't specify how to break ties; stable
or latest?
- analyzer.go:Analyzer:Add should dedupe transactions added, but transactions.go:FromFile
will load duplicate transactions from json file so hmmmm
- todo: analyzer.go:Analzyer:Add dedupes each transaction, which is O(n**2)
details: |
* BUT there's no indicator whether order of the array matters, so it's unsafe for me to sort/heapify that stuff
* OR I can store a second copy of all entries in a map, but that risks drift syncing the two
* SO I could create a UniqueTransactions struct {
transactions []Transaction
dedupes map[Transaction]struct{}
}
but that's just doubling RAM usage in a thing that sounds like it could scale infinitely over time
SO I could do a [hash(Transaction)][]*Transaction and compare just a subset. Because it's in RAM and computed live, the hash cardinality could be changed on any release
<------------------ if I have time, do this
- analyzer.go:Analyzer:Add dedupes but what is a duplicate transaction? Transactions
can be pending and then later disappear to have their date updated OR be like
pre-charges on credit cards that later disappear
- analyzer.go:Analyzer:Add is not concurrency-safe
- analyzer.go:Analyzer:ByCategory probably allocates big slices out the gate and
expends to way-too-big-slices by end time. Could do 2 passes (still O(n)) to pre-compute
each category's size. Makes code look weird, though. Hm.
- analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum
- analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum
- analyzer.go:Analyzer:BigSpenderReport I ASSUME is spend-specific--the previous
implementation of largestTransaction incldues refunds and should be ignored
- analyzer.go:Analyzer:tranasctionsMean I ASSUME arithmetic mean (sum/count), but
could be another mean not specified (ie geometric)
- analyzer.go:Analyzer:BigSpendersReport assumes no overlapping FirstInitial LastName
cardholders
ts: Sun Oct 15 12:33:30 MDT 2023
- todo: go test
subtasks:
- 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
- transaction.go:Transaction:Sum again doesnt care about Amount currency or vendor/vendee
drift
- analyzer.go:Analyzer:LargestTransaction doesn't specify how to break ties; stable
or latest?
- analyzer.go:Analyzer:Add should dedupe transactions added, but transactions.go:FromFile
will load duplicate transactions from json file so hmmmm
- todo: analyzer.go:Analzyer:Add dedupes each transaction, which is O(n**2)
details: |
* BUT there's no indicator whether order of the array matters, so it's unsafe for me to sort/heapify that stuff
* OR I can store a second copy of all entries in a map, but that risks drift syncing the two
* SO I could create a UniqueTransactions struct {
transactions []Transaction
dedupes map[Transaction]struct{}
}
but that's just doubling RAM usage in a thing that sounds like it could scale infinitely over time
SO I could do a [hash(Transaction)][]*Transaction and compare just a subset. Because it's in RAM and computed live, the hash cardinality could be changed on any release
<------------------ if I have time, do this
- analyzer.go:Analyzer:Add dedupes but what is a duplicate transaction? Transactions
can be pending and then later disappear to have their date updated OR be like
pre-charges on credit cards that later disappear
- analyzer.go:Analyzer:Add is not concurrency-safe
- analyzer.go:Analyzer:ByCategory probably allocates big slices out the gate and
expends to way-too-big-slices by end time. Could do 2 passes (still O(n)) to pre-compute
each category's size. Makes code look weird, though. Hm.
- analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum
- analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum
- analyzer.go:Analyzer:BigSpenderReport I found is NOT spend-specific
- analyzer.go:Analyzer:tranasctionsMean I ASSUME arithmetic mean (sum/count), but
could be another mean not specified (ie geometric)
- analyzer.go:Analyzer:BigSpendersReport assumes no overlapping FirstInitial LastName
cardholders
ts: Sun Oct 15 12:54:47 MDT 2023
- todo: go test
subtasks:
- 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
- transaction.go:Transaction:Sum again doesnt care about Amount currency or vendor/vendee
drift
- analyzer.go:Analyzer:LargestTransaction doesn't specify how to break ties; stable
or latest?
- analyzer.go:Analyzer:Add should dedupe transactions added, but transactions.go:FromFile
will load duplicate transactions from json file so hmmmm
- todo: analyzer.go:Analzyer:Add dedupes each transaction, which is O(n**2)
details: |
* BUT there's no indicator whether order of the array matters, so it's unsafe for me to sort/heapify that stuff
* OR I can store a second copy of all entries in a map, but that risks drift syncing the two
* SO I could create a UniqueTransactions struct {
transactions []Transaction
dedupes map[Transaction]struct{}
}
but that's just doubling RAM usage in a thing that sounds like it could scale infinitely over time
SO I could do a [hash(Transaction)][]*Transaction and compare just a subset. Because it's in RAM and computed live, the hash cardinality could be changed on any release
<------------------ if I have time, do this
- analyzer.go:Analyzer:Add dedupes but what is a duplicate transaction? Transactions
can be pending and then later disappear to have their date updated OR be like
pre-charges on credit cards that later disappear
- analyzer.go:Analyzer:Add is not concurrency-safe
- analyzer.go:Analyzer:ByCategory probably allocates big slices out the gate and
expends to way-too-big-slices by end time. Could do 2 passes (still O(n)) to pre-compute
each category's size. Makes code look weird, though. Hm.
- analyzer.go:Analyzer:Largest should be an anz.transactions.Max() to match Sum
- analyzer.go:Analyzer:Count should be an anz.transactions.Len() to match Sum
- analyzer.go:Analyzer:tranasctionsMean I ASSUME arithmetic mean (sum/count), but
could be another mean not specified (ie geometric)
- analyzer.go:Analyzer:BigSpendersReport assumes no overlapping FirstInitial LastName
cardholders
ts: Sun Oct 15 12:54:50 MDT 2023