Package app.controller.camp
Class CampSuggestionController
java.lang.Object
app.controller.camp.CampSuggestionController
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 Summary
Modifier and TypeMethodDescriptionstatic booleanapproveSuggestion(Suggestion suggestion, Staff staff, boolean isApproved) Approves or rejects a suggestion.static booleancreateSuggestion(Student sender, CampDetails suggsetion, Camp originalCamp) Creates a new suggestion for a camp and adds it to the suggestion repository.static booleandeleteSuggestion(Suggestion suggestion) Deletes a suggestion from the suggestion repository.static SuggestionListgetSuggestions(Camp camp) Retrieves a list of suggestions for a specific camp.static SuggestionListgetSuggestions(Staff staff) Retrieves a list of suggestions made by a specific staff member.static SuggestionListgetSuggestions(Student student) Retrieves a list of suggestions made by a specific student.static booleanupdateSuggestion(Suggestion newSuggestion) Updates an existing suggestion in the suggestion repository.
-
Method Details
-
createSuggestion
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- TheStudentwho is sending the suggestion.suggsetion- TheCampDetailscontaining the suggestion details.originalCamp- The originalCampfor which the suggestion is made.- Returns:
- boolean True if the suggestion is successfully created and inserted.
-
updateSuggestion
Updates an existing suggestion in the suggestion repository.- Parameters:
newSuggestion- The updatedSuggestionto be stored.- Returns:
- boolean True if the suggestion is successfully updated.
-
deleteSuggestion
Deletes a suggestion from the suggestion repository.- Parameters:
suggestion- TheSuggestionto be removed.- Returns:
- boolean True if the suggestion is successfully deleted.
-
approveSuggestion
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- TheSuggestionto be approved or rejected.staff- TheStaffmember reviewing the suggestion.isApproved- True if the suggestion is approved, false otherwise.- Returns:
- boolean True if the operation is successful.
-
getSuggestions
Retrieves a list of suggestions for a specific camp.- Parameters:
camp- TheCampfor which suggestions are being retrieved.- Returns:
- SuggestionList A list of suggestions related to the specified camp.
-
getSuggestions
Retrieves a list of suggestions made by a specific staff member.- Parameters:
staff- TheStaffwhose suggestions are being retrieved.- Returns:
- SuggestionList A list of suggestions made by the specified staff member.
-
getSuggestions
Retrieves a list of suggestions made by a specific student.- Parameters:
student- TheStudentwhose suggestions are being retrieved.- Returns:
- SuggestionList A list of suggestions made by the specified student.
-