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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.microservices.common.core.utils.bean.BeanUtils;
import com.microservices.pms.product.domain.PmsProductPlan;
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;

/**
 * 产品计划对象 pms_product_plan
 *
 * @author microservices
 * @date 2023-10-10
 */
@Data
@ApiModel("产品计划更新对象")
public class PmsProductPlanUpdateVo
{
    /** 产品计划ID */
    @NotNull
    @ApiModelProperty(value = "产品计划ID")
    private Long id;

    /** 计划标题 */
    @ApiModelProperty(value = "计划标题")
    @Size(max = 50, message = "长度需要小于50")
    private String planTitle;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    /** 计划描述 */
    @ApiModelProperty(value = "计划描述")
    @Size(max = 200, message = "长度需要小于200")
    private String planDescription;

    /** 关联优先级ID */
    @ApiModelProperty(value = "关联优先级ID")
    private Long priorityId;

    /** 关联状态ID */
    @ApiModelProperty(value = "关联状态ID(状态可传值为{进行中：重开计划，已完成：完成计划，已关闭：关闭计划},仅当状态为已关闭时才可进行重开计划)")
    private Long statusId;

    public PmsProductPlan toPmsProductPlan(){
        PmsProductPlan target = new PmsProductPlan();
        BeanUtils.copyProperties(this, target);
        return target;
    }

}
