- All Known Implementing Classes:
LeaveManager
public interface LeaveManagement
Defines the interface for managing leave records and balances.
Available methods:
approveLeave(String)
rejectLeave(String, int, String, int)
getLeaveRecord(String)
getLeaveRecord_List(int)
getLeaveRecord_List()
getLeaveBalanceRecord(int)
getLeaveBalance_OfType(int, String)
getAllLeaveRecords()
addLeaveRecord(LeaveRecord, LeaveBalanceRecord)
getLeaveBalance_OfType(LeaveBalanceRecord, String)
updateLeaveBalance(LeaveBalanceRecord, String, int)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLeaveRecord
(LeaveRecord newRecord, LeaveBalanceRecord leaveBalance) Adds a new leave record and updates the leave balance.void
approveLeave
(String leaveID) Approves a leave request.Retrieves a list of all leave records.int
getLeaveBalance_OfType
(int leaveBalance, String leaveType) Retrieves the leave balance for a specific type of leave.int
getLeaveBalance_OfType
(LeaveBalanceRecord leaveBalance, String leaveType) Retrieves the leave balance for a specific type of leave from a leave balance record.getLeaveBalanceRecord
(int employeeID) Retrieves the leave balance record for a specific employee.getLeaveRecord
(String leaveID) Retrieves a leave record by its ID.Retrieves a list of all leave records.getLeaveRecord_List
(int employeeID) Retrieves a list of leave records for a specific employee.void
rejectLeave
(String leaveID, int employeeID, String leaveType, int duration) Rejects a leave request.void
updateLeaveBalance
(LeaveBalanceRecord leaveBalanceRecord, String leaveType, int newBalance) Updates the leave balance for a specific type of leave.
-
Method Details
-
approveLeave
Approves a leave request.- Parameters:
leaveID
- the ID of the leave request to approve
-
rejectLeave
Rejects a leave request.- Parameters:
leaveID
- the ID of the leave request to rejectemployeeID
- the ID of the employee requesting the leaveleaveType
- the type of leave requestedduration
- the duration of the leave requested
-
getLeaveRecord
Retrieves a leave record by its ID.- Parameters:
leaveID
- the ID of the leave record to retrieve- Returns:
- the leave record
-
getLeaveRecord_List
Retrieves a list of leave records for a specific employee.- Parameters:
employeeID
- the ID of the employee- Returns:
- a list of leave records
-
getLeaveRecord_List
List<LeaveRecord> getLeaveRecord_List()Retrieves a list of all leave records.- Returns:
- a list of all leave records
-
getLeaveBalanceRecord
Retrieves the leave balance record for a specific employee.- Parameters:
employeeID
- the ID of the employee- Returns:
- the leave balance record
-
getLeaveBalance_OfType
Retrieves the leave balance for a specific type of leave.- Parameters:
leaveBalance
- the leave balance recordleaveType
- the type of leave for which the balance is retrieved- Returns:
- the leave balance for the specified type
-
getAllLeaveRecords
List<LeaveRecord> getAllLeaveRecords()Retrieves a list of all leave records.- Returns:
- a list of all leave records
-
addLeaveRecord
Adds a new leave record and updates the leave balance.- Parameters:
newRecord
- the new leave record to addleaveBalance
- the leave balance record to update- Throws:
LeaveException
- if an error occurs while adding the leave record
-
getLeaveBalance_OfType
Retrieves the leave balance for a specific type of leave from a leave balance record.- Parameters:
leaveBalance
- the leave balanceleaveType
- the type of leave- Returns:
- the leave balance for the specified type
-
updateLeaveBalance
Updates the leave balance for a specific type of leave.- Parameters:
leaveBalanceRecord
- the leave balance record to updateleaveType
- the type of leavenewBalance
- the new leave balance
-