package com.microservices.pms.project.domain.vo;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.microservices.common.core.utils.bean.BeanUtils;
import com.microservices.pms.project.domain.PmsProject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@ApiModel("项目更新对象")
public class PmsProjectUpdateVo {

    @ApiModelProperty(value = "项目id")
    @NotNull
    private Long Id;

    @ApiModelProperty(value = "项目名称")
    @Size(max = 50)
    private String projectName;

    @ApiModelProperty(value = "关联仓库ids")
    private String projectRepositoryIds;

    @ApiModelProperty(value = "负责人id")
    private Long projectAssigneeId;

    @ApiModelProperty(value = "成员ids")
    private String pmsProjectMemberIds;

    @ApiModelProperty(value = "项目简介")
    @Size(max = 200)
    private String projectDescription;

    @ApiModelProperty(value = "状态 0关闭 1开启 2暂停")
    private String status;

    @ApiModelProperty(value = "所属产品id")
    private Long pmsProductId;


    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "是否置顶 0不置顶 1置顶")
    private Integer isTop;

    @JsonIgnore
    private Date updateTime;

    //关联仓库ids置空，True置空
    @JsonIgnore
    private Boolean isResetRepositoryIdsToNull;

    //项目简介置空，True置空
    @JsonIgnore
    private Boolean isResetDescriptionToNull;

    //所属产品id置空，True置空
    @JsonIgnore
    private Boolean isResetPmsProductIdToNull;

    //开始时间置空，True置空
    @JsonIgnore
    private Boolean isResetStartTimeToNull;

    //结束时间置空，True置空
    @JsonIgnore
    private Boolean isResetEndTimeToNull;

    public PmsProject toPmsProject() {
        PmsProject pmsProject = new PmsProject();
        BeanUtils.copyProperties(this, pmsProject);
        return pmsProject;
    }

}
