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

Split securities into models

This commit is contained in:
2017-12-03 06:38:22 -05:00
parent 3f4d6d15a1
commit f72c86ef58
17 changed files with 170 additions and 151 deletions

View File

@ -54,7 +54,7 @@ func InsertUser(tx *Tx, u *models.User) error {
}
// Copy the security template and give it our new UserId
var security Security
var security models.Security
security = *security_template
security.UserId = u.UserId
@ -89,7 +89,7 @@ func UpdateUser(tx *Tx, u *models.User) error {
return err
} else if security.UserId != u.UserId || security.SecurityId != u.DefaultCurrency {
return errors.New("UserId and DefaultCurrency don't match the fetched security")
} else if security.Type != Currency {
} else if security.Type != models.Currency {
return errors.New("New DefaultCurrency security is not a currency")
}