Package user.roles

Class HRAdmin


public class HRAdmin extends Employee
Represents an HR Admin in the system, responsible for managing employee-related tasks such as attendance, leave, and employee records.

Available methods:

  • Constructor Details

    • HRAdmin

      public HRAdmin(FileDataService dataService, int employeeID)
      Constructs an HRAdmin object.
      Parameters:
      dataService - The data service used for data manipulation.
      employeeID - The unique identifier of the HR Admin employee.
  • Method Details

    • getNewEmployeeID

      public String getNewEmployeeID()
      Retrieves the ID for a new employee.
      Returns:
      The ID for a new employee.
    • getEmployeeList

      public List<EmployeeRecord> getEmployeeList()
      Retrieves a list of all employees.
      Returns:
      A list of all employees.
    • getEmployeeIDList

      public List<Integer> getEmployeeIDList()
      Retrieves a list of all employee IDs.
      Returns:
      A list of all employee IDs.
    • getAllAttendanceRecords

      public List<AttendanceRecord> getAllAttendanceRecords()
      Retrieves a list of all attendance records.
      Returns:
      A list of all attendance records.
    • getAllLeaveRecords

      public List<LeaveRecord> getAllLeaveRecords()
      Retrieves a list of all leave records.
      Returns:
      A list of all leave records.
    • getEmployeeLeaveRecord

      public LeaveRecord getEmployeeLeaveRecord(String leaveID)
      Retrieves the leave record for a specific employee.
      Parameters:
      leaveID - The leave ID associated with the leave record.
      Returns:
      The leave record for the specified employee.
    • getEmployeeRecord

      public EmployeeRecord getEmployeeRecord(int employeeID)
      Retrieves the employee record for a specific employee.
      Parameters:
      employeeID - The ID of the employee.
      Returns:
      The employee record for the specified employee.
    • getEmployeeCSVPath

      public String getEmployeeCSVPath()
      Retrieves the file path for the employee CSV file.
      Returns:
      The file path for the employee CSV file.
    • getAddedEmployeeCount

      public int getAddedEmployeeCount()
      Retrieves the count of added employees.
      Returns:
      The count of added employees.
    • addEmployee

      public void addEmployee(EmployeeRecord newRecord) throws EmployeeRecordsException
      Adds a new employee record.
      Parameters:
      newRecord - The new employee record to be added.
      Throws:
      EmployeeRecordsException - If an error occurs while adding the employee record.
    • addEmployee

      public void addEmployee() throws EmployeeRecordsException
      Adds employees from a CSV file.
      Throws:
      EmployeeRecordsException - If an error occurs while adding employees from the CSV file.
    • updateEmployee

      public void updateEmployee(EmployeeRecord updatedRecord) throws EmployeeRecordsException
      Updates an employee record.
      Parameters:
      updatedRecord - The updated employee record.
      Throws:
      EmployeeRecordsException - If an error occurs while updating the employee record.
    • terminateEmployee

      public void terminateEmployee(EmployeeRecord selectedEmployee) throws EmployeeRecordsException
      Terminates an employee.
      Parameters:
      selectedEmployee - The employee to be terminated.
      Throws:
      EmployeeRecordsException - If an error occurs while terminating the employee.
    • approveLeave

      public void approveLeave(String leaveID)
      Approves a leave request.
      Parameters:
      leaveID - The ID of the leave request to be approved.
    • rejectLeave

      public void rejectLeave(String leaveID, int employeeID, String leaveType, int duration)
      Rejects a leave request.
      Parameters:
      leaveID - The ID of the leave request to be rejected.
      employeeID - The ID of the employee requesting leave.
      leaveType - The type of leave requested.
      duration - The duration of leave requested.
    • generateAttendanceReport

      public List<String[]> generateAttendanceReport(String reportPeriod) throws AttendanceException
      Generates an attendance report for the specified period.
      Parameters:
      reportPeriod - The period for which the report is generated.
      Returns:
      A list of string arrays representing the attendance report.
      Throws:
      AttendanceException - If an error occurs while generating the attendance report.
    • setEmployeeCSV_File

      public void setEmployeeCSV_File(String filePath)
      Sets the file path for the employee CSV file.
      Parameters:
      filePath - The file path for the employee CSV file.
    • getActiveEmployeeList

      public List<EmployeeRecord> getActiveEmployeeList()
      Retrieves a list of active employees.
      Returns:
      A list of active employees.