1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 04:38:38 -04:00

Split prices into models

This commit is contained in:
2017-12-04 21:05:17 -05:00
parent 128ea57c4d
commit 5f296e8669
7 changed files with 76 additions and 66 deletions

View File

@ -129,7 +129,7 @@ type GnucashImport struct {
Securities []models.Security
Accounts []models.Account
Transactions []models.Transaction
Prices []Price
Prices []models.Price
}
func ImportGnucash(r io.Reader) (*GnucashImport, error) {
@ -161,7 +161,7 @@ func ImportGnucash(r io.Reader) (*GnucashImport, error) {
// Create prices, setting security and currency IDs from securityMap
for i := range gncxml.PriceDB.Prices {
price := gncxml.PriceDB.Prices[i]
var p Price
var p models.Price
security, ok := securityMap[price.Commodity.Name]
if !ok {
return nil, fmt.Errorf("Unable to find commodity '%s' for price '%s'", price.Commodity.Name, price.Id)