Class ManagerRequestController
java.lang.Object
controller.ManagerRequestController
Controller responsible for handling request-related operations from a Manager's perspective.
This includes viewing various request types (applications, withdrawals, registrations),
viewing enquiries associated with the manager's projects, viewing all enquiries,
and changing the status of different request types, often involving complex cascading logic.
It operates using the context of the currently logged-in manager's ID.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeApplicationStatus(String requestID, ApprovedStatus status) Changes the approval status (PENDING, SUCCESSFUL, UNSUCCESSFUL) for specific types of applications (BTO Application, BTO Withdrawal, Officer Registration) and triggers related cascading actions.static voidchangeRequestStatus(String requestID, RequestStatus status) Changes the overall status (e.g., PENDING, DONE) of a specific request.static voidsetManagerID(String ID) Sets the manager ID for the current session context.static voidDisplays all Enquiry requests present in the system, regardless of the project or manager.static voidDisplays all enquiries associated with the projects managed by the currently set manager.static voidStores the user ID of the manager currently interacting with the system.static voidviewRequest(boolean applicant) Displays specific types of requests using the APPLICANT display format.
-
Constructor Details
-
ManagerRequestController
public ManagerRequestController()
-
-
Method Details
-
setManagerID
Sets the manager ID for the current session context. Subsequent manager-specific operations in this controller will use this ID.- Parameters:
ID- The user ID of the currently logged-in manager.
-
viewRequest
public static void viewRequest()Stores the user ID of the manager currently interacting with the system. -
viewRequest
public static void viewRequest(boolean applicant) Displays specific types of requests using the APPLICANT display format. The behavior depends on the boolean parameter: - Ifapplicantis true, displays BTO Applications and BTO Withdrawals. - Ifapplicantis false, displays Officer Registrations. Note: The use ofUserType.APPLICANTfor display might be inconsistent, especially for Officer Registrations.- Parameters:
applicant- If true, display applicant-related requests (BTO Application/Withdrawal); if false, display officer-related requests (Registration).
-
changeRequestStatus
Changes the overall status (e.g., PENDING, DONE) of a specific request.- Parameters:
requestID- The ID of the request to update.status- The newRequestStatusto set.
-
changeApplicationStatus
Changes the approval status (PENDING, SUCCESSFUL, UNSUCCESSFUL) for specific types of applications (BTO Application, BTO Withdrawal, Officer Registration) and triggers related cascading actions. Also updates the overall request status to DONE if the approval status is not PENDING.- Parameters:
requestID- The ID of the application request to update.status- The newApprovedStatusto set.
-
viewEnquiries
public static void viewEnquiries()Displays all enquiries associated with the projects managed by the currently set manager. Iterates through all requests, checks if it's an Enquiry, and if its project ID is in the current manager's list of managed projects. -
viewAllEnquiries
public static void viewAllEnquiries()Displays all Enquiry requests present in the system, regardless of the project or manager. Uses theUserType.MANAGERdisplay format.
-