Skip to content

Instantly share code, notes, and snippets.

@kubukoz
Created May 16, 2018 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kubukoz/284ae33162564e802709ec913162c37b to your computer and use it in GitHub Desktop.
Save kubukoz/284ae33162564e802709ec913162c37b to your computer and use it in GitHub Desktop.
the description for this gist
val timestampV: ValidatedNel[PVError, OffsetDateTime] = event
.displayedAt
.valid
.ensure(PVError.invalidTimestamp)(_.isBefore(currentTime))
.toValidatedNel
(
uuid.valid,
pathValidation,
timestampV,
hostname.valid,
ipValidation
).mapN(PageView).traverse(repository.persist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment