using Hotline.Share.Dtos.Settings;
using Hotline.Share.Enums.Settings;
using SqlSugar;
using XF.Domain.Repository;

namespace Hotline.Settings.TimeLimits
{
    public class TimeLimit : CreationEntity
    {

        public string TimeLimitName { get; set; }

        public string WorkflowName { get; set; }

        public string WorkflowCode { get; set; }

        public ETimeLimitState TimeLimitState { get; set; }

        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
        public List<ParamValueModel>? ParamArr { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
        public List<PriorityModel>? Priority { get; set; }

        /// <summary>
        /// 组合
        /// </summary>
        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
        public List<CombinationModel>? Combination { get; set; }

    }


    public class TimeLimitBaseDataModel
    {
        public string Id { get; set; }

        public string Name { get; set; }

        /// <summary>
        /// 业务流程编码（多个使用“,”分隔）
        /// </summary>
        public string WorkflowCodes { get; set; }

        public ETimeLimitType TimeLimitType { get; set; }

        public string TypeCode { get; set; }

        //public static GetBaseData
        public TimeLimitBaseDataModel(string id,string name,string workflowCodes, ETimeLimitType timelimitType,string typeCode)
        {
            Id = id;
            Name = name;
            WorkflowCodes = workflowCodes;
            TimeLimitType = timelimitType;
            TypeCode = typeCode;
        }
    }


    public static class TimeLimitBaseData
    {
        public static List<TimeLimitBaseDataModel> GetBaseData()
        {
            return new List<TimeLimitBaseDataModel>()
            {
                new TimeLimitBaseDataModel("82fde961-b1a7-11ed-ad8e-005056a2d053","受理类型", "Order", ETimeLimitType.Enum, TimeLimitBaseDataConsts.AcceptType),
                new TimeLimitBaseDataModel("33b756f6-b1a9-11ed-ad8e-005056a2d053", "热点分类","Order",ETimeLimitType.HotPots,TimeLimitBaseDataConsts.HotPots),
                //new TimeLimitBaseDataModel("c45da596-b1aa-11ed-ad8e-005056a2d053", "推送分类", "Order", ETimeLimitType.DicData, TimeLimitBaseDataConsts.PushType),
                new TimeLimitBaseDataModel("ee78d588-b1aa-11ed-ad8e-005056a2d053", "来源渠道", "Order", ETimeLimitType.DicData, TimeLimitBaseDataConsts.SourceChannel),
                new TimeLimitBaseDataModel("8f9209d1-b1ab-11ed-ad8e-005056a2d053", "来电人身份", "Order", ETimeLimitType.Enum, TimeLimitBaseDataConsts.IdentityType),
                new TimeLimitBaseDataModel("d6100e08-b1ab-11ed-ad8e-005056a2d053", "工单类型", "Order", ETimeLimitType.DicData, TimeLimitBaseDataConsts.OrderType),
                new TimeLimitBaseDataModel("f21424ff-b1ab-11ed-ad8e-005056a2d053", "证件类型", "Order", ETimeLimitType.DicData, TimeLimitBaseDataConsts.LicenceType),
                new TimeLimitBaseDataModel("bda69be9-b1b2-11ed-ad8e-005056a2d053", "紧急程度", "Order", ETimeLimitType.Enum, TimeLimitBaseDataConsts.EmergencyLevel),
                new TimeLimitBaseDataModel("cd3b29dd-b1bf-11ed-ad8e-005056a2d053","默认参数","ZengBie,AddKnowledgeAsync",ETimeLimitType.DefaultTime,TimeLimitBaseDataConsts.DefaultTime)
            };
        }
    }
}
