(db *gorm.DB)
| 32 | } |
| 33 | |
| 34 | func GetCurrentNetworth(db *gorm.DB) gin.H { |
| 35 | postings := query.Init(db).Like("Assets:%", "Income:CapitalGains:%", "Liabilities:%").UntilToday().All() |
| 36 | postings = service.PopulateMarketPrice(db, postings) |
| 37 | networth := computeNetworth(db, postings) |
| 38 | xirr := service.XIRR(db, postings) |
| 39 | return gin.H{"networth": networth, "xirr": xirr} |
| 40 | } |
| 41 | |
| 42 | func computeNetworth(db *gorm.DB, postings []posting.Posting) Networth { |
| 43 | var networth Networth |
no test coverage detected