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

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;

/**
 * 测试用例管理对象 pms_project_testcase
 *
 * @author otto
 * @date 2023-11-22
 */
@Data
@ApiModel("测试用例批量更新对象")
public class PmsProjectTestcaseBatchUpdateVo {

    /**
     * 用例ID列表
     */
    @ApiModelProperty(value = "用例ID列表")
    @NotEmpty
    private List<Long> idList;

    /**
     * 用例维护人Gitlink ID
     */
    @ApiModelProperty(value = "用例维护人Gitlink ID")
    private Long assigneeGitlinkId;
    private Boolean assigneeGitlinkIdIsChange = false;

    /**
     * 用例类型ID
     */
    @ApiModelProperty(value = "用例类型ID")
    private Long typeId;
    private Boolean typeIdIsChange = false;
    /**
     * 标记Id列表，使用逗号分割的字符串
     */
    @ApiModelProperty(value = "标记Id列表，使用逗号分割的字符串，置空可传空字符串")
    private String tagIds;
    private Boolean tagIdsIsChange = false;

    @ApiModelProperty(value = "产品需求规格id")
    private Long productReqSpecsId;
    private Boolean productReqSpecsIdIsChange = false;

    /**
     * 关联模块ID
     */
    @ApiModelProperty(value = "关联模块ID")
    private Long pmsModuleId;
    private Boolean pmsModuleIdIsChange = false;

    /**
     * 更新者
     */
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public Boolean thisIsChange() {
        return assigneeGitlinkIdIsChange
                || typeIdIsChange
                || tagIdsIsChange
                || productReqSpecsIdIsChange
                || pmsModuleIdIsChange;
    }
}
