package jnpf.model.cultivate.dto.position;

import jnpf.model.cultivate.po.position.FtbCultivatePositionCourseExam;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 学习课程考试添加 DTO
 *
 * @author fantaibao
 * @date 2023/12/28
 */
@Data
public class FtbStudyCourseExamAddDTO {

    /**
     * 课程主键ID
     */
    @NotBlank(message = "课程主键ID不能为空")
    private String courseId;

    /**
     * 岗位主键ID
     */
    @NotBlank(message = "岗位主键ID不能为空")
    private String postRankId;

    /**
     * 岗位学习主键ID
     */
    @NotBlank(message = "岗位学习主键ID不能为空")
    private String postLearnId;

    /**
     * 考试主键id
     */
    @NotBlank(message = "考试主键id不能为空")
    private String examId;

    public FtbCultivatePositionCourseExam convertFtbCultivatePositionCourseExam(FtbStudyCourseExamAddDTO ftbStudyCourseExamAddDTO) {
        if (ftbStudyCourseExamAddDTO == null) {
            return null;
        }
        FtbCultivatePositionCourseExam ftbCultivatePositionCourseExam = new FtbCultivatePositionCourseExam();
        ftbCultivatePositionCourseExam.setEnabledMark(0);
        ftbCultivatePositionCourseExam.setCourseId(ftbStudyCourseExamAddDTO.getCourseId());
        ftbCultivatePositionCourseExam.setPostRankId(ftbStudyCourseExamAddDTO.getPostRankId());
        ftbCultivatePositionCourseExam.setPostLearnId(ftbStudyCourseExamAddDTO.getPostLearnId());
        ftbCultivatePositionCourseExam.setExamId(ftbStudyCourseExamAddDTO.getExamId());
        return ftbCultivatePositionCourseExam;
    }

}
