Code Review Gamification

@startuml
!theme plain
hide circle
left to right direction
skinparam backgroundColor transparent

class Developer {
  name
  picture
  points
  level
}

class Team {
  name
  identifier
  addMember()
  removeMember()
  addRepository()
  removeRepository()
}

class Repository {
  name
  description
  source
  isPublic
  createPullRequest()
  monitorActivity()
}

class PullRequest {
  title
  description
  submissionDate
  commits
  tags
  submit()
  edit()
  merge()
  close()
  requestReview()
}

class Review {
  comment
  didManualTest
  didCodeReview
  commit
  submit()
  edit()
  approve()
  requestChanges()
  addComments()
}

class CodeComment {
  comment
  reference
  reply()
  resolve()
}

enum ReviewState {
  APPROVE
  COMMENT
  REQUESTED_CHANGES
}

class Leaderboard {
  title
  timeframe
  selectTimeframe()
  updateRankings()
  displayRankings()
}

class LeaderboardEntry {
  score
  placement
  date
}

class Level {
  number
  minimumPoints
  maximumPoints
  currentPoints
  lastUpdated
  gainPoints()
  levelUp()
  viewLevelProgress()
}

abstract class Reward {
  title
  description
  criteria
  pointsReward
  displayReward()
  notifyDeveloper()
  notifyTeam()
}

class Badge {
  progress
  unlockDate
  awardBadge()
  trackProgress()
}

class Achievement {
  achievementDate
  unlock()
}

class Challenge {
  timeLimit
  timeRemaining
  start()
  complete()
}

class Quest {
  tasks
  progress
  start()
  complete()
}

class NotificationSystem {
  notifications
  sendNotification()
  viewNotification()
  markAsRead()
}

class GamificationDashboard { 
  displayPreferences
  displayDashboard()
  showWeekly()
  showMonthly()
  showAll()
}


Team o- "1..*" Developer: members
Team "*" - "1" Developer: teamLead

Repository o-- PullRequest: pullRequests
Team o-- "*" Repository: repositories
PullRequest o-- "1..*" Developer: author
Review --> Developer: author
Review o-- "*" CodeComment: comments
PullRequest o-- "*" Review: reviews
Review --- ReviewState: state

Leaderboard - Team
Leaderboard *- "*" LeaderboardEntry
Developer o-- "*" LeaderboardEntry

Reward <|-- Badge
Reward <|-- Achievement
Reward <|-- Challenge
Reward <|-- Quest

GamificationDashboard ---- Developer
GamificationDashboard o--- "*" Leaderboard: leaderboards
GamificationDashboard o--- "*" Reward: rewards
GamificationDashboard o--- "*" Level: achivedLevels
GamificationDashboard "*" --- NotificationSystem
NotificationSystem o- "*" Developer: recipients

@enduml