namespace Admin.NET.Plugin.AiDOP.Entity.S8;
///
/// 异常主表(业务实体;列表为查询该表及关联展示字段,非独立「列表视图表」)。
///
[SugarTable("ado_s8_exception", "S8 异常主表")]
[SugarIndex("uk_ado_s8_exception_tenant_factory_code", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(ExceptionCode), OrderByType.Asc, IsUnique = true)]
public class AdoS8Exception
{
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
public long Id { get; set; }
[SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
public long TenantId { get; set; }
[SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
public long FactoryId { get; set; }
[SugarColumn(ColumnName = "exception_code", Length = 64)]
public string ExceptionCode { get; set; } = string.Empty;
[SugarColumn(ColumnName = "title", Length = 256)]
public string Title { get; set; } = string.Empty;
[SugarColumn(ColumnName = "description", Length = 4000, IsNullable = true)]
public string? Description { get; set; }
[SugarColumn(ColumnName = "scene_code", Length = 64)]
public string SceneCode { get; set; } = string.Empty;
[SugarColumn(ColumnName = "source_type", Length = 32)]
public string SourceType { get; set; } = "MANUAL";
[SugarColumn(ColumnName = "status", Length = 32)]
public string Status { get; set; } = "NEW";
[SugarColumn(ColumnName = "severity", Length = 32)]
public string Severity { get; set; } = "MEDIUM";
[SugarColumn(ColumnName = "priority_score", ColumnDataType = "decimal(10,2)")]
public decimal PriorityScore { get; set; }
[SugarColumn(ColumnName = "priority_level", Length = 16)]
public string PriorityLevel { get; set; } = "P3";
[SugarColumn(ColumnName = "occurrence_dept_id", ColumnDataType = "bigint")]
public long OccurrenceDeptId { get; set; }
[SugarColumn(ColumnName = "responsible_dept_id", ColumnDataType = "bigint")]
public long ResponsibleDeptId { get; set; }
[SugarColumn(ColumnName = "responsible_group_id", ColumnDataType = "bigint", IsNullable = true)]
public long? ResponsibleGroupId { get; set; }
[SugarColumn(ColumnName = "assignee_id", ColumnDataType = "bigint", IsNullable = true)]
public long? AssigneeId { get; set; }
[SugarColumn(ColumnName = "reporter_id", ColumnDataType = "bigint", IsNullable = true)]
public long? ReporterId { get; set; }
[SugarColumn(ColumnName = "sla_deadline", IsNullable = true)]
public DateTime? SlaDeadline { get; set; }
[SugarColumn(ColumnName = "timeout_flag", ColumnDataType = "boolean")]
public bool TimeoutFlag { get; set; }
[SugarColumn(ColumnName = "created_at")]
public DateTime CreatedAt { get; set; } = DateTime.Now;
[SugarColumn(ColumnName = "updated_at", IsNullable = true)]
public DateTime? UpdatedAt { get; set; }
[SugarColumn(ColumnName = "assigned_at", IsNullable = true)]
public DateTime? AssignedAt { get; set; }
[SugarColumn(ColumnName = "closed_at", IsNullable = true)]
public DateTime? ClosedAt { get; set; }
/// 所属模块码(S1-S7),标识异常产生于哪个业务环节
[SugarColumn(ColumnName = "module_code", Length = 16, IsNullable = true)]
public string? ModuleCode { get; set; }
[SugarColumn(ColumnName = "process_node_code", Length = 64, IsNullable = true)]
public string? ProcessNodeCode { get; set; }
[SugarColumn(ColumnName = "related_object_code", Length = 64, IsNullable = true)]
public string? RelatedObjectCode { get; set; }
/// 当前进行中的审批实例ID(用于并发控制)
[SugarColumn(ColumnName = "active_flow_instance_id", IsNullable = true)]
public long? ActiveFlowInstanceId { get; set; }
/// 当前进行中的审批业务类型(EXCEPTION_ESCALATION / EXCEPTION_CLOSURE)
[SugarColumn(ColumnName = "active_flow_biz_type", Length = 32, IsNullable = true)]
public string? ActiveFlowBizType { get; set; }
[SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
public bool IsDeleted { get; set; }
[SugarColumn(ColumnName = "created_by", Length = 64, IsNullable = true)]
public string? CreatedBy { get; set; }
[SugarColumn(ColumnName = "updated_by", Length = 64, IsNullable = true)]
public string? UpdatedBy { get; set; }
}