Class ReportService

java.lang.Object
com.ntu.fdae.group1.bto.services.project.ReportService
All Implemented Interfaces:
IReportService

public class ReportService extends Object implements IReportService
Implementation of the IReportService interface that provides report generation functionality for the BTO Management System.

This service is responsible for generating various reports about bookings, applications, and projects. It pulls data from multiple repositories to create comprehensive reports that can be filtered based on different criteria such as flat type, project name, age, and marital status.

The service aggregates data from different sources and formats it into readable reports suitable for administrative analysis and decision making.

  • Constructor Details

    • ReportService

      public ReportService(IBookingRepository bookRepo, IProjectRepository projRepo, IUserRepository userRepo)
      Constructs a new ReportService with the repositories needed for report generation.
      Parameters:
      bookRepo - Repository for booking data
      projRepo - Repository for project data
      userRepo - Repository for user data
      Throws:
      NullPointerException - if any repository except appRepo is null
  • Method Details

    • generateBookingReport

      public String generateBookingReport(Map<String,String> filters)
      Generates a detailed booking report that can be filtered by various criteria.

      This method creates a formatted text report of bookings, including applicant details, project information, and booking specifics. The report can be filtered by flat type, project name, applicant age, and marital status.

      Specified by:
      generateBookingReport in interface IReportService
      Parameters:
      filters - A map of filter criteria where keys are filter names (FLAT_TYPE, PROJECT_NAME, AGE, MARITAL_STATUS) and values are filter values
      Returns:
      A formatted string containing the booking report
      Throws:
      NullPointerException - if the filters map is null