using QYZH.InteractiveMagazine.Models.Enum;
using QYZH.InteractiveMagazine.Models.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QYZH.InteractiveMagazine.Models.Dto.Journal
{
    public class JournalTaskOutput
    {
        public long TaskId { get; set; }
        public string TaskNo { get; set; }

        public TaskTypeEnum TaskType
        {
            get
            {
                var type = new TaskBankType();
                if (type.ObjectiveTypes.Contains(TaskSubType))
                    return TaskTypeEnum.Objective;
                else if (type.SubjectiveTypes.Contains(TaskSubType))
                    return TaskTypeEnum.Subjective;
                else
                    throw new InvalidOperationException($"Unknown task sub type: {TaskSubType}");
            }
        }

        /// <summary>
        /// 详细类型
        /// </summary>
        public TaskBankTypeEnum TaskSubType { get; set; }
    }
}
