fix Period.id
This commit is contained in:
parent
04c10a5fae
commit
2a9f0c8b62
|
@ -5,13 +5,15 @@ import scalaz.NonEmptyList
|
|||
|
||||
// contains aggregated data over (up to) 100 games
|
||||
case class Period(
|
||||
id: String, // random
|
||||
_id: String, // random
|
||||
userId: String,
|
||||
data: UserStat,
|
||||
from: DateTime,
|
||||
to: DateTime,
|
||||
computedAt: DateTime) {
|
||||
|
||||
def id = _id
|
||||
|
||||
def merge(o: Period) = copy(
|
||||
data = data merge o.data,
|
||||
from = from,
|
||||
|
@ -39,7 +41,7 @@ object Period {
|
|||
Computation(build(userId, pov), UserStat.emptyComputation aggregate pov)
|
||||
|
||||
def build(userId: String, pov: RichPov) = Period(
|
||||
id = ornicar.scalalib.Random nextStringUppercase 8,
|
||||
_id = ornicar.scalalib.Random nextStringUppercase 8,
|
||||
userId = userId,
|
||||
data = UserStat.empty,
|
||||
from = pov.pov.game.createdAt,
|
||||
|
|
Loading…
Reference in a new issue