using System.ComponentModel.DataAnnotations;

namespace HoneyBox.Admin.Models.Department;

/// <summary>
/// 创建部门请求
/// </summary>
public class CreateDepartmentRequest
{
    /// <summary>
    /// 父部门ID，0表示顶级部门
    /// </summary>
    public long ParentId { get; set; } = 0;

    /// <summary>
    /// 部门名称
    /// </summary>
    [Required(ErrorMessage = "部门名称不能为空")]
    [MaxLength(100, ErrorMessage = "部门名称最多100个字符")]
    public string Name { get; set; } = null!;

    /// <summary>
    /// 部门编码
    /// </summary>
    [MaxLength(50, ErrorMessage = "部门编码最多50个字符")]
    public string? Code { get; set; }

    /// <summary>
    /// 部门描述
    /// </summary>
    [MaxLength(500, ErrorMessage = "部门描述最多500个字符")]
    public string? Description { get; set; }

    /// <summary>
    /// 排序号
    /// </summary>
    public int SortOrder { get; set; } = 0;

    /// <summary>
    /// 状态：0禁用 1启用
    /// </summary>
    [Range(0, 1, ErrorMessage = "状态必须是0(禁用)或1(启用)")]
    public byte Status { get; set; } = 1;
}
