Class ManagerPage

java.lang.Object
boundary.ManagerPage

public class ManagerPage extends Object
Represents the boundary layer for handling manager interactions and displaying the manager menu. This class provides static methods for managers to manage projects (create, edit, delete, toggle visibility), handle requests and enquiries (view, change status, answer), manage filters, view officer status, and generate reports.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Displays the main menu options available to the logged-in manager.
    static void
    Handles the process for a manager to answer a specific enquiry.
    static void
    Allows the manager to change the approval status of an application request.
    static void
    Handles the creation of a new project by the manager.
    static void
    Handles the deletion of a project by the manager.
    static void
    Handles the editing of an existing project by the manager.
    static void
    Generates a report based on project or request data (specifics depend on controller implementation).
    static void
    Toggles the visibility status of a project (Visible - Not Visible).
    static void
    Displays all enquiries across all projects (presumably those the manager has access to view).
    static void
    Displays enquiries specifically assigned to or related to the current manager's projects.
    static void
    Displays the registration status of officers (details depend on controller implementation).
    static void
    Displays the list of projects created by a specific manager.
    static void
    Displays requests (applications, etc.) associated with the projects managed by the current manager.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ManagerPage

      public ManagerPage()
  • Method Details

    • allOptions

      public static void allOptions()
      Displays the main menu options available to the logged-in manager. Reads the manager's choice and navigates to the corresponding functionality. Handles invalid input and loops back to the main menu or exits the application.
    • viewEnquiries

      public static void viewEnquiries()
      Displays enquiries specifically assigned to or related to the current manager's projects. Delegates the display logic to ManagerRequestController.viewEnquiries(). Loops back to the manager menu afterwards.
    • answerEnquiries

      public static void answerEnquiries()
      Handles the process for a manager to answer a specific enquiry. Prompts for the request ID of the enquiry. Performs checks: - If the request ID exists. - If the request is actually an Enquiry. - If the enquiry has already been answered (status is DONE). - If the enquiry belongs to a project managed by the current manager. Prompts for the answer text if all checks pass. Delegates the action of answering the enquiry to OfficerRequestController.answerEnquiry(String, String). Note: Uses OfficerRequestController; consider if ManagerRequestController is intended. Loops back to the manager menu afterwards.
    • viewProjectList

      public static void viewProjectList()
      Displays the list of projects created by a specific manager. Prompts for the manager ID. If left empty, defaults to the currently logged-in manager. Delegates the display logic to ManagerProjectController.viewProjectList(String). Catches and handles ProjectNotFoundException if no projects are found for the manager. Loops back to the manager menu afterwards.
    • viewRequest

      public static void viewRequest()
      Displays requests (applications, etc.) associated with the projects managed by the current manager. Delegates the display logic to ManagerRequestController.viewRequest(). Loops back to the manager menu afterwards.
    • changeApplicationStatus

      public static void changeApplicationStatus()
      Allows the manager to change the approval status of an application request. Prompts for the request ID. Performs checks: - If the request ID exists. - If the request is not an Enquiry. - If the request belongs to a project managed by the current manager. Displays the request details and prompts for the new status (Pending, Successful, Unsuccessful). Delegates the status change to ManagerRequestController.changeApplicationStatus(String, ApprovedStatus). Loops back to the manager menu afterwards.
    • viewAllEnquiries

      public static void viewAllEnquiries()
      Displays all enquiries across all projects (presumably those the manager has access to view). Delegates the display logic to ManagerRequestController.viewAllEnquiries(). Loops back to the manager menu afterwards.
    • createProject

      public static void createProject()
      Handles the creation of a new project by the manager. Generates a new project ID using IDController.newProjectID(). Prompts the manager for all required project details: - Name - Neighbourhoods (list) - Available units and price for Two Room and Three Room flats - Open and Close dates for applications - Number of available officer slots (1-10) Delegates the project creation logic to ManagerProjectController.createProject(String, String, List, Map, Map, LocalDate, LocalDate, int). Loops back to the manager menu afterwards.
    • editProject

      public static void editProject()
      Handles the editing of an existing project by the manager. Prompts for the project ID to edit. If the project exists, prompts for new values for each field, allowing the user to press ENTER to skip and keep the existing value. Collects potentially updated details for: - Name, Neighbourhoods, Units/Prices for flat types, Open/Close dates, Officer slots, Visibility. Constructs a new Project object with potentially mixed old and new data. Delegates the update logic to ManagerProjectController.editProject(String, Project). Loops back to the manager menu afterwards.
    • deleteProject

      public static void deleteProject()
      Handles the deletion of a project by the manager. Prompts for the project ID to delete. Delegates the deletion logic to ManagerProjectController.deleteProject(String). Catches and displays a message for ProjectNotFoundException if the project ID is invalid. Loops back to the manager menu afterwards.
    • toggleVisibility

      public static void toggleVisibility()
      Toggles the visibility status of a project (Visible - Not Visible). Prompts for the project ID. Delegates the toggle logic to ManagerProjectController.toggleVisibility(String). Catches and displays a message for ProjectNotFoundException if the project ID is invalid. Loops back to the manager menu afterwards.
    • viewOfficerRegistrationStatus

      public static void viewOfficerRegistrationStatus()
      Displays the registration status of officers (details depend on controller implementation). Delegates the display logic to ManagerProjectController.viewOfficerRegistrationStatus(). Loops back to the manager menu afterwards.
    • generateReport

      public static void generateReport()
      Generates a report based on project or request data (specifics depend on controller implementation). Delegates the report generation logic to ManagerProjectController.generateReport(). Loops back to the manager menu afterwards.