Class OfficerPage

java.lang.Object
boundary.OfficerPage

public class OfficerPage extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Displays the main menu options available to the logged-in officer.
    static void
    Handles the process for an officer to answer a specific enquiry.
    static void
    Handles the process for the officer (acting as an applicant) to apply for a specific project.
    static void
    Initiates the process for booking a flat for a specific applicant.
    static void
    Allows the officer (acting as an applicant) to delete one of their own submitted queries.
    static void
    Allows the officer (acting as an applicant) to edit one of their own submitted queries.
    static void
    Generates a general receipt (details depend on controller implementation).
    static void
    Generates a receipt specifically for an applicant.
    static void
    Generates receipts related to a specific project.
    static void
    Allows the officer (acting as an applicant) to submit a personal query about a specific project.
    static void
    Allows the officer to register their interest in working on a specific project.
    static void
    Displays projects that the officer (acting as an applicant) is eligible to apply for.
    static void
    Displays the application status of applicants, filtered for projects the officer manages.
    static void
    Displays projects the officer (acting as an applicant) has applied for.
    static void
    Displays enquiries assigned to or related to the currently logged-in officer.
    static void
    Displays enquiries filtered by a specific project ID.
    static void
    Displays the personal queries submitted by the officer (acting as an applicant).
    static void
    Displays the projects the officer is currently registered to work on.
    static void
    Displays the registrable projects of applicants, filtered for projects the officer manages.
    static void
    Displays the status of the officer's applications to register for projects.
    static void
    Handles the process for the officer (acting as an applicant) to withdraw their project application.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 to ApplicantController.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 to ApplicantController.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 to ApplicantController.applyProject(String, FlatType). Handles ProjectNotFoundException. 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 to ApplicantController.withdrawApplication(String). Handles ProjectNotFoundException. 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 to ApplicantController.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 to ApplicantController.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 to ApplicantController.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 to ApplicantController.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 to OfficerRequestController.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 to OfficerRequestController.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 to OfficerRequestController.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 to OfficerRequestController.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 to OfficerRequestController.viewEnquiries(String). Handles ProjectNotFoundException. 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 to OfficerRequestController.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 to OfficerProjectController.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 to OfficerProjectController.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 to OfficerProjectController.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 to OfficerProjectController.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 to OfficerProjectController.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 to OfficerProjectController.generateReceiptByProject(String). Loops back to the officer menu.