java.lang.Object
user.roles.Employee
user.roles.HRAdmin
Represents an HR Admin in the system, responsible for managing employee-related tasks such as
attendance, leave, and employee records.
Available methods:
getNewEmployeeID()Retrieves the ID for a new employee.getEmployeeList()Retrieves a list of all employees.getEmployeeIDList()Retrieves a list of all employee IDs.getAllAttendanceRecords()Retrieves a list of all attendance records.getAllLeaveRecords()Retrieves a list of all leave records.getEmployeeLeaveRecord(String)Retrieves the leave record for a specific employee.getEmployeeRecord(int)Retrieves the employee record for a specific employee.getEmployeeCSVPath()Retrieves the file path for the employee CSV file.getAddedEmployeeCount()Retrieves the count of added employees.addEmployee(EmployeeRecord)Adds a new employee record.addEmployee()Adds employees from a CSV file.updateEmployee(EmployeeRecord)Updates an employee record.terminateEmployee(EmployeeRecord)Terminates an employee.approveLeave(String)Approves a leave request.rejectLeave(String, int, String, int)Rejects a leave request.generateAttendanceReport(String)Generates an attendance report for the specified period.setEmployeeCSV_File(String)Sets the file path for the employee CSV file.getActiveEmployeeList()Retrieves a list of active employees.
-
Constructor Summary
ConstructorsConstructorDescriptionHRAdmin(FileDataService dataService, int employeeID) Constructs an HRAdmin object. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds employees from a CSV file.voidaddEmployee(EmployeeRecord newRecord) Adds a new employee record.voidapproveLeave(String leaveID) Approves a leave request.generateAttendanceReport(String reportPeriod) Generates an attendance report for the specified period.Retrieves a list of active employees.intRetrieves the count of added employees.Retrieves a list of all attendance records.Retrieves a list of all leave records.Retrieves the file path for the employee CSV file.Retrieves a list of all employee IDs.getEmployeeLeaveRecord(String leaveID) Retrieves the leave record for a specific employee.Retrieves a list of all employees.getEmployeeRecord(int employeeID) Retrieves the employee record for a specific employee.Retrieves the ID for a new employee.voidrejectLeave(String leaveID, int employeeID, String leaveType, int duration) Rejects a leave request.voidsetEmployeeCSV_File(String filePath) Sets the file path for the employee CSV file.voidterminateEmployee(EmployeeRecord selectedEmployee) Terminates an employee.voidupdateEmployee(EmployeeRecord updatedRecord) Updates an employee record.Methods inherited from class user.roles.Employee
clockIn, clockOut, getAttendanceID, getEmployeeID, getLeaveBalance, getLeaveBalance_OfType, getLeaveID, getPayslip, getPersonalAttendanceRecordList, getPersonalLeaveRecordList, getPersonalRecord, submitLeaveRequest
-
Constructor Details
-
HRAdmin
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
Retrieves the ID for a new employee.- Returns:
- The ID for a new employee.
-
getEmployeeList
Retrieves a list of all employees.- Returns:
- A list of all employees.
-
getEmployeeIDList
Retrieves a list of all employee IDs.- Returns:
- A list of all employee IDs.
-
getAllAttendanceRecords
Retrieves a list of all attendance records.- Returns:
- A list of all attendance records.
-
getAllLeaveRecords
Retrieves a list of all leave records.- Returns:
- A list of all leave records.
-
getEmployeeLeaveRecord
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
Retrieves the employee record for a specific employee.- Parameters:
employeeID- The ID of the employee.- Returns:
- The employee record for the specified employee.
-
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
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
Adds employees from a CSV file.- Throws:
EmployeeRecordsException- If an error occurs while adding employees from the CSV file.
-
updateEmployee
Updates an employee record.- Parameters:
updatedRecord- The updated employee record.- Throws:
EmployeeRecordsException- If an error occurs while updating the employee record.
-
terminateEmployee
Terminates an employee.- Parameters:
selectedEmployee- The employee to be terminated.- Throws:
EmployeeRecordsException- If an error occurs while terminating the employee.
-
approveLeave
Approves a leave request.- Parameters:
leaveID- The ID of the leave request to be approved.
-
rejectLeave
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
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
Sets the file path for the employee CSV file.- Parameters:
filePath- The file path for the employee CSV file.
-
getActiveEmployeeList
Retrieves a list of active employees.- Returns:
- A list of active employees.
-