using IRaCIS.Core.Domain.Share;
using System.Linq;

namespace IRaCIS.Core.Domain.Models;

[Comment("项目阅片访视裁判规则")]
[Table("ReadingQuestionVisitJudgeRule")]
public class ReadingQuestionVisitJudgeRule : BaseAddAuditEntity
{
    #region 导航属性
    [Comment("分页标准")]
    [ForeignKey("ReadingQuestionId")]
    [JsonIgnore]
    public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
    #endregion

    /// <summary>
    /// 问题Id
    /// </summary>
    [Comment("问题Id")]
    public Guid ReadingQuestionId { get; set; }

    /// <summary>
    /// 访视Num (计划外是-1)
    /// </summary>
    public decimal VisitNum { get; set; }

    /// <summary>
    /// 答案分组
    /// </summary>
    [MaxLength]
    [Comment("答案分组")]
    public List<string> AnswerGroup { get; set; } = new List<string>();

    /// <summary>
    /// 答案组合
    /// </summary>
    [Comment("答案组合")]
    [MaxLength]
    public List<AnswerCombinationDto> AnswerCombination { get; set; } = new List<AnswerCombinationDto>();

    /// <summary>
    /// 裁判类型
    /// </summary>
    [Comment("裁判类型")]
    public JudgeTypeEnum JudgeType { get; set; } = JudgeTypeEnum.AnswerDisaffinity;

    /// <summary>
    /// 裁判百分比或绝对值的相差值
    /// </summary>
    [Comment("裁判百分比或绝对值的相差值")]
    public decimal? JudgeDifferenceValue { get; set; } = 0;

    /// <summary>
    /// 裁判百分比或绝对值的相差值匹配规则
    /// </summary>
    [Comment("裁判百分比或绝对值的相差值匹配规则")]
    public JudgeDifferenceType JudgeDifferenceType { get; set; }
}


public class AnswerCombinationDto
{
    public List<string> AnswerGroupA { get; set; }

    public List<string> AnswerGroupB { get; set; }
}
