From f9ac0adf5c3bcfcde03bd3ea2bc2471b0d0f99fe Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Wed, 5 Jul 2017 19:02:13 -0700 Subject: Implement REST services for trial curation --- .../xyz/driver/pdsuidomain/services/PatientService.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala') diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala index 4619011..ce70934 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientService.scala @@ -23,7 +23,8 @@ object PatientService { sealed trait GetListReply object GetListReply { - case class EntityList(xs: Seq[Patient], totalFound: Int, lastUpdate: Option[LocalDateTime]) extends GetListReply + final case class EntityList(xs: Seq[Patient], totalFound: Int, lastUpdate: Option[LocalDateTime]) + extends GetListReply case object AuthorizationError extends GetListReply with DomainError.AuthorizationError with DefaultAccessDeniedError @@ -31,7 +32,7 @@ object PatientService { sealed trait GetByIdReply object GetByIdReply { - case class Entity(x: Patient) extends GetByIdReply + final case class Entity(x: Patient) extends GetByIdReply type Error = GetByIdReply with DomainError @@ -40,7 +41,7 @@ object PatientService { case object AuthorizationError extends GetByIdReply with DomainError.AuthorizationError with DefaultAccessDeniedError - case class CommonError(userMessage: String)(implicit requestContext: AuthenticatedRequestContext) + final case class CommonError(userMessage: String)(implicit requestContext: AuthenticatedRequestContext) extends GetByIdReply with DomainError implicit def toPhiString(reply: GetByIdReply): PhiString = reply match { @@ -53,14 +54,14 @@ object PatientService { object UpdateReply { type Error = UpdateReply with DomainError - case class Updated(updated: Patient) extends UpdateReply + final case class Updated(updated: Patient) extends UpdateReply case object NotFoundError extends UpdateReply with DefaultNotFoundError with DomainError.NotFoundError case object AuthorizationError extends UpdateReply with DefaultAccessDeniedError with DomainError.AuthorizationError - case class CommonError(userMessage: String) extends UpdateReply with DomainError + final case class CommonError(userMessage: String) extends UpdateReply with DomainError implicit def toPhiString(reply: UpdateReply): PhiString = reply match { case Updated(x) => phi"Updated($x)" -- cgit v1.2.3