package cn.ey.biz.module.system.controller.admin.contract.v2.vo;

import cn.ey.biz.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@ApiModel(value = "合同字段VO")
public class ContractFieldVO extends PageParam {

    public interface Update {
    }

    public interface Add {
    }

    public interface Select {
    }

    public interface Delete {
    }

    @ApiModelProperty(value = "字段ID")
    @NotNull(message = "字段ID不可为空", groups = {Delete.class})
    private Long id;

    @ApiModelProperty(value = "业务线")
    @NotEmpty(message = "业务线不可为空", groups = {Update.class, Select.class})
    private String sl;

    @ApiModelProperty(value = "MR")
    @NotEmpty(message = "MR不可为空", groups = {Update.class, Select.class})
    private String mr;

    @ApiModelProperty(value = "合同类型")
    @NotEmpty(message = "合同类型不可为空", groups = {Update.class, Select.class})
    private String contractType;

    @ApiModelProperty(value = "归档：archive, 字段：field")
    private String type;

    @ApiModelProperty(value = "字段编号")
    @NotNull(message = "字段ID不可为空", groups = {Update.class})
    private Long fieldId;

    @ApiModelProperty(value = "合同模块")
    @NotEmpty(message = "合同模块不可为空", groups = {Add.class})
    private String contractModule;

    @ApiModelProperty(value = "字段名称")
    @NotEmpty(message = "字段名称不可为空", groups = {Add.class})
    private String fieldName;

    @ApiModelProperty(value = "字段CODE")
    @NotEmpty(message = "字段CODE不可为空", groups = {Add.class})
    private String fieldCode;

    @ApiModelProperty(value = "字段类型")
    @NotEmpty(message = "字段类型不可为空", groups = {Add.class})
    private String fieldType;

    @ApiModelProperty(value = "默认值")
    private String defaultValue;

    @ApiModelProperty(value = "数据源: 扩展字段且类型为下拉框时填写")
    private String dataSource;

    @ApiModelProperty(value = "是否扩展字段： 0:否， 1:是")
    @NotNull(message = "是否扩展字段不可为空")
    private int expand;

    @ApiModelProperty(value = "是否必填")
    private Boolean needInput = Boolean.FALSE;

    @ApiModelProperty(value = "是否展示")
    private Boolean needShow = Boolean.FALSE;

}
