Class CampSuggestionController

java.lang.Object
app.controller.camp.CampSuggestionController

public class CampSuggestionController extends Object
The CampSuggestionController class manages the operations related to suggestions for camp improvements. It provides functionalities for creating, updating, deleting, and approving suggestions made by students and staff. Additionally, it offers methods to retrieve suggestions based on specific camps or senders.

Key functionalities include:

  • Creating new suggestions and rewarding students with points.
  • Updating existing suggestions.
  • Deleting suggestions.
  • Approving suggestions and applying their changes to camps.
  • Retrieving suggestions filtered by camps or senders.
See Also:
  • Method Details

    • createSuggestion

      public static boolean createSuggestion(Student sender, CampDetails suggsetion, Camp originalCamp)
      Creates a new suggestion for a camp and adds it to the suggestion repository. The method awards points to the student who made the suggestion.
      Parameters:
      sender - The Student who is sending the suggestion.
      suggsetion - The CampDetails containing the suggestion details.
      originalCamp - The original Camp for which the suggestion is made.
      Returns:
      boolean True if the suggestion is successfully created and inserted.
    • updateSuggestion

      public static boolean updateSuggestion(Suggestion newSuggestion)
      Updates an existing suggestion in the suggestion repository.
      Parameters:
      newSuggestion - The updated Suggestion to be stored.
      Returns:
      boolean True if the suggestion is successfully updated.
    • deleteSuggestion

      public static boolean deleteSuggestion(Suggestion suggestion)
      Deletes a suggestion from the suggestion repository.
      Parameters:
      suggestion - The Suggestion to be removed.
      Returns:
      boolean True if the suggestion is successfully deleted.
    • approveSuggestion

      public static boolean approveSuggestion(Suggestion suggestion, Staff staff, boolean isApproved)
      Approves or rejects a suggestion. If approved, the suggestion's changes are applied to the respective camp. Points are awarded to the student sender if the suggestion is approved.
      Parameters:
      suggestion - The Suggestion to be approved or rejected.
      staff - The Staff member reviewing the suggestion.
      isApproved - True if the suggestion is approved, false otherwise.
      Returns:
      boolean True if the operation is successful.
    • getSuggestions

      public static SuggestionList getSuggestions(Camp camp)
      Retrieves a list of suggestions for a specific camp.
      Parameters:
      camp - The Camp for which suggestions are being retrieved.
      Returns:
      SuggestionList A list of suggestions related to the specified camp.
    • getSuggestions

      public static SuggestionList getSuggestions(Staff staff)
      Retrieves a list of suggestions made by a specific staff member.
      Parameters:
      staff - The Staff whose suggestions are being retrieved.
      Returns:
      SuggestionList A list of suggestions made by the specified staff member.
    • getSuggestions

      public static SuggestionList getSuggestions(Student student)
      Retrieves a list of suggestions made by a specific student.
      Parameters:
      student - The Student whose suggestions are being retrieved.
      Returns:
      SuggestionList A list of suggestions made by the specified student.