26 lines
916 B
Go
26 lines
916 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type UserCharge struct {
|
|
Created `xorm:"extends"`
|
|
Seq int64 `xorm:"bigint pk not null " json:"seq"`
|
|
CreatedAt time.Time `xorm:"timestampz not null" json:"createdAt"`
|
|
UserId string `xorm:"varchar(120) not null" json:"userId"`
|
|
Fee decimal.Decimal `xorm:"numeric(12,2) not null" json:"fee"`
|
|
Discount decimal.Decimal `xorm:"numeric(5,4) not null" json:"discount"`
|
|
Amount decimal.Decimal `xorm:"numeric(12,2) not null" json:"amount"`
|
|
Settled bool `xorm:"bool not null default false" json:"settled"`
|
|
SettledAt *time.Time `xorm:"timestampz" json:"settledAt"`
|
|
Refunded bool `xorm:"bool not null default false" json:"refunded"`
|
|
RefundedAt *time.Time `xorm:"timestampz" json:"refundedAt"`
|
|
}
|
|
|
|
func (UserCharge) TableName() string {
|
|
return "user_charge"
|
|
}
|