🎉 Initial Commit
Some checks failed
release-nightly / build-docker (push) Has been cancelled
Some checks failed
release-nightly / build-docker (push) Has been cancelled
This commit is contained in:
17
pkg/internal/models/transaction.go
Normal file
17
pkg/internal/models/transaction.go
Normal file
@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type Transaction struct {
|
||||
cruda.BaseModel
|
||||
|
||||
Remark string `json:"remark"` // The usage of this transaction
|
||||
Amount decimal.Decimal `json:"amount" type:"decimal(30,2);"`
|
||||
Payer *Wallet `json:"payer"` // Who give the money
|
||||
Payee *Wallet `json:"payee"` // Who get the money
|
||||
PayerID *uint `json:"payer_id"` // Leave this field as nil means pay from the system
|
||||
PayeeID *uint `json:"payee_id"` // Leave this field as nil means pay to the system
|
||||
}
|
14
pkg/internal/models/wallet.go
Normal file
14
pkg/internal/models/wallet.go
Normal file
@ -0,0 +1,14 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type Wallet struct {
|
||||
cruda.BaseModel
|
||||
|
||||
Transactions []Transaction `json:"transactions"`
|
||||
Balance decimal.Decimal `json:"amount" sql:"type:decimal(30,2);"`
|
||||
AccountID uint `json:"account_id"`
|
||||
}
|
Reference in New Issue
Block a user