java.lang.Object
payroll.manager.PayrollManager
- All Implemented Interfaces:
PayrollManagement
Manages payroll-related operations.
Available methods:
-
Constructor Summary
ConstructorsConstructorDescriptionPayrollManager
(PayrollDataService payrollDataService, EmployeeManagement employeeManager, AttendanceManagement attendanceManager) Constructor for the PayrollManager class. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves all payroll records.double
getHoursWorked
(int employeeID, String payrollPeriod) Retrieves the number of hours worked for the specified employee ID and period.double
getOvertimeHours
(int employeeID, String payrollPeriod) Retrieves the number of overtime hours for the specified employee ID and period.getPayrollIDList
(String period) Retrieves the list of payroll IDs for the specified periodgetPayrollRecord
(int employeeID, int month, String period) Retrieves the payroll record for the specified employee and year and monthgetPayrollRecord
(String payrollID) Retrieves the payroll record for the specified IDgetPayrollRecord_List
(String period) Retrieves the list of payroll records for the specified periodvoid
runBatchPayroll
(List<PayrollRecord> tempPayrollRecords, String payrollPeriod) Runs the payroll for the specified period.runManualPayroll
(PayrollRecord tempPayrollRecord, String payrollPeriod) Runs manual payroll for the specified temporary payroll record and period.void
submitBatchPayroll
(List<PayrollRecord> tempPayrollRecords) Submits the temporary payroll records to the database.void
submitManualPayroll
(PayrollRecord tempPayrollRecord) Submits the temporary payroll record to the database.
-
Constructor Details
-
PayrollManager
public PayrollManager(PayrollDataService payrollDataService, EmployeeManagement employeeManager, AttendanceManagement attendanceManager) Constructor for the PayrollManager class. Initializes the PayrollDataService, EmployeeManagement, and AttendanceManagement objects.- Parameters:
payrollDataService
- The PayrollDataService object to use for data access.employeeManager
- The EmployeeManagement object to use for employee management.attendanceManager
- The AttendanceManagement object to use for attendance management.
-
-
Method Details
-
runBatchPayroll
public void runBatchPayroll(List<PayrollRecord> tempPayrollRecords, String payrollPeriod) throws EmployeeRecordsException, PayrollException Runs the payroll for the specified period.- Specified by:
runBatchPayroll
in interfacePayrollManagement
- Parameters:
tempPayrollRecords
- the temporary payroll records to processpayrollPeriod
- the period for which the payroll is being run- Throws:
EmployeeRecordsException
- if no records are foundPayrollException
- if an error occurs
-
submitBatchPayroll
Submits the temporary payroll records to the database.- Specified by:
submitBatchPayroll
in interfacePayrollManagement
- Parameters:
tempPayrollRecords
- the temporary payroll records to submit- Throws:
PayrollException
- if an error occurs
-
runManualPayroll
public PayrollRecord runManualPayroll(PayrollRecord tempPayrollRecord, String payrollPeriod) throws EmployeeRecordsException Description copied from interface:PayrollManagement
Runs manual payroll for the specified temporary payroll record and period.- Specified by:
runManualPayroll
in interfacePayrollManagement
- Parameters:
tempPayrollRecord
- the temporary payroll record to process, has empty fields which needs calculations to be filledpayrollPeriod
- the period for which the payroll is being run- Throws:
EmployeeRecordsException
-
submitManualPayroll
Submits the temporary payroll record to the database.- Specified by:
submitManualPayroll
in interfacePayrollManagement
- Parameters:
tempPayrollRecord
- the payroll record to submit
-
getAllPayrollRecords
Retrieves all payroll records.- Specified by:
getAllPayrollRecords
in interfacePayrollManagement
- Returns:
- a list of all payroll records
-
getPayrollIDList
Retrieves the list of payroll IDs for the specified period- Specified by:
getPayrollIDList
in interfacePayrollManagement
- Parameters:
period
- the payroll period- Returns:
- the list of payroll IDs
-
getPayrollRecord
Retrieves the payroll record for the specified employee and year and month- Specified by:
getPayrollRecord
in interfacePayrollManagement
- Parameters:
employeeID
- the ID of the employeemonth
- the month of the payrollperiod
- the period of the payroll- Returns:
- the payroll record
-
getPayrollRecord
Retrieves the payroll record for the specified ID- Specified by:
getPayrollRecord
in interfacePayrollManagement
- Parameters:
payrollID
- the ID of the payroll record- Returns:
- the payroll record
-
getPayrollRecord_List
Retrieves the list of payroll records for the specified period- Specified by:
getPayrollRecord_List
in interfacePayrollManagement
- Parameters:
period
- the period for which the records are retrieved- Returns:
- the list of payroll records
-
getHoursWorked
Description copied from interface:PayrollManagement
Retrieves the number of hours worked for the specified employee ID and period.- Specified by:
getHoursWorked
in interfacePayrollManagement
- Parameters:
employeeID
- the ID of the employeepayrollPeriod
- the period- Returns:
- the number of hours worked
-
getOvertimeHours
Description copied from interface:PayrollManagement
Retrieves the number of overtime hours for the specified employee ID and period.- Specified by:
getOvertimeHours
in interfacePayrollManagement
- Parameters:
employeeID
- the ID of the employeepayrollPeriod
- the period- Returns:
- the number of overtime hours
-