mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-11-01 00:10:06 -04:00
Use int64 instead of *Type for Accounts/Securities
Otherwise, gorp gets confused and won't assign an int64 type from the database to an AccountType, even though they're really the same datatype.
This commit is contained in:
parent
fce1e44be6
commit
7772f0bca5
18
accounts.go
18
accounts.go
@ -8,16 +8,14 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AccountType int64
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Bank AccountType = 1
|
Bank int64 = 1
|
||||||
Cash = 2
|
Cash = 2
|
||||||
Asset = 3
|
Asset = 3
|
||||||
Liability = 4
|
Liability = 4
|
||||||
Investment = 5
|
Investment = 5
|
||||||
Income = 6
|
Income = 6
|
||||||
Expense = 7
|
Expense = 7
|
||||||
)
|
)
|
||||||
|
|
||||||
type Account struct {
|
type Account struct {
|
||||||
@ -25,7 +23,7 @@ type Account struct {
|
|||||||
UserId int64
|
UserId int64
|
||||||
SecurityId int64
|
SecurityId int64
|
||||||
ParentAccountId int64 // -1 if this account is at the root
|
ParentAccountId int64 // -1 if this account is at the root
|
||||||
Type AccountType
|
Type int64
|
||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SecurityType int64
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Banknote SecurityType = 1
|
Banknote int64 = 1
|
||||||
Bond = 2
|
Bond = 2
|
||||||
Stock = 3
|
Stock = 3
|
||||||
MutualFund = 4
|
MutualFund = 4
|
||||||
)
|
)
|
||||||
|
|
||||||
type Security struct {
|
type Security struct {
|
||||||
@ -21,7 +19,7 @@ type Security struct {
|
|||||||
// Number of decimal digits (to the right of the decimal point) this
|
// Number of decimal digits (to the right of the decimal point) this
|
||||||
// security is precise to
|
// security is precise to
|
||||||
Precision int64
|
Precision int64
|
||||||
Type SecurityType
|
Type int64
|
||||||
}
|
}
|
||||||
|
|
||||||
type SecurityList struct {
|
type SecurityList struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user