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 Summary
Modifier and TypeMethodDescriptiongetApplicationForUser
(String applicantNRIC) Gets the application for a specific applicantgetApplicationsByProject
(String projectId) Gets all applications for a specific projectGets all applications with a specific statusboolean
requestWithdrawal
(User user) Requests withdrawal of an existing applicationboolean
reviewApplication
(HDBManager manager, String applicationId, boolean approve) Reviews an applicationboolean
reviewWithdrawal
(HDBManager manager, String applicationId, boolean approve) Reviews a withdrawal requestsubmitApplication
(User user, String projectId, FlatType preferredFlatType) Submits a new application for a project
-
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 applicationprojectId
- ID of the project to apply forpreferredFlatType
- The type of flat the applicant prefers- Returns:
- The created application
- Throws:
ApplicationException
- if application submission fails
-
requestWithdrawal
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 applicationapplicationId
- ID of the application to reviewapprove
- 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 withdrawalapplicationId
- ID of the application to withdrawapprove
- true to approve, false to reject withdrawal- Returns:
- true if review was successful, false otherwise
- Throws:
ApplicationException
- if the withdrawal review process fails
-
getApplicationForUser
Gets the application for a specific applicant- Parameters:
applicantNRIC
- NRIC of the applicant- Returns:
- The application, or null if not found
-
getApplicationsByProject
Gets all applications for a specific project- Parameters:
projectId
- ID of the project- Returns:
- List of applications for the project
-
getApplicationsByStatus
Gets all applications with a specific status- Parameters:
status
- Status to filter by- Returns:
- List of applications with the specified status
-