package com.sy.coinage.workshop.req;

import com.sy.coinage.core.interceptor.Create;
import com.sy.coinage.core.interceptor.Update;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;

import com.alibaba.fastjson2.annotation.JSONField;
import org.hibernate.validator.constraints.Range;
import lombok.Data;

/**
 * -产品表添加请求bean
 */
@Data
public class ProductReq implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * -id -10
     */
    @NotNull(message = "id不能为空", groups = {Update.class})
    @Range(min = 1, groups = {Update.class})
    private Integer id;
    /**
     * -产品名称 -60
     */
    @ApiModelProperty(value = "产品名称", required = true)
    @NotBlank(message = "产品名称不能为空")
    @Length(max = 60, message = "产品名称长度60不正确")
    private String securities;
    /**
     * -规格 -30
     */
    @ApiModelProperty(value = "规格", required = true)
    @NotBlank(message = "规格不能为空")
    @Length(max = 30, message = "规格长度30不正确")
    private String spec;
    /**
     * -冠字号代码 -30
     */
    @ApiModelProperty(value = "冠字号代码", required = true)
    @NotBlank(message = "冠字号代码不能为空")
    @Length(max = 30, message = "冠字号代码长度30不正确")
    private String crownPrefix;
    /**
     * -整拍箱数（箱） -10
     */
    @ApiModelProperty(value = "整拍箱数（箱）", required = true)
    @NotNull(message = "整拍箱数（箱）不能为空")
    private Integer boxAmount;
    /**
     * -整箱枚数(枚) -10
     */
    @ApiModelProperty(value = "整箱枚数(枚)", required = true)
    @NotNull(message = "整箱枚数(枚)不能为空")
    private Integer amountPerBox;
    /**
     * -是否启用 1:启用 2:停用 -10
     */
    @ApiModelProperty(value = "是否启用 1:启用 2:停用", required = true)
    @NotNull(message = "是否启用 1:启用 2:停用不能为空")
    private Integer status;
    /**
     * -创建时间 -19
     */
    @ApiModelProperty(value = "创建时间", required = true)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "创建时间不能为空")
    private Date createTime;

}
