1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-01 12:08:37 -04:00

Add basic transaction register support

This commit is contained in:
2015-08-05 21:25:25 -04:00
parent b1e5e26338
commit 4f61f9e74d
8 changed files with 577 additions and 37 deletions

View File

@ -31,7 +31,7 @@ type Account struct {
// monotonically-increasing account transaction version number. Used for
// allowing a client to ensure they have a consistent version when paging
// through transactions.
Version int64
AccountVersion int64 `json:"Version"`
}
type AccountList struct {
@ -127,7 +127,7 @@ func insertUpdateAccount(a *Account, insert bool) error {
return err
}
a.Version = oldacct.Version + 1
a.AccountVersion = oldacct.AccountVersion + 1
count, err := transaction.Update(a)
if err != nil {
@ -227,7 +227,7 @@ func AccountHandler(w http.ResponseWriter, r *http.Request) {
}
account.AccountId = -1
account.UserId = user.UserId
account.Version = 0
account.AccountVersion = 0
if GetSecurity(account.SecurityId) == nil {
WriteError(w, 3 /*Invalid Request*/)