using TakeoutSaaS.Domain.Dictionary.Enums;
using TakeoutSaaS.Domain.Dictionary.ValueObjects;
using TakeoutSaaS.Shared.Abstractions.Entities;

namespace TakeoutSaaS.Domain.Dictionary.Entities;

/// <summary>
/// 参数字典分组（系统参数、业务参数）。
/// </summary>
public sealed class DictionaryGroup : MultiTenantEntityBase
{
    /// <summary>
    /// 分组编码（唯一）。
    /// </summary>
    public DictionaryCode Code { get; set; }

    /// <summary>
    /// 分组名称。
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 分组作用域：系统/业务。
    /// </summary>
    public DictionaryScope Scope { get; set; } = DictionaryScope.Business;

    /// <summary>
    /// 是否允许租户覆盖。
    /// </summary>
    public bool AllowOverride { get; set; }

    /// <summary>
    /// 描述信息。
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// 是否启用。
    /// </summary>
    public bool IsEnabled { get; set; } = true;

    /// <summary>
    /// 并发控制字段。
    /// </summary>
    public byte[] RowVersion { get; set; } = Array.Empty<byte>();

    /// <summary>
    /// 字典项集合。
    /// </summary>
    public ICollection<DictionaryItem> Items { get; set; } = new List<DictionaryItem>();
}
