package org.dromara.system.domain.bo;

import lombok.Getter;
import lombok.Setter;
import org.dromara.system.domain.SysScreeningAssessmentQuestion;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

import java.util.List;

/**
 * 题目业务对象 sys_screening_assessment_question
 *
 * @author Lion Li
 * @date 2025-07-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SysScreeningAssessmentQuestion.class, reverseConvertGenerate = false)
public class SysScreeningAssessmentQuestionBo extends BaseEntity {

    /**
     * 主键ID
     */
    @NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
    private Long questionId;

    /**
     * 主键ID
     */
    private Long configId;

    private Object value;

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空", groups = {AddGroup.class, EditGroup.class})
    private String title;

    /**
     * 题型
     */
    @NotBlank(message = "题型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String questionType;

    /**
     * 子题型
     */
    private String questionChildType;

    /**
     * 系统参数-other类型：
     */
    private String lastType;

    /**
     * 内容
     */
    private String content;

    private List<QuestionAttrBo> contentList;

    /**
     * 是否必填
     */
    private Boolean required;

    /**
     * 横向排列、竖向排列
     */
    private String arrangement;

    /**
     * 累计选项得分、按最高分、按最低分
     */
    private String scoreMethod;

    @Getter
    @Setter
    public static class QuestionAttrBo {
        private Boolean labelFlag;
        private String label;
        private String value;
        private String nameEn;
        private String formType;
        private String score;
        private String img;
        private Boolean allowFillBlank;
        private String matrixFillBlank;
        private String unit;
        private String optionContent;
        private Boolean optionFlag;
    }
}
