Skip to content

Admin Management and Moderator Functions Sequence Diagrams

Selman Akman edited this page Oct 15, 2025 · 9 revisions

Manage User Accounts

Diagram

image

Code

@startuml
actor Admin
participant ":AdminService" as AdminService
participant ":User" as UserObj

Admin -> AdminService: manageAccount(userID, action, data)
alt Action = Create
    AdminService -> UserObj: createUser(username, email, password)
    alt Valid Input
        UserObj --> AdminService: userCreated(userID)
        AdminService --> Admin: showConfirmation("User " + username + " created")
    else Invalid Input
        UserObj --> AdminService: error("Invalid user data")
        AdminService --> Admin: showError("Invalid username or email")
    end
else Action = Edit
    AdminService -> UserObj: getUser(userID)
    alt User Exists
        UserObj --> AdminService: userData
        AdminService -> UserObj: updateUser(userID, newData)
        UserObj --> AdminService: userUpdated()
        AdminService --> Admin: showConfirmation("User updated")
    else User Not Found
        UserObj --> AdminService: error("User not found")
        AdminService --> Admin: showError("Invalid user ID")
    end
else Action = Delete
    AdminService -> UserObj: getUser(userID)
    alt User Exists
        UserObj --> AdminService: userData
        AdminService -> UserObj: deleteUser(userID)
        UserObj --> AdminService: userDeleted()
        AdminService --> Admin: showConfirmation("User deleted")
    else User Not Found
        UserObj --> AdminService: error("User not found")
        AdminService --> Admin: showError("Invalid user ID")
    end
end

@enduml

Review User Activity

Diagram

image

Code

@startuml
actor Admin
participant ":AdminService" as AdminService
participant ":User" as UserObj

Admin -> AdminService: reviewUserActivity(userID)
AdminService -> UserObj: getUser(userID)
alt User Exists
    UserObj --> AdminService: userData
    AdminService -> AdminService: fetchLogs(userID, logType)
    AdminService --> Admin: displayActivityLogs(wasteLogs, challengeLogs)
else User Not Found
    UserObj --> AdminService: error("User not found")
    AdminService --> Admin: showError("Invalid user ID")
end

@enduml

Send Platform Notifications

Diagram

image

Code

@startuml
actor Admin
participant ":NotificationService" as NotificationService
participant ":Notification" as NotificationObj
participant ":User" as UserObj

Admin -> NotificationService: sendPlatformNotification(message, userGroup, eventID)
alt Valid Message and Group
    NotificationService -> UserObj: getUsersByGroup(userGroup)
    UserObj --> NotificationService: userList
    NotificationService -> NotificationObj: createNotification(message, userList, eventID)
    NotificationObj --> NotificationService: notificationCreated()
    NotificationService --> Admin: showConfirmation("Notifications sent to group")
else Invalid Input
    NotificationService --> Admin: showError("Invalid message or user group")
end

@enduml

Access Analytics Dashboard

Diagram

image

Code

@startuml
actor Admin
participant ":AdminService" as AdminService

Admin -> AdminService: accessAnalytics()
AdminService -> AdminService: getAnalytics(dataType)
alt Success
    AdminService --> Admin: displayAnalyticsDashboard(userStats, challengeStats)
else Data Unavailable
    AdminService --> Admin: showError("Failed to load analytics data")
end

@enduml

Modify Platform Settings

Diagram

image

Code

@startuml
actor Admin
participant ":AdminService" as AdminService

Admin -> AdminService: updatePlatformSettings(notificationSettings, platformConfig)
AdminService -> AdminService: getCurrentSettings()
alt Valid Settings
    AdminService -> AdminService: validateSettings(notificationSettings, platformConfig)
    AdminService -> AdminService: saveSettings(notificationSettings, platformConfig)
    AdminService --> Admin: showConfirmation("Settings updated")
else Invalid Settings
    AdminService --> Admin: showError("Invalid settings configuration")
end

@enduml

Approve Custom Waste Category

Diagram

image

Code

@startuml
actor Admin
participant ":WasteCategoryService" as CategoryService
participant ":WasteCategory" as CategoryObj
participant ":NotificationService" as NotificationService

Admin -> CategoryService: approveCustomCategory(categoryID, score, unit)
CategoryService -> CategoryObj: getCategory(categoryID)
alt Valid Category
    CategoryObj --> CategoryService: categoryData(name, userID)
    CategoryService -> CategoryObj: updateCategory(status=approved, score, unit)
    CategoryService -> NotificationService: sendApprovalNotification(userID, "Category " + name + " approved")
    NotificationService --> Admin: showConfirmation("Category approved")
