package jnpf.model.cultivate.dto.promotion;

import jnpf.model.cultivate.po.promotion.FtbCultivatePromotion;
import jnpf.model.cultivate.vo.promotion.FtbCultivatePromotionPostVO;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Title: FtbCultivatePromotionCreatDto 晋升通道实体类返回
 * @Author: peng.hao
 * @create: 2023/12/1713:38
 */
@Data
public class FtbCultivatePromotionCreatDto {
    /**
     * 晋升通道主键id(修改必传)
     */
    private String id;

    /**
     * 晋升通道名称
     */
    @NotNull(message = "晋升通道名称不能为空")
    private String promotion;


    /**
     * 晋升通道ID，生成规则见原型
     */
    private String promotionBusinessId;


    /**
     * 通道分级岗位
     */
    private List<FtbCultivatePromotionPostVO> postChannelLevel;


    public static FtbCultivatePromotion  coverFtbCultivatePromotionCreatDto(FtbCultivatePromotionCreatDto creatDto) {
        if (creatDto == null) {
            return null;
        }
        FtbCultivatePromotion ftbCultivatePromotion = new FtbCultivatePromotion();
        ftbCultivatePromotion.setId(creatDto.getId());
        ftbCultivatePromotion.setPromotion(creatDto.getPromotion());

        ftbCultivatePromotion.setPromotionBusinessId(creatDto.getPromotionBusinessId());
        return ftbCultivatePromotion;
    }
}
