package model

import (
	"time"
)

type CommunityTeamCouponUser struct {
	Id               int64     `json:"id" xorm:"pk autoincr BIGINT(20)"`
	Uid              int       `json:"uid" xorm:"comment('用户id') index INT(11)"`
	MerchantSchemeId int       `json:"merchant_scheme_id" xorm:"comment('优惠券方案的id') INT(11)"`
	IsUse            int       `json:"is_use" xorm:"comment('是否已使用:0否1是2失效') TINYINT(1)"`
	Kind             int       `json:"kind" xorm:"comment('优惠券类型:1立减2满减3折扣') TINYINT(1)"`
	Cal              string    `json:"cal" xorm:"not null default '0.00' comment('折扣算法json:形式:{"reach":"10.00", "reduce":"1.00"},无门槛reach为0') VARCHAR(255)"`
	ValidTimeStart   time.Time `json:"valid_time_start" xorm:"comment('有效日期开始') DATETIME"`
	ValidTimeEnd     time.Time `json:"valid_time_end" xorm:"comment('有效日期结束') DATETIME"`
	CreateTime       time.Time `json:"create_time" xorm:"default CURRENT_TIMESTAMP comment('创建时间') DATETIME"`
	UpdateTime       time.Time `json:"update_time" xorm:"default CURRENT_TIMESTAMP comment('更新时间') DATETIME"`
	StoreId          int       `json:"store_id" xorm:"default 0 comment('0是官方') INT(11)"`
	StoreType        int       `json:"store_type" xorm:"default 0 comment('0官方自营店 1加盟店 2连锁店') INT(11)"`
	Name             string    `json:"name" xorm:"comment('方案名称') VARCHAR(255)"`
	Info             string    `json:"info" xorm:"not null default '0' comment('活动规则说明') VARCHAR(5000)"`
	Img              string    `json:"img" xorm:"VARCHAR(255)"`
}