using HoneyBox.Admin.Models.AdminUser;
using HoneyBox.Admin.Models.Department;

namespace HoneyBox.Admin.Services;

/// <summary>
/// 部门服务接口
/// </summary>
public interface IDepartmentService
{
    /// <summary>
    /// 获取部门树形结构
    /// </summary>
    /// <returns>部门树列表</returns>
    Task<List<DepartmentTreeDto>> GetDepartmentTreeAsync();

    /// <summary>
    /// 根据ID获取部门详情
    /// </summary>
    /// <param name="id">部门ID</param>
    /// <returns>部门详情</returns>
    Task<DepartmentDto> GetByIdAsync(long id);

    /// <summary>
    /// 创建部门
    /// </summary>
    /// <param name="request">创建请求</param>
    /// <returns>新部门ID</returns>
    Task<long> CreateAsync(CreateDepartmentRequest request);

    /// <summary>
    /// 更新部门
    /// </summary>
    /// <param name="id">部门ID</param>
    /// <param name="request">更新请求</param>
    Task UpdateAsync(long id, UpdateDepartmentRequest request);

    /// <summary>
    /// 删除部门
    /// </summary>
    /// <param name="id">部门ID</param>
    Task DeleteAsync(long id);

    /// <summary>
    /// 获取部门已分配的菜单ID列表
    /// </summary>
    /// <param name="departmentId">部门ID</param>
    /// <returns>菜单ID列表</returns>
    Task<List<long>> GetMenuIdsAsync(long departmentId);

    /// <summary>
    /// 分配菜单给部门
    /// </summary>
    /// <param name="departmentId">部门ID</param>
    /// <param name="menuIds">菜单ID列表</param>
    Task AssignMenusAsync(long departmentId, List<long> menuIds);

    /// <summary>
    /// 获取部门下的用户列表
    /// </summary>
    /// <param name="departmentId">部门ID</param>
    /// <returns>用户列表</returns>
    Task<List<AdminUserDto>> GetDepartmentUsersAsync(long departmentId);
}
