Class ReportGenerator

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.
  • Constructor Details

    • ReportGenerator

      public ReportGenerator(FileDataService fileDataService)
      Creates a new ReportGenerator object for generating reports.
      Parameters:
      fileDataService - the file data service
  • Method Details

    • generateAttendanceReport

      public List<String[]> generateAttendanceReport(String reportPeriod) throws AttendanceException
      Generates an attendance report for the specified report period.
      Specified by:
      generateAttendanceReport in interface AttendanceReport
      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

      public List<String[]> generateEmployeeReport()
      Description copied from interface: EmployeeReport
      A description of the entire Java function.
      Specified by:
      generateEmployeeReport in interface EmployeeReport
      Returns:
      description of return value
    • generatePayrollReport

      public List<String[]> generatePayrollReport(String reportPeriod) throws PayrollException
      Generates a payroll report for the specified report period.
      Specified by:
      generatePayrollReport in interface PayrollReport
      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

      public void openFileExplorer(String filePath)
      Ask the user if they want to view the report
      Parameters:
      filePath - The file path of the report
    • ReportNameGenerator

      public String ReportNameGenerator(String reportPeriod, ReportGenerator.ReportType reportType)
      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