aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-06-30 12:29:54 -0700
committervlad <vlad@driver.xyz>2017-06-30 12:29:54 -0700
commita997aa6539d1f0af4ab4fc395ff2033335da312a (patch)
tree4f24529cd0beed94368caafdc0bdbb5677184851 /src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala
parent5832f63b84d7388441d1200f2442dc1e9de0225c (diff)
downloadrest-query-a997aa6539d1f0af4ab4fc395ff2033335da312a.tar.gz
rest-query-a997aa6539d1f0af4ab4fc395ff2033335da312a.tar.bz2
rest-query-a997aa6539d1f0af4ab4fc395ff2033335da312a.zip
Latest PDS UI utils
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala
index d65c9f9..a4b380f 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/services/InterventionService.scala
@@ -21,11 +21,10 @@ object InterventionService {
sealed trait GetListReply
object GetListReply {
- case class EntityList(xs: Seq[InterventionWithArms], totalFound: Int)
- extends GetListReply
+ case class EntityList(xs: Seq[InterventionWithArms], totalFound: Int) extends GetListReply
case object AuthorizationError
- extends GetListReply with DomainError.AuthorizationError with DefaultAccessDeniedError
+ extends GetListReply with DomainError.AuthorizationError with DefaultAccessDeniedError
}
sealed trait GetByIdReply
@@ -34,18 +33,17 @@ object InterventionService {
type Error = GetByIdReply with DomainError
- case object NotFoundError
- extends GetByIdReply with DefaultNotFoundError with DomainError.NotFoundError
+ case object NotFoundError extends GetByIdReply with DefaultNotFoundError with DomainError.NotFoundError
case object AuthorizationError
- extends GetByIdReply with DomainError.AuthorizationError with DefaultAccessDeniedError
+ extends GetByIdReply with DomainError.AuthorizationError with DefaultAccessDeniedError
case class CommonError(userMessage: String)(implicit requestContext: AuthenticatedRequestContext)
- extends GetByIdReply with DomainError
+ extends GetByIdReply with DomainError
implicit def toPhiString(reply: GetByIdReply): PhiString = reply match {
case x: DomainError => phi"GetByIdReply.Error($x)"
- case Entity(x) => phi"GetByIdReply.Entity($x)"
+ case Entity(x) => phi"GetByIdReply.Entity($x)"
}
}
@@ -55,14 +53,12 @@ object InterventionService {
case class Updated(updated: InterventionWithArms) extends UpdateReply
- case object NotFoundError
- extends UpdateReply with DefaultNotFoundError with DomainError.NotFoundError
+ case object NotFoundError extends UpdateReply with DefaultNotFoundError with DomainError.NotFoundError
case object AuthorizationError
- extends UpdateReply with DefaultAccessDeniedError with DomainError.AuthorizationError
+ extends UpdateReply with DefaultAccessDeniedError with DomainError.AuthorizationError
- case class CommonError(userMessage: String)
- extends UpdateReply with DomainError
+ case class CommonError(userMessage: String) extends UpdateReply with DomainError
}
}
@@ -73,13 +69,11 @@ trait InterventionService {
def getAll(filter: SearchFilterExpr = SearchFilterExpr.Empty,
sorting: Option[Sorting] = None,
- pagination: Option[Pagination] = None)
- (implicit requestContext: AuthenticatedRequestContext): Future[GetListReply]
+ pagination: Option[Pagination] = None)(
+ implicit requestContext: AuthenticatedRequestContext): Future[GetListReply]
- def getById(id: LongId[Intervention])
- (implicit requestContext: AuthenticatedRequestContext): Future[GetByIdReply]
+ def getById(id: LongId[Intervention])(implicit requestContext: AuthenticatedRequestContext): Future[GetByIdReply]
- def update(origIntervention: InterventionWithArms,
- draftIntervention: InterventionWithArms)
- (implicit requestContext: AuthenticatedRequestContext): Future[UpdateReply]
+ def update(origIntervention: InterventionWithArms, draftIntervention: InterventionWithArms)(
+ implicit requestContext: AuthenticatedRequestContext): Future[UpdateReply]
}