else Invalid Category
    CategoryObj --> CategoryService: error("Category not found")
    CategoryService --> Admin: showError("Invalid category ID")
end

@enduml

Manage Group Challenges

Diagram

image

Code

@startuml
actor Admin
participant ":ChallengeService" as ChallengeService
participant ":Challenge" as ChallengeObj

Admin -> ChallengeService: manageChallenge(challengeID, action, name, startDate, endDate)
alt Action = Create
    ChallengeService -> ChallengeObj: createChallenge(name, startDate, endDate)
    alt Valid Data
        ChallengeObj --> ChallengeService: challengeCreated()
        ChallengeService --> Admin: showConfirmation("Challenge " + name + " created")
    else Invalid Data
        ChallengeObj --> ChallengeService: error("Invalid challenge data")
        ChallengeService --> Admin: showError("Invalid challenge details")
    end
else Action = Edit
    ChallengeService -> ChallengeObj: getChallenge(challengeID)
    alt Challenge Exists
        ChallengeObj --> ChallengeService: challengeData
        ChallengeService -> ChallengeObj: updateChallenge(challengeID, name, startDate, endDate)
        ChallengeObj --> ChallengeService: challengeUpdated()
        ChallengeService --> Admin: showConfirmation("Challenge updated")
    else Challenge Not Found
        ChallengeObj --> ChallengeService: error("Challenge not found")
        ChallengeService --> Admin: showError("Invalid challenge ID")
    end
else Action = Delete
    ChallengeService -> ChallengeObj: getChallenge(challengeID)
    alt Challenge Exists
        ChallengeObj --> ChallengeService: challengeData
        ChallengeService -> ChallengeObj: deleteChallenge(challengeID)
        ChallengeObj --> ChallengeService: challengeDeleted()
        ChallengeService --> Admin: showConfirmation("Challenge deleted")
    else Challenge Not Found
        ChallengeObj --> ChallengeService: error("Challenge not found")
        ChallengeService --> Admin: showError("Invalid challenge ID")
    end
end

@enduml

Award Challenge Points

Diagram

image

Code

@startuml
actor Admin
participant ":ChallengeService" as ChallengeService
participant ":AchievementService" as AchievementService
participant ":Challenge" as ChallengeObj
participant ":User" as UserObj

Admin -> ChallengeService: awardPoints(completionID)
ChallengeService -> ChallengeObj: getChallenge(completionID)
alt Valid Completion
    ChallengeObj --> ChallengeService: challengeData(points, userID)
    ChallengeService -> AchievementService: earn(userID, points, challengeID)
    AchievementService -> UserObj: getUser(userID)
    UserObj --> AchievementService: userData
    AchievementService -> UserObj: updateScore(points)
    UserObj --> AchievementService: scoreUpdated()
    AchievementService --> Admin: showConfirmation("Points awarded for challenge")
else Invalid Completion
    ChallengeObj --> ChallengeService: error("Invalid completion")
    ChallengeService --> Admin: showError("Invalid completion ID")
end

@enduml

Moderator Send Message

Diagram

image

Code

@startuml
actor Moderator
participant ":ModeratorService" as ModeratorService
participant ":NotificationService" as NotificationService
participant ":Notification" as NotificationObj
participant ":User" as UserObj

Moderator -> ModeratorService: sendMessage(userID, message)
ModeratorService -> UserObj: getUser(userID)
alt Valid User
    UserObj --> ModeratorService: userData
    ModeratorService -> NotificationService: sendNotification(userID, message)
    NotificationService -> NotificationObj: createNotification(userID, message)
    alt Valid Message
        NotificationObj --> NotificationService: notificationCreated()
        NotificationService --> Moderator: showConfirmation("Message sent to user")
    else Invalid Message
        NotificationObj --> NotificationService: error("Invalid message")
        NotificationService --> Moderator: showError("Invalid message content")
    end
else Invalid User
    UserObj --> ModeratorService: error("User not found")
    ModeratorService --> Moderator: showError("Invalid user ID")
end

@enduml

Warn and Suspend Users

Image

Code:

@startuml
actor Moderator
participant ":ModeratorService" as ModeratorService
participant ":User" as UserObj

Moderator -> ModeratorService: warnOrSuspendUser(userID, action, reason, duration)
ModeratorService -> UserObj: getUser(userID)
alt Valid User
    UserObj --> ModeratorService: userData
    alt Action = Warn
        ModeratorService -> UserObj: warnUser(reason)
        UserObj --> ModeratorService: warningApplied()
        ModeratorService --> Moderator: showConfirmation("User warned")
    else Action = Suspend
        ModeratorService -> UserObj: suspendUser(duration, reason)
        UserObj --> ModeratorService: suspensionApplied()
        ModeratorService --> Moderator: showConfirmation("User suspended for " + duration)
    else Invalid Action
        ModeratorService --> Moderator: showError("Invalid action")
    end
