You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

package order
import (
"github.com/golangkit/formatime"
"github.com/shopspring/decimal"
"recook/internal/model/order_preview"
)
type CouponDetail struct {
ID uint `gorm:"column:id;primary_key" json:"id"`
OrderID uint `gorm:"column:order_id" json:"-"`
BrandID uint `gorm:"column:brand_id" json:"brandId"`
PersonalCouponID uint `gorm:"column:personal_coupon_id" json:"personalCouponId"`
CouponID uint `gorm:"column:coupon_id" json:"couponId"`
Scope uint `gorm:"column:scope" json:"scope"`
CouponName string `gorm:"column:coupon_name" json:"couponName"`
DeductedAmount decimal.Decimal `gorm:"column:deducted_amount" json:"deductedAmount"`
EndTime formatime.Second `gorm:"column:end_time" json:"-"`
}
// TableName sets the insert table name for this struct type
func (r *CouponDetail) TableName() string {
return "recook_order_coupon_detail"
}
func (*CouponDetail) Reflect(r *order_preview.CouponDetail, o *Information) *CouponDetail {
return &CouponDetail{
OrderID: o.ID,
BrandID: r.BrandID,
PersonalCouponID: r.PersonalCouponID,
CouponID: r.CouponID,
Scope: r.Scope,
CouponName: r.CouponName,
DeductedAmount: r.DeductedAmount,
EndTime: r.EndTime,
}
}