23 lines
842 B
Go
23 lines
842 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
type Transaction struct {
|
|
bun.BaseModel `bun:"table:transactions,alias:t"`
|
|
|
|
ID string `bun:"id,pk,type:varchar(64)" json:"id"`
|
|
RequestID string `bun:"request_id,notnull" json:"request_id"`
|
|
UserID int64 `bun:"user_id,notnull" json:"user_id"`
|
|
GameID int64 `bun:"game_id,notnull" json:"game_id"`
|
|
RoundID string `bun:"round_id,notnull" json:"round_id"`
|
|
Amount int64 `bun:"amount,notnull" json:"amount"`
|
|
WinAmount int64 `bun:"win_amount,notnull,default:0" json:"win_amount"`
|
|
Currency string `bun:"currency,notnull" json:"currency"`
|
|
Status string `bun:"status,notnull" json:"status"` // reserved / confirmed / canceled
|
|
CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp" json:"created_at"`
|
|
}
|