package model

import (
	"time"
)

type CommunityTeamCoupon struct {
	Id             int       `json:"id" xorm:"not null pk autoincr INT(11)"`
	Name           string    `json:"name" xorm:"comment('方案名称') VARCHAR(255)"`
	Comment        string    `json:"comment" xorm:"comment('备注') VARCHAR(2048)"`
	Kind           int       `json:"kind" xorm:"not null comment('优惠券类型,1:立减,2:满减,3折扣') TINYINT(1)"`
	IsReach        int       `json:"is_reach" xorm:"comment('是否有门槛,1:有,2:否;优惠券类型为3折扣时') TINYINT(1)"`
	Cal            string    `json:"cal" xorm:"comment('满减及折扣有门槛时算法,{"reach": "20.12", "reduce": "2.2"}, reach:满X元,减/折reduce') VARCHAR(255)"`
	State          int       `json:"state" xorm:"not null default 1 comment('1开启') TINYINT(1)"`
	Info           string    `json:"info" xorm:"not null default '0' comment('活动规则说明') VARCHAR(5000)"`
	Sort           int       `json:"sort" xorm:"comment('排序') INT(11)"`
	Ext            string    `json:"ext" xorm:"comment('拓展字段') TEXT"`
	CreatedTime    time.Time `json:"created_time" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') DATETIME"`
	UpdatedTime    time.Time `json:"updated_time" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') DATETIME"`
	StoreId        int       `json:"store_id" xorm:"default 0 INT(11)"`
	StoreType      int       `json:"store_type" xorm:"default 0 comment('0官方自营店 1加盟店 2连锁店') INT(11)"`
	Img            string    `json:"img" xorm:"VARCHAR(255)"`
	Num            int       `json:"num" xorm:"not null comment('剩余数量') INT(11)"`
	ValidTimeType  int       `json:"valid_time_type" xorm:"comment('有效期类型:1固定日期2领取后x天有效') TINYINT(1)"`
	ValidTimeStart time.Time `json:"valid_time_start" xorm:"comment('固定日期开始') DATETIME"`
	ValidTimeEnd   time.Time `json:"valid_time_end" xorm:"comment('固定日期结束') DATETIME"`
	ValidDayNum    int       `json:"valid_day_num" xorm:"comment('领取后有效的天数') INT(11)"`
}