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

namespace YBDevice.NApi.Application.Prescription
{
    /// <summary>
    /// 儿童处方数据标准
    /// </summary>
    public class ChildPrescriptionS2SDto
    {
        /// <summary>
        /// BMI标准
        /// </summary>
        public string BMILevel { get; set; }
        /// <summary>
        /// 身高标准
        /// </summary>
        public string HeightLevel { get; set; }
        /// <summary>
        /// 体重标准
        /// </summary>
        public string WeightLevel { get; set; }
        /// <summary>
        /// 年龄,月龄
        /// </summary>
        public int Age { get; set; }
    }
    /// <summary>
    /// 儿童体质列表
    /// </summary>
    public class ChildPhysiqueS2CDto : ChildPhysiqueC2SDto
    {
        /// <summary>
        /// 文本
        /// </summary>
        public string Text { get; set; }
    }
    /// <summary>
    /// 儿童体质结果
    /// </summary>
    public class ChildPhysiqueResultS2CDto
    {
        /// <summary>
        /// 结果,为空时则表示没结果
        /// </summary>
        public string Result { get; set; } = "";
        /// <summary>
        /// 体质列表
        /// </summary>
        public List<ChildPhysiqueS2CDto> list { get; set; }
    }
    /// <summary>
    /// 儿童体质计算
    /// </summary>
    public class ChildPhysiqueCalcC2SDto
    {
        /// <summary>
        /// 家庭成员ID
        /// </summary>
        public int FamilyId { get; set; }
        /// <summary>
        /// 体质结果列表
        /// </summary>
        public List<ChildPhysiqueC2SDto> data { get; set; }
    }

    /// <summary>
    /// 儿童体质信息
    /// </summary>
    public class ChildPhysiqueC2SDto : IValidatableObject
    {
        /// <summary>
        /// 类型,1-饮食,2-睡眠,3-精神,4-头面,5-口鼻,6-皮肤,7-指甲,8-大小便,9-出汗,10-身高体重
        /// </summary>
        public int Type { get; set; }
        /// <summary>
        /// 分数
        /// </summary>
        public int Value { get; set; }
        /// <summary>
        /// ID
        /// </summary>
        public Guid Id { get; set; }

        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            if (Id == Guid.Empty)
            {
                yield return new ValidationResult("请先选择", new[] { nameof(Id) });
            }
        }
    }
}
