Skip to content

Instantly share code, notes, and snippets.

@ornicar
Created June 25, 2023 07:49
Show Gist options
  • Save ornicar/7bd3dc136277bffc5743465118ef5ff1 to your computer and use it in GitHub Desktop.
Save ornicar/7bd3dc136277bffc5743465118ef5ff1 to your computer and use it in GitHub Desktop.
type Email = String
case class User(username: String, givenName: String, familyName: String, email: Email)
sealed abstract class Role(user: User, course: Course)
case class Student(user: User)
case class StudentInCourse(user: User, course: Course) extends Role(user, course)
case class Instructor(user: User, course: Course) extends Role(user, course)
case class Course(
name: String,
directory: String,
instructors: List[Instructor],
students: List[Student]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment