electricity_bill_calc_service/model/user_charges.go

34 lines
1.1 KiB
Go

package model
import (
"time"
"github.com/shopspring/decimal"
)
type UserCharge struct {
Created `xorm:"extends"`
Seq int64 `xorm:"bigint pk not null " json:"seq"`
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" time_format:"simple_datetime" time_location:"shanghai"`
Refunded bool `xorm:"bool not null default false" json:"refunded"`
RefundedAt *time.Time `xorm:"timestampz" json:"refundedAt" time_format:"simple_datetime" time_location:"shanghai"`
}
func (UserCharge) TableName() string {
return "user_charge"
}
type ChargeWithName struct {
UserDetail `xorm:"extends"`
UserCharge `xorm:"extends"`
}
func (ChargeWithName) TableName() string {
return "user_charge"
}