Interface IApplicationService

All Known Implementing Classes:
ApplicationService

public interface IApplicationService
Service interface defining operations for managing BTO project applications.

This interface provides a comprehensive API for handling the application lifecycle in the BTO Management System, including submission, approval/rejection, withdrawal requests, and application queries. It serves as the business layer between controllers and the data access layer.

Key responsibilities include:
  • Processing new application submissions
  • Managing application withdrawals
  • Supporting the review process for applications and withdrawals
  • Retrieving applications based on various criteria
  • Enforcing business rules for the application process

All operations enforce appropriate validation and security checks to ensure data integrity and proper authorization throughout the application lifecycle.

  • Method Details

    • submitApplication

      Application submitApplication(User user, String projectId, FlatType preferredFlatType) throws ApplicationException
      Submits a new application for a project
      Parameters:
      user - The applicant submitting the application
      projectId - ID of the project to apply for
      preferredFlatType - The type of flat the applicant prefers
      Returns:
      The created application
      Throws:
      ApplicationException - if application submission fails
    • requestWithdrawal

      boolean requestWithdrawal(User user) throws ApplicationException
      Requests withdrawal of an existing application
      Parameters:
      user - The applicant requesting withdrawal
      Returns:
      true if request was successful, false otherwise
      Throws:
      ApplicationException - if withdrawal request fails
    • reviewApplication

      boolean reviewApplication(HDBManager manager, String applicationId, boolean approve) throws ApplicationException
      Reviews an application
      Parameters:
      manager - The manager reviewing the application
      applicationId - ID of the application to review
      approve - true to approve, false to reject
      Returns:
      true if review was successful, false otherwise
      Throws:
      ApplicationException - if the review process fails
    • reviewWithdrawal

      boolean reviewWithdrawal(HDBManager manager, String applicationId, boolean approve) throws ApplicationException
      Reviews a withdrawal request
      Parameters:
      manager - The manager reviewing the withdrawal
      applicationId - ID of the application to withdraw
      approve - true to approve, false to reject withdrawal
      Returns:
      true if review was successful, false otherwise
      Throws:
      ApplicationException - if the withdrawal review process fails
    • getApplicationForUser

      Application getApplicationForUser(String applicantNRIC)
      Gets the application for a specific applicant
      Parameters:
      applicantNRIC - NRIC of the applicant
      Returns:
      The application, or null if not found
    • getApplicationsByProject

      List<Application> getApplicationsByProject(String projectId)
      Gets all applications for a specific project
      Parameters:
      projectId - ID of the project
      Returns:
      List of applications for the project
    • getApplicationsByStatus

      List<Application> getApplicationsByStatus(ApplicationStatus status)
      Gets all applications with a specific status
      Parameters:
      status - Status to filter by
      Returns:
      List of applications with the specified status