package com.izouma.dingdong.domain.merchant;


import com.izouma.dingdong.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Builder
@Where(clause = "enabled = 1")
@ApiModel(value = "商家自定义分类")
public class MerchantClassification extends BaseEntity implements Serializable {

    //private Long userId;

    @ApiModelProperty(value = "名称", name = "name")
    @Column(length = 50)
    @Size(max = 50)
    private String name;

    @ApiModelProperty(value = "排序", name = "sort")
    private Integer sort;

    @ApiModelProperty(value = "商户ID", name = "merchantId")
    private Long merchantId;


    private String goodsIds;

    @ApiModelProperty(value = "是否开启", name = "isOpen")
    private Boolean isOpen;

    @ApiModelProperty(value = "是否显示", name = "isShow")
    private Boolean isShow;

    /**
     * 分类类型： 1 好评热销 2 折扣 3 点单必读 4 商家自定义
     */
    @ApiModelProperty(value = "分类类型")
    private Integer type;

    @Column(nullable = false)
    private Boolean enabled = true;
}
