/**
 * Common type definitions for the tOS application
 */

// Import and re-export shared types
import type { UserRole } from '@tos/shared';
export type { UserRole };

/** Department type */
export interface Department {
  id: string;
  name: string;
  description?: string;
  managerId?: string;
}

/** User type */
export interface User {
  id: string;
  email: string;
  firstName: string;
  lastName: string;
  displayName: string;
  avatarUrl?: string;
  roles: UserRole[];
  departmentId?: string;
  department?: Department;
  isActive: boolean;
  createdAt: Date;
  updatedAt: Date;
}

/** API response wrapper */
export interface ApiResponse<T> {
  data: T;
  message?: string;
  success: boolean;
}

/** Paginated response */
export interface PaginatedResponse<T> {
  data: T[];
  total: number;
  page: number;
  pageSize: number;
  totalPages: number;
}

/** Sort direction */
export type SortDirection = 'asc' | 'desc';

/** Common query parameters */
export interface QueryParams {
  page?: number;
  pageSize?: number;
  sortBy?: string;
  sortDirection?: SortDirection;
  search?: string;
}

/** Status types for various entities */
export type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'cancelled';

/** Contract type */
export type ContractType =
  | 'full_time'
  | 'part_time'
  | 'mini_job'
  | 'intern'
  | 'trainee'
  | 'freelance';

/** Skill level (0-4) */
export type SkillLevel = 0 | 1 | 2 | 3 | 4;

/** Navigation item type */
export interface NavItem {
  key: string;
  href: string;
  icon: React.ComponentType<{ className?: string }>;
  requiredRoles?: UserRole[];
  children?: NavItem[];
}

/** Widget configuration */
export interface WidgetConfig {
  id: string;
  type: string;
  title: string;
  position: { x: number; y: number };
  size: { width: number; height: number };
  settings?: Record<string, unknown>;
}

/** Dashboard configuration */
export interface DashboardConfig {
  id: string;
  name: string;
  widgets: WidgetConfig[];
  isDefault: boolean;
}

// Re-export integration types
export * from './integrations';

// Re-export HR types
export * from './hr';
