using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YBDevice.Entity.ViewModel
{
    /// <summary>
    /// 家庭成员信息
    /// </summary>
    public class BaseFamilyDto
    {
        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public int FamilyId { get; set; }
    }
    /// <summary>
    /// 儿童体质列表查询
    /// </summary>
    public class ChildBodyListC2SDto : BaseFamilyDto
    {
        /// <summary>
        /// 是否重新计算,0-否,1-是
        /// </summary>
        public int IsRestart { get; set; } = 0;
    }
    /// <summary>
    /// 儿童体质列表
    /// </summary>
    public class ChildBodyListS2SDto
    {
        /// <summary>
        /// 没有(根本不)的分数值
        /// </summary>
        public int NoneValue { get; set; }
        /// <summary>
        /// 很少(有一点)的分数值
        /// </summary>
        public int LittleValue { get; set; }
        /// <summary>
        /// 有时(有些)的分数值
        /// </summary>
        public int SomeValue { get; set; }
        /// <summary>
        /// 经常(相当)的分数值
        /// </summary>
        public int OftenValue { get; set; }
        /// <summary>
        /// 总是(非常)的分数值
        /// </summary>
        public int AlWaysValue { get; set; }
        /// <summary>
        /// 问题内容
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 主键
        /// </summary>
        public Guid Id { get; set; }
    }

    /// <summary>
    /// 儿童体质列表
    /// </summary>
    public class ChildBodyListS2CDto
    {
        /// <summary>
        /// 体质类型
        /// </summary>
        public ChildBodyTypeEnum Id { get; set; }

        /// <summary>
        /// 类型名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 问题列表
        /// </summary>
        public List<ChildBodyListS2SDto> qalist { get; set; }
    }
    /// <summary>
    /// 儿童体质结果查询
    /// </summary>
    public class ChildBodyInfoC2SDto : BaseFamilyDto
    {

    }
    /// <summary>
    /// 体质计算提交信息
    /// </summary>
    public class ChildBodySumitC2SDto : BaseFamilyDto, IValidatableObject
    {
        /// <summary>
        /// 选择的结果
        /// </summary>
        public List<ChildBodySubmitDto> data { get; set; }
        /// <summary>
        /// 验证
        /// </summary>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (data == null || data.Count != 7)
            {
                yield return new ValidationResult("请先完成问答", new[] { nameof(data) });
            }
        }
    }
    /// <summary>
    /// 体质计算提交信息
    /// </summary>
    public class ChildBodySubmitDto
    {
        /// <summary>
        /// 类型ID
        /// </summary>
        public ChildBodyTypeEnum id { get; set; }

        /// <summary>
        /// 答案列表
        /// </summary>
        public List<ChildBodySubmitItemS2SDto> list { get; set; }
    }
    /// <summary>
    /// 答案列表
    /// </summary>
    public class ChildBodySubmitItemS2SDto
    {
        /// <summary>
        /// 问答ID
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// 分数
        /// </summary>
        public int Score { get; set; }
    }
    /// <summary>
    /// 问答最终计算结果
    /// </summary>
    public class ChildBodySubmitResultData
    {
        /// <summary>
        /// 体质结果
        /// </summary>
        public string BodyType { get; set; }
        /// <summary>
        /// 结果列表
        /// </summary>
        public List<ChildBodySubmitResult> list { get; set; }
        /// <summary>
        /// 引用文献列表
        /// </summary>
        public List<string> ReferList { get; set; }
    }

    /// <summary>
    /// 问答最终计算结果
    /// </summary>
    public class ChildBodySubmitResult
    {
        /// <summary>
        /// 体质类型
        /// </summary>
        public ChildBodyTypeEnum Type { get; set; }
        /// <summary>
        /// 体质类型
        /// </summary>
        public string BodyType { get; set; }
        /// <summary>
        /// 判定结果,1-是,2-基本是,3-否
        /// </summary>
        public ChildBodyTypeResult Result { get; set; }
        /// <summary>
        /// 定义
        /// </summary>
        public string Define { get; set; }

        /// <summary>
        /// 形体特征
        /// </summary>
        public string Proper { get; set; }
        /// <summary>
        /// 素体表现
        /// </summary>
        public string Show { get; set; }
        /// <summary>
        /// 饮食
        /// </summary>
        public string Food { get; set; }
        /// <summary>
        /// 生长发育
        /// </summary>
        public string Growth { get; set; }
        /// <summary>
        /// 外界环境
        /// </summary>
        public string OutsideEnv { get; set; }
        /// <summary>
        /// 转化
        /// </summary>
        public string Conver { get; set; }
        /// <summary>
        /// 成因
        /// </summary>
        public string Causes { get; set; }
        /// <summary>
        /// 建议方案
        /// </summary>
        public string Advice { get; set; }
        /// <summary>
        /// 中药辩体保健方案
        /// </summary>
        public string ZYAdvice { get; set; }
        /// <summary>
        /// 保健方案
        /// </summary>
        public string CareAdivce { get; set; }
    }
}
