/**
 * Department-related types
 */

export interface Department {
  id: string;
  name: string;
  description?: string;
  code: string;
  parentId?: string;
  managerId?: string;
  isActive: boolean;
  createdAt: Date;
  updatedAt: Date;
}

export const DEPARTMENTS = [
  'sales',
  'accounting',
  'warehouse',
  'logistics',
  'engineering',
  'it',
  'executive',
  'executive_assistant',
  'hr',
  'procurement',
] as const;

export type DepartmentCode = (typeof DEPARTMENTS)[number];

export interface DepartmentWithStats extends Department {
  employeeCount: number;
  manager?: {
    id: string;
    firstName: string;
    lastName: string;
  };
}

export interface CreateDepartmentDto {
  name: string;
  description?: string;
  code: string;
  parentId?: string;
  managerId?: string;
}

export interface UpdateDepartmentDto {
  name?: string;
  description?: string;
  parentId?: string;
  managerId?: string;
  isActive?: boolean;
}
