Class ManagerPage
java.lang.Object
boundary.ManagerPage
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisplays the main menu options available to the logged-in manager.static voidHandles the process for a manager to answer a specific enquiry.static voidAllows the manager to change the approval status of an application request.static voidHandles the creation of a new project by the manager.static voidHandles the deletion of a project by the manager.static voidHandles the editing of an existing project by the manager.static voidGenerates a report based on project or request data (specifics depend on controller implementation).static voidToggles the visibility status of a project (Visible - Not Visible).static voidDisplays all enquiries across all projects (presumably those the manager has access to view).static voidDisplays enquiries specifically assigned to or related to the current manager's projects.static voidDisplays the registration status of officers (details depend on controller implementation).static voidDisplays the list of projects created by a specific manager.static voidDisplays requests (applications, etc.) associated with the projects managed by the current manager.
-
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 toManagerRequestController.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 toOfficerRequestController.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 toManagerProjectController.viewProjectList(String). Catches and handlesProjectNotFoundExceptionif 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 toManagerRequestController.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 toManagerRequestController.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 toManagerRequestController.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 usingIDController.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 toManagerProjectController.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 newProjectobject with potentially mixed old and new data. Delegates the update logic toManagerProjectController.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 toManagerProjectController.deleteProject(String). Catches and displays a message forProjectNotFoundExceptionif 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 toManagerProjectController.toggleVisibility(String). Catches and displays a message forProjectNotFoundExceptionif 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 toManagerProjectController.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 toManagerProjectController.generateReport(). Loops back to the manager menu afterwards.
-