java.lang.Object
attendance.manager.AttendanceManager
- All Implemented Interfaces:
AttendanceManagement
Manages attendance-related operations.
This class provides methods for logging time in and time out, adding and updating attendance records,
retrieving attendance records, and retrieving attendance records for specific employees or periods.
Utilizes interfaces
AttendanceDataService
, and AttendanceManagement
for data access and management.
Available methods:
-
Constructor Summary
ConstructorsConstructorDescriptionAttendanceManager
(AttendanceDataService attendanceDataService) Constructor for AttendanceManager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttendanceRecord
(AttendanceRecord newRecord) Adds a new attendance record.Retrieves all attendance records.getAttendanceRecord
(String attendanceID) Retrieves an attendance record by its ID.getAttendanceRecord_List
(int employeeID) Retrieves all attendance records for a specific employee.getAttendanceRecord_List
(int employeeID, LocalDate periodStart, LocalDate periodEnd) Retrieves attendance records for a specific employee within a specified period.void
logTimeIn
(int employeeID, EmployeeRecord personalRecord) Logs the time in for an employee.void
logTimeOut
(String attendanceID) Logs the time out for an attendance record.void
updateAttendanceRecord
(AttendanceRecord updatedRecord) Updates an existing attendance record.
-
Constructor Details
-
AttendanceManager
Constructor for AttendanceManager.- Parameters:
attendanceDataService
- the data service for attendance
-
-
Method Details
-
logTimeIn
Description copied from interface:AttendanceManagement
Logs the time in for an employee.- Specified by:
logTimeIn
in interfaceAttendanceManagement
- Parameters:
employeeID
- the ID of the employeepersonalRecord
- the personal record of the employee- Throws:
AttendanceException
- if an error occurs during logging time in
-
logTimeOut
Description copied from interface:AttendanceManagement
Logs the time out for an attendance record.- Specified by:
logTimeOut
in interfaceAttendanceManagement
- Parameters:
attendanceID
- the ID of the attendance record- Throws:
AttendanceException
- if an error occurs during logging time out
-
addAttendanceRecord
Adds a new attendance record.- Specified by:
addAttendanceRecord
in interfaceAttendanceManagement
- Parameters:
newRecord
- the new attendance record to add
-
updateAttendanceRecord
Description copied from interface:AttendanceManagement
Updates an existing attendance record.- Specified by:
updateAttendanceRecord
in interfaceAttendanceManagement
- Parameters:
updatedRecord
- the updated attendance record
-
getAttendanceRecord
Description copied from interface:AttendanceManagement
Retrieves an attendance record by its ID.- Specified by:
getAttendanceRecord
in interfaceAttendanceManagement
- Parameters:
attendanceID
- the ID of the attendance record to retrieve- Returns:
- the attendance record
-
getAllAttendanceRecords
Description copied from interface:AttendanceManagement
Retrieves all attendance records.- Specified by:
getAllAttendanceRecords
in interfaceAttendanceManagement
- Returns:
- a list of all attendance records
-
getAttendanceRecord_List
public List<AttendanceRecord> getAttendanceRecord_List(int employeeID, LocalDate periodStart, LocalDate periodEnd) Description copied from interface:AttendanceManagement
Retrieves attendance records for a specific employee within a specified period.- Specified by:
getAttendanceRecord_List
in interfaceAttendanceManagement
- Parameters:
employeeID
- the ID of the employeeperiodStart
- the start date of the periodperiodEnd
- the end date of the period- Returns:
- a list of attendance records for the employee within the specified period
-
getAttendanceRecord_List
Description copied from interface:AttendanceManagement
Retrieves all attendance records for a specific employee.- Specified by:
getAttendanceRecord_List
in interfaceAttendanceManagement
- Parameters:
employeeID
- the ID of the employee- Returns:
- a list of attendance records for the employee
-