using System.Collections.Generic;

namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Output
{
    /// <summary>
    /// 任务数据验证结果
    /// </summary>
    public class TaskDataValidationResult
    {
        /// <summary>
        /// 验证是否通过
        /// </summary>
        public bool IsValid { get; set; }

        /// <summary>
        /// 验证问题列表
        /// </summary>
        public List<ValidationIssue> ValidationIssues { get; set; } = new List<ValidationIssue>();

        /// <summary>
        /// 业务规则违反列表
        /// </summary>
        public List<BusinessRuleViolation> BusinessRuleViolations { get; set; } = new List<BusinessRuleViolation>();

        /// <summary>
        /// 验证摘要
        /// </summary>
        public string ValidationSummary { get; set; } = string.Empty;
    }

    /// <summary>
    /// 验证问题
    /// </summary>
    public class ValidationIssue
    {
        public long TaskId { get; set; }
        public ValidationIssueType IssueType { get; set; }
        public string Description { get; set; } = string.Empty;
        public ValidationSeverity Severity { get; set; }
    }

    /// <summary>
    /// 业务规则违反
    /// </summary>
    public class BusinessRuleViolation
    {
        public long TaskId { get; set; }
        public BusinessRuleType RuleType { get; set; }
        public string RuleDescription { get; set; } = string.Empty;
        public string ViolationDetails { get; set; } = string.Empty;
    }

    /// <summary>
    /// 验证问题类型枚举
    /// </summary>
    public enum ValidationIssueType
    {
        MissingProcess = 1,
        MissingShift = 2,
        InvalidTimeRange = 3,
        MissingProjectNumber = 4
    }

    /// <summary>
    /// 验证严重程度枚举
    /// </summary>
    public enum ValidationSeverity
    {
        Warning = 1,
        Error = 2
    }

    /// <summary>
    /// 业务规则类型枚举
    /// </summary>
    public enum BusinessRuleType
    {
        ShiftRule = 1,
        QualificationRequirement = 2,
        EquipmentAvailability = 3
    }
}