java.lang.Object
reports.service.ReportGenerator
- All Implemented Interfaces:
AttendanceReport
,EmployeeReport
,PayrollReport
public class ReportGenerator
extends Object
implements AttendanceReport, EmployeeReport, PayrollReport
Generates reports for employees, attendance, and payroll.
Currently, the employee report is not implemented.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumerates the types of reports. -
Constructor Summary
ConstructorsConstructorDescriptionReportGenerator
(FileDataService fileDataService) Creates a new ReportGenerator object for generating reports. -
Method Summary
Modifier and TypeMethodDescriptiongenerateAttendanceReport
(String reportPeriod) Generates an attendance report for the specified report period.A description of the entire Java function.generatePayrollReport
(String reportPeriod) Generates a payroll report for the specified report period.void
openFileExplorer
(String filePath) Ask the user if they want to view the reportReportNameGenerator
(String reportPeriod, ReportGenerator.ReportType reportType) Generates a report name based on the report period and type.
-
Constructor Details
-
ReportGenerator
Creates a new ReportGenerator object for generating reports.- Parameters:
fileDataService
- the file data service
-
-
Method Details
-
generateAttendanceReport
Generates an attendance report for the specified report period.- Specified by:
generateAttendanceReport
in interfaceAttendanceReport
- Parameters:
reportPeriod
- the period for which the report is generated- Returns:
- a list of arrays representing the attendance report
- Throws:
AttendanceException
- if an error occurs while generating the attendance report
-
generateEmployeeReport
Description copied from interface:EmployeeReport
A description of the entire Java function.- Specified by:
generateEmployeeReport
in interfaceEmployeeReport
- Returns:
- description of return value
-
generatePayrollReport
Generates a payroll report for the specified report period.- Specified by:
generatePayrollReport
in interfacePayrollReport
- Parameters:
reportPeriod
- the period for which the payroll report is generated- Returns:
- a list of arrays containing payroll report data
- Throws:
PayrollException
- if an error occurs
-
openFileExplorer
Ask the user if they want to view the report- Parameters:
filePath
- The file path of the report
-
ReportNameGenerator
Generates a report name based on the report period and type.- Parameters:
reportPeriod
- The period for which the report is generated (Weekly, Semi-Monthly, Monthly, Annual)reportType
- The type of report (ATTENDANCE or PAYROLL)- Returns:
- The generated report name including the relevant period and dates
-