using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using FreeSql.DataAnnotations;
using ZhonTai.Admin.Core.Entities;
using NPP.SmartSchedue.Api.Contracts.Core.Consts;
using NPP.SmartSchedue.Api.Contracts.Core.Enums;
namespace NPP.SmartSchedue.Api.Contracts.Domain.Notification;
///
/// 人员组实体
/// 决策点4:混合人员组,支持静态+动态规则
/// 决策点5:不支持多租户,继承EntityBase
///
[Table(Name = DbConsts.TableNamePrefix + "personnel_group")]
public partial class PersonnelGroupEntity : EntityBase
{
#region 基础信息
///
/// 人员组名称
///
[Column(StringLength = 200)]
[Required(ErrorMessage = "人员组名称不能为空")]
public string GroupName { get; set; } = "";
///
/// 人员组描述
///
[Column(StringLength = 500)]
public string Description { get; set; } = "";
///
/// 人员组类型
///
public int GroupType { get; set; } = (int)PersonnelGroupTypeEnum.Mixed;
///
/// 是否启用
///
public bool IsEnabled { get; set; } = true;
#endregion
#region 静态人员配置
///
/// 静态人员ID列表(JSON格式存储,如:[1,2,3,4,5])
///
[Column(DbType = "text")]
public string StaticPersonnelIds { get; set; } = "[]";
#endregion
#region 动态规则配置
///
/// 动态规则:部门ID列表(JSON格式存储,如:[1,2,3])
/// 当GroupType包含DynamicByDepartment时有效
///
[Column(DbType = "text")]
public string DynamicDepartmentIds { get; set; } = "[]";
///
/// 动态规则:职位列表(JSON格式存储,如:["经理","主管","组长"])
/// 当GroupType包含DynamicByPosition时有效
///
[Column(DbType = "text")]
public string DynamicPositions { get; set; } = "[]";
///
/// 动态规则:是否仅包含激活人员
///
public bool OnlyActivePersonnel { get; set; } = true;
#endregion
#region 排除规则
///
/// 排除人员ID列表(JSON格式存储)
/// 在动态规则生成的人员列表中排除这些人员
///
[Column(DbType = "text")]
public string ExcludePersonnelIds { get; set; } = "[]";
#endregion
#region 时间信息
///
/// 最后修改时间
///
public DateTime? LastModifiedTime { get; set; }
#endregion
#region 导航属性
///
/// 使用此人员组的通知设置列表
///
[Navigate("PersonnelGroupId")]
public List NotificationSettings { get; set; } = new List();
#endregion
}