package jnpf.model.app;

import io.swagger.v3.oas.annotations.media.Schema;
import jnpf.entity.training.TrainingIdentifyTemplateEntity;
import jnpf.entity.training.TrainingIdentifyTemplateOptionEntity;
import jnpf.entity.training.TrainingIdentifyUserEntity;
import jnpf.enums.training.CourseEnums;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 *
 * 鉴定详情
 *
 * @author yanglei
 * @since 2023-07-19
 */
@Data
public class IdentifyInfoVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "鉴定ID")
    private String id;

    @Schema(description = "用户信息")
    private TrainingIdentifyUserEntity user;

    @Schema(description = "鉴定模板信息")
    private TrainingIdentifyTemplateEntity template;

    @Schema(description = "内容列表")
    private List<IdentifyOptionInfoVO> optionList;

    @Schema(description = "状态（0待鉴定，1通过，2未通过）")
    private Integer status;

    @Data
    public static class IdentifyOptionInfoVO extends TrainingIdentifyTemplateOptionEntity{
        @Schema(description = "选项列表")
        private List<IdentifySelectInfoVO> selectList;
    }

    @Accessors(chain = true)
    @Data
    public static class IdentifySelectInfoVO {
        @Schema(description = "值")
        private Integer value;

        @Schema(description = "名称")
        private String label;

        @Schema(description = "是否选中（0否，1是）")
        private Integer selected;

        public IdentifySelectInfoVO(CourseEnums.IdentifyOption option){
            this.value = option.getCode();
            this.label = option.getDesc();
            this.selected = 0;
        }
    }

}