/**
 * Employee and HR-related types
 */

export interface Employee {
  id: string;
  userId: string;
  employeeNumber: string;
  position: string;
  entryDate: Date;
  exitDate?: Date;
  contractType: ContractType;
  workingHours: number;
  departmentId: string;
  managerId?: string;
  createdAt: Date;
  updatedAt: Date;
}

export type ContractType =
  | 'FULL_TIME'
  | 'PART_TIME'
  | 'MINI_JOB'
  | 'INTERN'
  | 'WORKING_STUDENT'
  | 'FREELANCE'
  | 'TEMPORARY';

export interface TimeEntry {
  id: string;
  employeeId: string;
  date: Date;
  clockIn: Date;
  clockOut?: Date;
  breakMinutes: number;
  type: TimeEntryType;
  note?: string;
  correctedById?: string;
  createdAt: Date;
  updatedAt: Date;
}

export type TimeEntryType =
  | 'REGULAR'
  | 'OVERTIME'
  | 'HOLIDAY'
  | 'SICK'
  | 'VACATION'
  | 'CORRECTION';

export interface Absence {
  id: string;
  employeeId: string;
  type: AbsenceType;
  startDate: Date;
  endDate: Date;
  days: number;
  status: ApprovalStatus;
  approvedById?: string;
  approvedAt?: Date;
  note?: string;
  createdAt: Date;
  updatedAt: Date;
}

export type AbsenceType =
  | 'VACATION'
  | 'SICK'
  | 'SICK_CHILD'
  | 'SPECIAL_LEAVE'
  | 'UNPAID_LEAVE'
  | 'PARENTAL_LEAVE'
  | 'HOME_OFFICE'
  | 'BUSINESS_TRIP'
  | 'TRAINING'
  | 'COMPENSATION';

export type ApprovalStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'CANCELLED';

export interface EmployeeReview {
  id: string;
  employeeId: string;
  date: Date;
  type: ReviewType;
  notes?: string;
  goals?: ReviewGoal[];
  reviewerId: string;
  createdAt: Date;
  updatedAt: Date;
}

export type ReviewType = 'PROBATION' | 'ANNUAL' | 'GOAL_SETTING' | 'FEEDBACK';

export interface ReviewGoal {
  title: string;
  description?: string;
  dueDate?: Date;
  status: 'open' | 'in_progress' | 'completed' | 'cancelled';
}

export interface OnboardingTask {
  id: string;
  title: string;
  description?: string;
  dueOffset: number;
  assignedTo?: string;
  departmentId?: string;
  isActive: boolean;
  createdAt: Date;
  updatedAt: Date;
}

export interface CreateTimeEntryDto {
  date: Date;
  clockIn: Date;
  clockOut?: Date;
  breakMinutes?: number;
  type?: TimeEntryType;
  note?: string;
}

export interface CreateAbsenceDto {
  type: AbsenceType;
  startDate: Date;
  endDate: Date;
  days: number;
  note?: string;
}

export interface UpdateAbsenceStatusDto {
  status: ApprovalStatus;
  note?: string;
}
