IbrahimBilal2005 / CampusPulse

0 stars 0 forks source link

Creation #35

Closed W-Akrabi closed 1 day ago

W-Akrabi commented 2 days ago

This pull request introduces several components to the system related to the creation of Account types (e.g., Admin, User, EventPoster) and event creation strategies. These components are designed using the Strategy Design Pattern, providing flexibility for future extensions of account types and event creation methods.

Changes:

AccountCreationStrategy Interface: Defines a common interface for all account creation strategies. Contains a createAccount method that accepts parameters like username, password, and additional account-specific data (using varargs). AdminCreationStrategy: Implements AccountCreationStrategy to create Admin accounts. Takes a username and password as input and returns a new Admin object. EventCreationStrategy Interface: Defines a common interface for all event creation strategies. Includes a createEvent method for creating events with necessary details like name, description, start time, end time, and tags. StandardEventCreationStrategy: Implements EventCreationStrategy to create standard events. Validates that the start time is before the end time before creating the event. Admin Class: Implements the Account interface for Admin users. Provides basic functionality for managing admin credentials (username, password) and allows for password changes. Includes placeholders for potential approval process logic (maps for approved and pending event posters).

Additional Notes: The Admin class has a placeholder for logic related to event poster approvals. It is currently unimplemented, but it can be expanded to support approval workflows. The StandardEventCreationStrategy validates event times to ensure that the start time is before the end time, which can be expanded to include additional validation or rules in the future.

AhmadIbrahimWaqas commented 2 days ago

Great work with adding all these creation factories as these will help in our implementation and and follow Clean Architecture and SOLID principles and make our interactors more streamlined. The code structure looks adequate and there seem to be no styling errors. The readability and usability of this is also very good. Overall good work.

IbrahimBilal2005 commented 1 day ago

overall excellent work

"Validates that the start time is before the end time before creating the event." - is this apart of the role for strategy? I'm not 100% sure about how strategy works so take this with a grain of salt, but wouldn't input errors like this be dealt with in the event post interactor, and any logic issues (ex. start after end) can be routed to the presenter and a failedView?

Just something to think about. Otherwise everything looks good!

Towaiji commented 1 day ago

This pull request adds flexible account and event creation strategies using the Strategy Design Pattern, enhancing scalability and adhering to clean design principles. The validation in StandardEventCreationStrategy ensures integrity, and the admin approval placeholders set the stage for future features. This is a well-structured and valuable update to the system. Great work!

TanayLanghe commented 1 day ago

Good job catching these and changing them, as some have previously commented the breadth of what each file covers may be a bit too much but overall are very well done with no clear logical errors and allows for us to make use of it well for others parts of the project.