Class ManagerRequestController

java.lang.Object
controller.ManagerRequestController

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

    Modifier and Type
    Method
    Description
    static void
    Changes the approval status (PENDING, SUCCESSFUL, UNSUCCESSFUL) for specific types of applications (BTO Application, BTO Withdrawal, Officer Registration) and triggers related cascading actions.
    static void
    Changes the overall status (e.g., PENDING, DONE) of a specific request.
    static void
    Sets the manager ID for the current session context.
    static void
    Displays all Enquiry requests present in the system, regardless of the project or manager.
    static void
    Displays all enquiries associated with the projects managed by the currently set manager.
    static void
    Stores the user ID of the manager currently interacting with the system.
    static void
    viewRequest(boolean applicant)
    Displays specific types of requests using the APPLICANT display format.

    Methods inherited from class java.lang.Object

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

    • ManagerRequestController

      public ManagerRequestController()
  • Method Details

    • setManagerID

      public static void setManagerID(String ID)
      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: - If applicant is true, displays BTO Applications and BTO Withdrawals. - If applicant is false, displays Officer Registrations. Note: The use of UserType.APPLICANT for 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

      public static void changeRequestStatus(String requestID, RequestStatus status)
      Changes the overall status (e.g., PENDING, DONE) of a specific request.
      Parameters:
      requestID - The ID of the request to update.
      status - The new RequestStatus to set.
    • changeApplicationStatus

      public static void changeApplicationStatus(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. 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 new ApprovedStatus to 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 the UserType.MANAGER display format.