Sequence Diagrams - bounswe/bounswe2024group12 GitHub Wiki
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%view
U->>P: viewProfile(user)
P->>DB: Retrieve profile data
alt Retrieve Successful
DB-->>P: Return profile data
P->>U: Display profile
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%follow
U->>P: followUser(user)
P->>DB: Update followings
alt Successful
DB-->>P: Success
P->>U: Success
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%follow
U->>P: unfollowUser(user)
P->>DB: Update followings
alt Successful
DB-->>P: Success
P->>U: Success
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%block
U->>P: blockUser(user)
P->>DB: Update block list
alt Successful
DB-->>P: Success
P->>U: Success
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%report
U->>P: reportUser(user, reason)
P->>DB: Log report
alt Successful
DB-->>P: Success
P->>U: Success
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%select fav game
U->>P: viewProfile()
P->>DB: setFavoriteGame(index, game)
alt Successful
DB-->>P: Success
P->>U: Success
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%select fav property
U->>P: viewProfile()
P->>DB: setFavoriteGameProperty(gameProperty, value)
alt Successful
DB-->>P: Success
P->>U: Success
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%edit profile picture
U->>P: changeProfilePicture(picture)
P->>DB: Update profile picture
alt Successful
DB-->>P: Success
P->>U: Success
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
%logout
U->>P: logOut()
alt Successful
P-->>U: Confirm logout
else Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%change password
U->>P: changePassword(password)
P->>DB: Update password
alt Successful
DB-->>P: Successful
P-->>U: Successful
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor U as User
participant P as Profile
participant DB as Database
%delete account
U->>P: deleteAccount()
P->>DB: Remove account data
alt Successful
DB-->>P: Successful
P-->>U: Successful
else Failure
DB-->>P: Failure
P-->>U: Failure
end
sequenceDiagram
actor G as Guest User
participant S as System
participant DB as Database
%register
G->>S: register(username, email, password)
S->>DB: Save new user
alt Successful
DB-->>S: User saved
S-->>G: Successful
else Failure
DB-->>S: Failure
S-->>G: Failure
end
sequenceDiagram
actor G as Guest User
participant S as System
participant DB as Database
%login
G->>S: login(username, password)
S->>DB: Validate user credentials
alt Valid
DB-->>S: Credentials valid
S->>G: Login successful
else Unvalid
DB-->>S: Credentials unvalid
S-->>G: Failure
end
sequenceDiagram
actor G as Guest User
participant S as System
participant DB as Database
participant E as Email System
%forget password
G->>S: resetPassword(email)
S->>E: Send password reset email
E->>G: Password reset email
G->>E: Click reset link
E->>S: Prompt reset password
S->>DB: Update password
alt Successful
DB->>S: Password updated
S-->>G: Password reset successful
else Failure
DB-->>S: Failure
S-->>G: Failure
end
sequenceDiagram
actor Registered User
Registered User->>+Game: createReview(game, rating, text)
Game->>+ Database: add review to the Game's review list
alt Addition Succesfull
Database-->>Game: success
Game-->>Registered User: success
else
Database-->>-Game: failure
Game-->>-Registered User: failure
end
sequenceDiagram
actor Registered User
Registered User->>+Game: deleteReview(review)
Game->>+ Database: delete review from the Game's review list
alt Deletion Succesfull
Database-->>Game: success
Game-->>Registered User: Your review has been deleted succesfully
else
Database-->>-Game: failure
Game-->>-Registered User: An error occured while deleting your review!
end
sequenceDiagram
actor Registered User
Registered User->>+Game: getReview(game, reviewId)
Game->>+ Database: show the review from the Game's review list
alt Viewing Succesfull
Database-->>Game: review
Game-->>Registered User: review
else
Database-->>-Game: failure
Game-->>-Registered User: An error occured while fetching the review!
end
sequenceDiagram
actor Registered User
Registered User->>+Game: filterReviews(game, upperLimit, lowerLimit)
Game->>+ Database: show the reviews from the Game's review list
alt Fetching Reviews Succesfull
Database-->>Game: reviewList
Game-->>Registered User: reviewList
else
Database-->>-Game: failure
Game-->>-Registered User: An error occured while fetching the review list!
end
sequenceDiagram
actor Registered User
Registered User->>+System: getGame(gameId)
System->>+ Database: get the details of the Game
alt Fetching Succesfull
Database-->>System: game
System-->>Registered User: game
else
Database-->>-System: failure
System-->>-Registered User: An error occured while fetching the game details!
end
sequenceDiagram
actor Registered User
Registered User->>+System: likeGame(gameId)
System->>+ Database: add the Game to the likedGames list
alt Like Succesfull
Database-->>System: success
System-->>Registered User: Success!
else
Database-->>-System: failure
System-->>-Registered User: An error occured while liking the game!
end
sequenceDiagram
actor Registered User
Registered User->>+System: unlikeGame(gameId)
System->>+ Database: remove the Game from the likedGames list
alt Unlike Succesfull
Database-->>System: success
System-->>Registered User: Success!
else
Database-->>-System: failure
System-->>-Registered User: An error occured while unliking the game!
end
sequenceDiagram
actor Registered User
Registered User->>+System: addGameToList(listId, gameId)
System->>+ Database: add the game to the game list
alt Fetching Succesfull
Database-->>System: success
System-->>Registered User: Success!
else
Database-->>-System: failure
System-->>-Registered User: An error occured while adding the game to the list!
end
sequenceDiagram
actor Registered User
Registered User->>+System: removeGameFromList(listId, gameId)
System->>+ Database: remove the game from the game list
alt Fetching Succesfull
Database-->>System: success
System-->>Registered User: Success!
else
Database-->>-System: failure
System-->>-Registered User: An error occured while removing the game from the list!
end
sequenceDiagram
participant Main_Page
participant Game_Service
participant Review_Service
participant Friend_Service
participant User_Service
Main_Page ->> Game_Service: +gameOfTheDay(): Game
Game_Service -->> Main_Page: Game
Main_Page ->> Game_Service: +popularGames(): List<Game>
Game_Service -->> Main_Page: List<Game>
Main_Page ->> Game_Service: +newGames(): List<Game>
Game_Service -->> Main_Page: List<Game>
Main_Page ->> Review_Service: +recentReviews(): List<Review>
Review_Service -->> Main_Page: List<Review>
Main_Page ->> Friend_Service: +friendReviews(user: RegisteredUser): List<Review>
Friend_Service -->> Main_Page: List<Review>
Main_Page ->> Game_Service: +moreGames(): List<Game>
Game_Service -->> Main_Page: List<Game>
sequenceDiagram
participant User
participant Server
User ->> Server: search(category, term)
Server ->> Server: Validate category and term
alt category is GAME
Server ->> Server: Search for games matching term
Server -->> User: Return search results
else category is REVIEW
Server ->> Server: Search for reviews matching term
Server -->> User: Return search results
else category is LIST
Server ->> Server: Search for lists matching term
Server -->> User: Return search results
else category is USER
Server ->> Server: Search for users matching term
Server -->> User: Return search results
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: deleteUser(user)
Server ->> Server: Validate admin privileges
Server ->> Server: Delete user account
alt Success
Server -->> Admin: User deleted successfully
else Failure
Server -->> Admin: Failed to delete user
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: deleteReview(review)
Server ->> Server: Validate admin privileges
Server ->> Server: Delete review
alt Success
Server -->> Admin: Review deleted successfully
else Failure
Server -->> Admin: Failed to delete review
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: deleteList(list)
Server ->> Server: Validate admin privileges
Server ->> Server: Delete list
alt Success
Server -->> Admin: List deleted successfully
else Failure
Server -->> Admin: Failed to delete list
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: editPublicListTitle(list, newTitle)
Server ->> Server: Validate admin privileges
Server ->> Server: Edit public list title
alt Success
Server -->> Admin: List title edited successfully
else Failure
Server -->> Admin: Failed to edit list title
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: editPublicListDescription(list, newDescription)
Server ->> Server: Validate admin privileges
Server ->> Server: Edit public list description
alt Success
Server -->> Admin: List description edited successfully
else Failure
Server -->> Admin: Failed to edit list description
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: changePublicListToPrivate(list)
Server ->> Server: Validate admin privileges
Server ->> Server: Change public list to private
alt Success
Server -->> Admin: List changed to private successfully
else Failure
Server -->> Admin: Failed to change list to private
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: editReviewText(review, newText)
Server ->> Server: Validate admin privileges
Server ->> Server: Edit review text
alt Success
Server -->> Admin: Review text edited successfully
else Failure
Server -->> Admin: Failed to edit review text
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: changeProfilePicture(user, picture)
Server ->> Server: Validate admin privileges
Server ->> Server: Change user's profile picture
alt Success
Server -->> Admin: Profile picture changed successfully
else Failure
Server -->> Admin: Failed to change profile picture
end
sequenceDiagram
participant Admin
participant Server
Admin ->> Server: banUser(user, period)
Server ->> Server: Validate admin privileges
Server ->> Server: Ban user for specified period
alt Success
Server -->> Admin: User banned successfully
else Failure
Server -->> Admin: Failed to ban user
end