package cn.iocoder.yudao.module.product.controller.admin.harvestbatch.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@ApiModel("管理后台 - 区块证书保存（创建/更新） Request VO")
@Data
public class BlockCertificateSaveReqVO {

    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "批次上链类型： 0：采收批次   1:投入品采购批次  2:检验检疫批次")
    private Integer batchType;

    @ApiModelProperty(value = "上链操作专属ID")
    private String chainOperateId;

    @ApiModelProperty(value = "操作类型 0:批次上链  1 商品信息 2:环节上链  3：出入库上链 4：农事活动 5商品认证")
    private Integer operateType;

    @ApiModelProperty(value = "操作类型描述")
    @Length(max = 255)
    private String operateName;

    @ApiModelProperty(value = "操作对象id：根据operate_type的值，存储不同关联表的id")
    private Long operateObjId;

    @ApiModelProperty(value = "批次id")
    private String batchId;

    @ApiModelProperty(value = "环节id")
    private String linkId;

    @ApiModelProperty(value = "环节名称", required = true)
    @NotNull(message = "环节名称不能为空")
    @Length(max = 255)
    private String linkName;

    @ApiModelProperty(value = "上链状态 0未上链  1已上链")
    private Integer chainState = 0;

    @ApiModelProperty(value = "备注")
    @Length(max = 255)
    private String remarks;

    @ApiModelProperty(value = "是否扫码展示")
    private Boolean scanShow;

    @ApiModelProperty(value = "排序")
    @Min(value = 0)
    private Integer sort;

    @ApiModelProperty(value = "父区块证书的上链操作专属ID")
    private String parentOperateId;

    @ApiModelProperty(value = "区块上链操作具体上链信息")
    @NotEmpty(message = "区块上链操作具体上链信息不能为空")
    @Valid
    private List<OperateDetailSaveReqVO> operateDetails;
}
