diff --git a/src/main/java/edu/group5/app/control/AuthController.java b/src/main/java/edu/group5/app/control/AuthController.java index 4911a3b..291e0df 100644 --- a/src/main/java/edu/group5/app/control/AuthController.java +++ b/src/main/java/edu/group5/app/control/AuthController.java @@ -7,11 +7,8 @@ import edu.group5.app.view.loginpage.LoginPageView; import edu.group5.app.view.loginpage.SignUpPageView; import javafx.scene.control.Alert; -import javafx.scene.control.Button; import javafx.scene.control.ButtonType; -import java.util.Arrays; - import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; /** diff --git a/src/main/java/edu/group5/app/control/NavigationController.java b/src/main/java/edu/group5/app/control/NavigationController.java index 326389b..d94bb53 100644 --- a/src/main/java/edu/group5/app/control/NavigationController.java +++ b/src/main/java/edu/group5/app/control/NavigationController.java @@ -18,7 +18,14 @@ import javafx.scene.layout.BorderPane; /** - * Controller responsible for navigating between views within the root node. + * Controller responsible for handling navigation between different pages of the application. + * Coordinates between {@link AppState}, {@link AuthController}, {@link DonationController}, + * {@link OrganizationController} and the various views to manage page transitions and state updates. + *
+ * Provides methods to navigate to the home page, login page, sign-up page, causes page, + * organization page, donation page, payment complete page and user profile page. Each method updates the + * top header and center content of the main application layout accordingly. + *
*/ public class NavigationController { private final BorderPane root; @@ -50,36 +57,65 @@ public NavigationController(BorderPane root, AppState appState, UserService user this.organizationController = new OrganizationController(organizationService); } + /** + * Navigates to the home page by setting the top header and center content of the main layout. + * The home page serves as the landing page of the application, providing an overview and access to various features. + */ public void showHomePage() { root.setTop(header); root.setCenter(new HomePageView(appState, this)); } + /** + * Navigates to the login page by setting the top header and center content of the main layout. + * The login page allows existing users to enter their credentials and access their account. + */ public void showLoginPage() { root.setTop(loginHeader); root.setCenter(new LoginPageView(appState, this, authController)); } + /** + * Navigates to the sign-up page by setting the top header and center content of the main layout. + * The sign-up page allows new users to create an account by providing their details. + */ public void showSignUpPage() { root.setTop(loginHeader); root.setCenter(new SignUpPageView(appState, this, authController)); } + /** + * Navigates to the payment complete page by setting the top header and center content of the main layout. + * The payment complete page confirms the successful completion of a donation transaction. + */ public void showPaymentCompletePage() { root.setTop(header); root.setCenter(new PaymentCompletePageView(this)); } + /** + * Navigates to the causes page by setting the top header and center content of the main layout. + * The causes page allows users to browse and search for organizations they may want to donate to. + */ public void showCausesPage() { root.setTop(header); root.setCenter(new CausesPageView(appState, this, organizationController)); } + /** + * Navigates to the organization page by setting the top header and center content of the main layout. + * The organization page provides detailed information about a specific organization, including its mission, + * impact, and donation options, allowing users to learn more before making a donation. + */ public void showOrganizationPage() { root.setTop(header); root.setCenter(new OrganizationPageView(appState, this, donationController)); } + /** + * Navigates to the donation page by setting the top header and center content of the main layout. + * The donation page allows users to make new donations to selected organizations. + */ public void showDonationPage() { root.setTop(header); root.setCenter(new DonationPageView(appState, this, donationController)); @@ -89,6 +125,11 @@ public void showAboutUsPage() { root.setTop(header); } + /** + * Navigates to the user profile page by setting the top header and center content of the main layout. + * The user profile page allows users to view and manage their account information, + * donation history, and other personalized features. + */ public void showUserPage() { root.setTop(header); root.setCenter(new UserPageView(appState, this, authController, donationController, organizationController)); diff --git a/src/main/java/edu/group5/app/control/OrganizationController.java b/src/main/java/edu/group5/app/control/OrganizationController.java index fc1252f..064aab2 100644 --- a/src/main/java/edu/group5/app/control/OrganizationController.java +++ b/src/main/java/edu/group5/app/control/OrganizationController.java @@ -3,13 +3,20 @@ import edu.group5.app.model.organization.Organization; import edu.group5.app.model.organization.OrganizationService; import edu.group5.app.utils.ParameterValidator; -import tools.jackson.databind.deser.bean.CreatorCandidate.Param; import java.util.Map; import java.util.concurrent.CompletableFuture; /** * Controller responsible for organization-related operations. + * + *+ * Coordinates with {@link OrganizationService} to: + *
+ * Repositories are responsible for managing collections of entities, providing + * basic operations for accessing and manipulating these entities. The specific + * type of entities and the underlying data structure are defined by subclasses. + *
*/ public abstract class Repository