/**
 * filekorolheader: 部门管理类型定义 - 部门数据类型和接口定义
 * 功能：TypeScript类型定义、接口规范、数据结构
 * 路径：/central-config/user/department/types
 * 规范：遵循crop-x/docs/开发项目规范.md，TypeScript类型安全
 */

// 部门状态枚举
export type DepartmentStatus = 'active' | 'inactive';

// 部门接口定义
export interface Department {
  id: string;
  name: string;
  code: string;
  level: number;
  manager?: string;
  phone?: string;
  email?: string;
  description?: string;
  sort: number;
  status: DepartmentStatus;
  parentId?: string;
  createdAt: string;
  updatedAt: string;
  children?: Department[];
}

// 创建部门表单数据类型
export interface CreateDepartmentForm {
  name: string;
  code: string;
  manager?: string;
  phone?: string;
  email?: string;
  description?: string;
  sort: number;
  status: DepartmentStatus;
  parentId?: string;
  level: number;
}

// 部门统计数据类型
export interface DepartmentStats {
  level1: number;
  level2: number;
  total: number;
}

// 拖拽项目类型
export interface DraggedItem {
  dept: Department;
  index: number;
  parentId?: string;
}

export interface DragOverItem {
  index: number;
  parentId?: string;
}