else Invalid User
    UserObj --> ModeratorService: error("User not found")
    ModeratorService --> Moderator: showError("Invalid user ID")
end

@enduml

Review Flagged Content

Diagram

Image

Code

@startuml
actor Moderator
participant ":ModeratorService" as ModeratorService
participant ":Tip" as TipObj

Moderator -> ModeratorService: reviewContent(contentID, decision)
ModeratorService -> TipObj: getContent(contentID)
alt Valid Content
    TipObj --> ModeratorService: contentData(type=Tip)
    ModeratorService -> TipObj: updateContentStatus(decision=approve/reject)
    TipObj --> ModeratorService: statusUpdated()
    ModeratorService --> Moderator: showConfirmation("Content reviewed: " + decision)
else Invalid Content
    TipObj --> ModeratorService: error("Content not found")
    ModeratorService --> Moderator: showError("Invalid content ID")
end

@enduml

Escalate Issues to Admin

Diagram

Image

Code

@startuml
actor Moderator
participant ":ModeratorService" as ModeratorService
participant ":AdminService" as AdminService

Moderator -> ModeratorService: escalateIssue(issueID, notes)
ModeratorService -> ModeratorService: getIssue(issueID)
alt Valid Issue
    ModeratorService --> ModeratorService: issueDetails
    ModeratorService -> AdminService: notifyAdmin(issueID, notes)
    AdminService --> ModeratorService: issueReceived()
    ModeratorService --> Moderator: showConfirmation("Issue escalated with notes")
else Invalid Issue
    ModeratorService --> Moderator: showError("Invalid issue ID")
end

@enduml

Manage Event Types

Diagram

Image

Code

@startuml
actor Admin
participant ":EventService" as EventService
participant ":EventType" as EventTypeObj

Admin -> EventService: manageEventType(eventTypeID, action, name, description)
alt Action = Create
    EventService -> EventTypeObj: createEventType(name, description)
    alt Valid Data
        EventTypeObj --> EventService: eventTypeCreated()
        EventService --> Admin: showConfirmation("Event type " + name + " created")
    else Invalid Data
        EventTypeObj --> EventService: error("Invalid event type data")
        EventService --> Admin: showError("Invalid event type details")
    end
else Action = Update
    EventService -> EventTypeObj: getEventType(eventTypeID)
    alt Event Type Exists
        EventTypeObj --> EventService: eventTypeData
        EventService -> EventTypeObj: updateEventType(eventTypeID, name, description)
        EventTypeObj --> EventService: eventTypeUpdated()
        EventService --> Admin: showConfirmation("Event type updated")
    else Event Type Not Found
        EventTypeObj --> EventService: error("Event type not found")
        EventService --> Admin: showError("Invalid event type ID")
    end
end

@enduml

Moderate Event Interactions

Diagram

Image

Code

@startuml
actor Moderator
participant ":ModeratorService" as ModeratorService
participant ":EventInteractionService" as EventInteractionService
participant ":EventInteraction" as EventInteractionObj

Moderator -> ModeratorService: moderateEventInteraction(interactionID, action=approve/reject)
ModeratorService -> EventInteractionService: getInteraction(interactionID)
alt Valid Interaction
    EventInteractionService -> EventInteractionObj: getInteractionData()
    EventInteractionObj --> EventInteractionService: interactionData(userID, attendance_status, emoji_reaction)
    EventInteractionService -> EventInteractionObj: moderateInteraction(action)
    EventInteractionObj --> EventInteractionService: interactionUpdated()
    EventInteractionService --> Moderator: showConfirmation("Interaction " + action)
else Invalid Interaction
    EventInteractionService --> Moderator: showError("Invalid interaction ID")
end

@enduml

Labs

Team Members

Weekly Reports

Ahmet Okta
Barathan Aslan
Berke Kartal
Mehmet Çağlar Kurt
Mehmet Emin Atak
Muhammet Berkay Keskin
Mustafa Taha Söylemez
Nilsu Tüysüz
Selman Akman
Ömer Faruk Bayram

Meetings

Milestones

Templates

Research on Git

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)

CMPE352 Archive

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)



Documentation(Individual Contributions and/or Milestone Report)

Individual Contributions

Meeting Notes

Clone this wiki locally