Skip to content

Sequence Diagrams ‐ Tips and Recommendations

Selman Akman edited this page Oct 17, 2025 · 3 revisions

View Tips Sequence Diagram

Diagram

image

Code

@startuml
actor User
participant ":TipService" as TipService
participant ":Tip" as TipObj
participant ":Event" as EventObj

User -> TipService: viewTips(userID, categoryID, eventID)
TipService -> TipObj: getTips(categoryID, eventID)
alt Tips Found
    TipObj --> TipService: tipList(content, category, eventID)
    TipService --> User: displayTips(tipList)
else No Tips Found
    TipObj --> TipService: emptyList
    TipService --> User: showMessage("No tips available")
end

@enduml

Search Tips Sequence Diagram

Diagram

image

Code

@startuml
actor User
participant ":TipService" as TipService
participant ":Tip" as TipObj

User -> TipService: searchTips(query, eventID)
alt Valid Query
    TipService -> TipObj: searchTips(query, eventID)
    alt Tips Found
        TipObj --> TipService: tipList(content, category, eventID)
        TipService --> User: displaySearchResults(tipList)
    else No Tips Found
        TipObj --> TipService: emptyList
        TipService --> User: showMessage("No tips found")
    end
else Invalid Query
    TipService --> User: showError("Invalid search query")
end

@enduml

Submit Tips Sequence Diagram

Diagram

image

Code

@startuml
actor User
participant ":TipService" as TipService
participant ":User" as UserObj
participant ":Tip" as TipObj

User -> TipService: submitTip(userID, content, category, eventID)
TipService -> UserObj: getUser(userID)
alt User Authenticated
    UserObj --> TipService: userData
    alt Valid Input
        TipService -> TipObj: createTip(content, category, userID, eventID, status="pending")
        TipObj --> TipService: tipCreated(tipID)
        TipService --> User: showConfirmation("Tip submitted for moderation")
    else Invalid Input
        TipService --> User: showError("Invalid content or category")
    end
else User Not Authenticated
    UserObj --> TipService: error("User not found")
    TipService --> User: showError("Please log in to submit tips")
end

@enduml

Save Tips Sequence Diagram

Diagram

image

Code

@startuml
actor User
participant ":TipService" as TipService
participant ":User" as UserObj
participant ":Tip" as TipObj

User -> TipService: saveTip(userID, tipID)
TipService -> UserObj: getUser(userID)
alt User Authenticated
    UserObj --> TipService: userData
    TipService -> TipObj: getTip(tipID)
    alt Tip Exists
        TipObj --> TipService: tipData
        TipService -> UserObj: saveTipForUser(userID, tipID)
        UserObj --> TipService: tipSaved()
        TipService --> User: showConfirmation("Tip saved successfully")
    else Tip Not Found
        TipObj --> TipService: error("Tip not found")
        TipService --> User: showError("Invalid tip ID")
    end
else User Not Authenticated
    UserObj --> TipService: error("User not found")
    TipService --> User: showError("Please log in to save tips")
end

@enduml

Share Tips Sequence Diagram

Diagram

image

Code

@startuml
actor User
participant ":TipService" as TipService
participant ":User" as UserObj
participant ":Tip" as TipObj
participant ":ExternalPlatform" as Platform

User -> TipService: shareTip(userID, tipID, platform)
TipService -> UserObj: getUser(userID)
alt User Authenticated
    UserObj --> TipService: userData
    TipService -> TipObj: getTip(tipID)
    alt Tip Exists
        TipObj --> TipService: tipData(content)
        TipService -> Platform: shareTipContent(content, platform)
        alt Share Successful
            Platform --> TipService: success
            TipService --> User: showConfirmation("Tip shared successfully")
        else Share Failed
            Platform --> TipService: error("Platform error")
            TipService --> User: showError("Failed to share tip")
        end
    else Tip Not Found
        TipObj --> TipService: error("Tip not found")
        TipService --> User: showError("Invalid tip ID")
    end
else User Not Authenticated
    UserObj --> TipService: error("User not found")
    TipService --> User: showError("Please log in to share tips")
end

@enduml

View Recommendations Sequence Diagram

Diagram

image

Code

@startuml
actor User
participant ":RecommendationService" as RecService
participant ":User" as UserObj
participant ":Tip" as TipObj
participant ":Product" as ProductObj

User -> RecService: getRecommendations(userID)
RecService -> UserObj: getUser(userID)
alt User Authenticated
    UserObj --> RecService: userData(wasteData)
    RecService -> TipObj: getTipsForUser(wasteData)
    TipObj --> RecService: tipList
    RecService -> ProductObj: getEcoProducts(wasteData)
    ProductObj --> RecService: productList
    alt Recommendations Found
        RecService --> User: displayRecommendations(tipList, productList)
    else No Recommendations
        RecService --> User: showMessage("No recommendations available")
    end
else User Not Authenticated
    UserObj --> RecService: error("User not found")
    RecService --> User: showError("Please log in to view recommendations")
end

@enduml

View Eco-Friendly Products Sequence Diagram

Diagram

image

Code

@startuml
actor User
participant ":RecommendationService" as RecService
participant ":User" as UserObj
participant ":Product" as ProductObj

User -> RecService: getEcoProductRecommendations(userID)
RecService -> UserObj: getUser(userID)
alt User Authenticated
    UserObj --> RecService: userData(wasteData)
    RecService -> ProductObj: getEcoProducts(wasteData)
    alt Products Found
        ProductObj --> RecService: productList
        RecService --> User: displayEcoProducts(productList)
    else No Products Found
        ProductObj --> RecService: emptyList
        RecService --> User: showMessage("No eco-friendly products available")
    end
else User Not Authenticated
    UserObj --> RecService: error("User not found")
    RecService --> User: showError("Please log in to view products")
end

@enduml

Reward Tip Contribution Sequence Diagram

Diagram

image

Code

@startuml
actor Admin
participant ":TipService" as TipService
participant ":AchievementService" as AchievementService
participant ":User" as UserObj
participant ":Tip" as TipObj

Admin -> TipService: rewardTipContribution(adminID, tipID, rewardPoints)
TipService -> TipService: verifyAdmin(adminID)
alt Admin Authorized
    TipService -> TipObj: getTip(tipID)
    alt Tip Exists
        TipObj --> TipService: tipData(contributorID)
        TipService -> AchievementService: earn(contributorID, rewardPoints, "Tip Contribution")
        AchievementService -> UserObj: updateScore(contributorID, rewardPoints)
        UserObj --> AchievementService: scoreUpdated()
        AchievementService --> TipService: rewardAssigned()
        TipService --> Admin: showConfirmation("Reward assigned for tip")
    else Tip Not Found
        TipObj --> TipService: error("Tip not found")
        TipService --> Admin: showError("Invalid tip ID")
    end
else Unauthorized
    TipService --> Admin: showError("Admin access required")
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