Interface IOfficerRegistrationService

All Known Implementing Classes:
OfficerRegistrationService

public interface IOfficerRegistrationService
Service interface defining operations for managing HDB Officer registrations to projects.

This interface provides methods for officers to request registration to projects, for managers to review these requests, and for querying registration status and details. The officer registration process is a key part of the authorization system, determining which officers can work with which projects.

Key responsibilities include:
  • Enabling officers to request association with specific projects
  • Supporting manager approval/rejection of registration requests
  • Providing registration status information for authorization checks
  • Retrieving lists of registrations by various criteria
  • Method Details

    • requestProjectRegistration

      OfficerRegistration requestProjectRegistration(HDBOfficer officer, String projectId) throws RegistrationException
      Requests registration of an HDB officer to a project.

      This is the first step in the registration process, where an officer requests to be associated with a project. The registration starts in PENDING status and requires manager approval.

      Parameters:
      officer - The HDB officer requesting registration
      projectId - The ID of the project the officer wants to register for
      Returns:
      The created registration record
      Throws:
      RegistrationException - if the registration request fails (e.g., officer is not eligible)
    • reviewRegistration

      boolean reviewRegistration(HDBManager manager, String registrationId, boolean approve) throws RegistrationException
      Reviews (approves or rejects) an officer's registration request.

      This method allows a project manager to decide whether to approve or reject an officer's request to be associated with their project.

      Parameters:
      manager - The manager reviewing the registration request
      registrationId - The ID of the registration to review
      approve - True to approve, false to reject
      Returns:
      True if the review was successful
      Throws:
      RegistrationException - if the review fails (e.g., unauthorized manager)
    • getRegistrationStatus

      OfficerRegStatus getRegistrationStatus(HDBOfficer officer, String projectId)
      Gets the registration status of an officer for a specific project.

      This method is primarily used for authorization checks to determine if an officer is approved to work on a specific project.

      Parameters:
      officer - The officer whose status should be checked
      projectId - The ID of the project to check
      Returns:
      The registration status, or null if no registration exists
    • getPendingRegistrations

      List<OfficerRegistration> getPendingRegistrations()
      Gets all pending registration requests across all projects.

      This method is typically used by managers to view all pending registration requests that need their attention.

      Returns:
      A list of all pending registration requests
    • getPendingRegistrationsForProject

      List<OfficerRegistration> getPendingRegistrationsForProject(String projectId)
      Gets all pending registration requests for a specific project.

      This method allows project managers to view registration requests specifically for their projects.

      Parameters:
      projectId - The ID of the project to check
      Returns:
      A list of pending registration requests for the specified project
    • getPendingRegistrationCountForProject

      int getPendingRegistrationCountForProject(String projectId)
      Gets the count of pending registration requests for a specific project.

      This method provides a quick way to check how many pending registration requests exist for a project without retrieving the full details.

      Parameters:
      projectId - The ID of the project to check
      Returns:
      The number of pending registration requests for the project
    • getRegistrationsByProject

      List<OfficerRegistration> getRegistrationsByProject(String projectId)
      Gets all registration records for a specific project.

      This method retrieves all officer registrations associated with a project, regardless of their status.

      Parameters:
      projectId - The ID of the project
      Returns:
      A list of all registration records for the project
    • getRegistrationsByOfficer

      List<OfficerRegistration> getRegistrationsByOfficer(String officerNric)
      Gets all registration records for a specific officer.

      This method retrieves all project registrations associated with an officer, regardless of their status.

      Parameters:
      officerNric - The NRIC of the officer
      Returns:
      A list of all registration records for the officer