Class OfficerPage
java.lang.Object
boundary.OfficerPage
Represents the boundary layer for handling interactions for users logged in as Officers.
This page provides a combined menu allowing officers to perform actions both as an applicant
(applying for projects, managing personal queries) and as an officer
(registering for projects, managing applicant requests/enquiries, booking flats, generating receipts).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisplays the main menu options available to the logged-in officer.static voidHandles the process for an officer to answer a specific enquiry.static voidHandles the process for the officer (acting as an applicant) to apply for a specific project.static voidbookFlat()Initiates the process for booking a flat for a specific applicant.static voidAllows the officer (acting as an applicant) to delete one of their own submitted queries.static voidAllows the officer (acting as an applicant) to edit one of their own submitted queries.static voidGenerates a general receipt (details depend on controller implementation).static voidGenerates a receipt specifically for an applicant.static voidGenerates receipts related to a specific project.static voidquery()Allows the officer (acting as an applicant) to submit a personal query about a specific project.static voidAllows the officer to register their interest in working on a specific project.static voidDisplays projects that the officer (acting as an applicant) is eligible to apply for.static voidDisplays the application status of applicants, filtered for projects the officer manages.static voidDisplays projects the officer (acting as an applicant) has applied for.static voidDisplays enquiries assigned to or related to the currently logged-in officer.static voidDisplays enquiries filtered by a specific project ID.static voidDisplays the personal queries submitted by the officer (acting as an applicant).static voidDisplays the projects the officer is currently registered to work on.static voidDisplays the registrable projects of applicants, filtered for projects the officer manages.static voidDisplays the status of the officer's applications to register for projects.static voidHandles the process for the officer (acting as an applicant) to withdraw their project application.
-
Constructor Details
-
OfficerPage
public OfficerPage()
-
-
Method Details
-
allOptions
public static void allOptions()Displays the main menu options available to the logged-in officer. This menu includes options for both applicant-related actions and officer-specific duties. Reads the officer's choice and navigates to the corresponding functionality. Handles invalid input and loops back to the main menu or exits the application. -
viewApplicableProject
public static void viewApplicableProject()Displays projects that the officer (acting as an applicant) is eligible to apply for. Delegates logic toApplicantController.viewApplicableProject(). Loops back to the officer menu. -
viewAppliedProject
public static void viewAppliedProject()Displays projects the officer (acting as an applicant) has applied for. Delegates logic toApplicantController.viewAppliedProject(). Loops back to the officer menu. -
applyProject
public static void applyProject()Handles the process for the officer (acting as an applicant) to apply for a specific project. Checks eligibility (if already applied, age, marital status). Prompts for project ID and flat type. Delegates application logic toApplicantController.applyProject(String, FlatType). HandlesProjectNotFoundException. Loops back to the officer menu. -
withdrawApplication
public static void withdrawApplication()Handles the process for the officer (acting as an applicant) to withdraw their project application. Prompts for the project ID. Delegates withdrawal logic toApplicantController.withdrawApplication(String). HandlesProjectNotFoundException. Loops back to the officer menu. -
query
public static void query()Allows the officer (acting as an applicant) to submit a personal query about a specific project. Prompts for project ID and query text. Checks if project exists. Delegates query submission toApplicantController.query(String, String). Loops back to the officer menu. -
viewQuery
public static void viewQuery()Displays the personal queries submitted by the officer (acting as an applicant). Delegates display logic toApplicantController.viewQuery(). Loops back to the officer menu. -
editQuery
public static void editQuery()Allows the officer (acting as an applicant) to edit one of their own submitted queries. Prompts for the request ID of the query. Checks if the query belongs to the officer. Prompts for the new query text. Delegates editing logic toApplicantController.editQuery(String, String). Loops back to the officer menu. -
deleteQuery
public static void deleteQuery()Allows the officer (acting as an applicant) to delete one of their own submitted queries. Prompts for the request ID of the query. Delegates deletion logic toApplicantController.deleteQuery(String). Loops back to the officer menu. -
registerProject
public static void registerProject()Allows the officer to register their interest in working on a specific project. Prompts for the project ID. Delegates registration logic toOfficerRequestController.registerProject(String). Loops back to the officer menu. -
viewRegisteredProject
public static void viewRegisteredProject()Displays the projects the officer is currently registered to work on. Delegates display logic toOfficerRequestController.viewRegisteredProject(). Loops back to the officer menu. -
viewRegistrationStatus
public static void viewRegistrationStatus()Displays the status of the officer's applications to register for projects. Delegates display logic toOfficerRequestController.viewRegistrationStatus(). Loops back to the officer menu. -
viewEnquiries
public static void viewEnquiries()Displays enquiries assigned to or related to the currently logged-in officer. Delegates display logic toOfficerRequestController.viewEnquiries(). Loops back to the officer menu. -
viewEnquiriesByProject
public static void viewEnquiriesByProject()Displays enquiries filtered by a specific project ID. Prompts for the project ID. Checks if the project exists. Delegates display logic toOfficerRequestController.viewEnquiries(String). HandlesProjectNotFoundException. Loops back to the officer menu. -
answerEnquiry
public static void answerEnquiry()Handles the process for an officer to answer a specific enquiry. Prompts for the request ID. Performs validation checks: - Request existence. - Request type (must be Enquiry). - Enquiry status (must not be DONE). - Officer's association with the project (must be registered for the project). Prompts for the answer text if valid. Delegates answering logic toOfficerRequestController.answerEnquiry(String, String). Loops back to the officer menu. -
viewRegistrableProject
public static void viewRegistrableProject()Displays the registrable projects of applicants, filtered for projects the officer manages. Delegates display logic toOfficerProjectController.viewRegistrableProject(). Loops back to the officer menu. -
viewApplicantApplicationStatus
public static void viewApplicantApplicationStatus()Displays the application status of applicants, filtered for projects the officer manages. Delegates display logic toOfficerProjectController.viewApplicantApplicationStatus(). Loops back to the officer menu. -
bookFlat
public static void bookFlat()Initiates the process for booking a flat for a specific applicant. Prompts for the applicant's ID. Delegates booking logic toOfficerProjectController.bookFlat(String). Loops back to the officer menu. -
generateReceipt
public static void generateReceipt()Generates a general receipt (details depend on controller implementation). Delegates generation logic toOfficerProjectController.generateReceipt(). Loops back to the officer menu. -
generateReceiptByApplicant
public static void generateReceiptByApplicant()Generates a receipt specifically for an applicant. Prompts for the applicant's ID. Delegates generation logic toOfficerProjectController.generateReceiptByApplicant(String). Loops back to the officer menu. -
generateReceiptByProject
public static void generateReceiptByProject()Generates receipts related to a specific project. Prompts for the project ID. Delegates generation logic toOfficerProjectController.generateReceiptByProject(String). Loops back to the officer menu.
-