Skip to content

Database Models

Alan Lee edited this page Jun 7, 2016 · 4 revisions

User Model

User: {
  id: UUID,
  leaderboardId,          (Reference to the Leaderboard User.id)
  email: String,
  name: String,           (first and last name will all be 1 label for MVP1)
  password: String,       (hashed)
  locked: Boolean,        (if they tried to log in too many times)
  lastLogin: Date,        (the date of their last login)
  lastUpdatedBy: String,  (User.id of the person who updated the profile last)
  lastUpdated: Date,      (the date of their last profile update)
  createdDate: Date,      (the date this account was created)
  createdBy: String       (the User.id of the person who created this account, or SELF)
}

Scavenger Model

Scavenger: {
  id: UUID,
  name: String,           (the name of the scavenger hunt)
  description: String,    (a short description of the scavenger hunt)
  start: Date,            (a start date of the scavenger hunt that allows members to enter the competition)
  admins: [String],       (User.id that are allowed to edit/modify or administer the hunt)
  owner: String,          (User.id of the person who created the scavenger hunt)
  teams: [{               
    team: Team UUID,      (Reference to the team)
    score: Integer        (The score of the team)
  }],
  
}

Team Model: This ultimately might be merged in with the Leaderboard project.

Team: {
  id: UUID,
  name: String,           (the name of the scavenger hunt)
  createdDate: Date,      (date this team was created)
  members: [User UUID],   (Reference to the User)
  badges: [Badge ID],     (An array of badges the team has earned)
}
Clone this wiki locally