object Tasks sealed trait Minor def period Duration sealed trait Major

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
object Tasks {
sealed trait Minor {
def period: Duration
}
sealed trait Major
sealed trait Task {
def majorParams: Major
def minorParams: Minor
}
case class CheckInventory(majorParams: CheckInventoryMajor, minorParams: CheckInventoryMinor) extends Task
case class CheckInventoryMinor(period: Duration) extends Minor
case class CheckInventoryMajor(user: User) extends Major
}