Order APIs

This commit is contained in:
2025-02-02 22:20:10 +08:00
parent 87b94cdb54
commit 3993a1bc7f
6 changed files with 215 additions and 30 deletions

View File

@@ -0,0 +1,27 @@
package models
import (
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
"github.com/shopspring/decimal"
)
const (
OrderStatusPending = iota
OrderStatusPaid
OrderStatusCanceled
)
type Order struct {
cruda.BaseModel
Status int `json:"status"`
Remark string `json:"remark"`
Amount decimal.Decimal `json:"amount"`
Payer *Wallet `json:"payer"`
Payee *Wallet `json:"payee"`
PayerID *uint `json:"payer_id"`
PayeeID *uint `json:"payee_id"`
Transaction *Transaction `json:"transaction"`
TransactionID *uint `json:"transaction_id"`
ClientID *uint `json:"client_id"`
}