diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2018-01-18 17:41:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 17:41:15 +0200 |
commit | 57b1a08669ddb3fb54cf79a2f42cb473e0ced3f5 (patch) | |
tree | 74c839223186e73c017b2e07a5cd43e9754498e5 /src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala | |
parent | 5bbb0bc66db5b49eb0e3f197be17798fb8093f2a (diff) | |
parent | 7d9c3a7a0de129eef06d5b2eac92aafec1229098 (diff) | |
download | rest-query-e7297561e0f84420465d1d67f1e14f34e67125f2.tar.gz rest-query-e7297561e0f84420465d1d67f1e14f34e67125f2.tar.bz2 rest-query-e7297561e0f84420465d1d67f1e14f34e67125f2.zip |
Merge pull request #73 from drivergroup/PDSUI-2432v0.15.1
PDSUI-2432 Removed *-Reply classes of TM
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala index 1ddf401..a999bf9 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/services/PatientLabelEvidenceService.scala @@ -5,62 +5,20 @@ import xyz.driver.entities.labels.Label import xyz.driver.entities.users.AuthUserInfo import xyz.driver.pdsuicommon.db._ import xyz.driver.pdsuicommon.domain.{LongId, UuidId} -import xyz.driver.pdsuicommon.error.DomainError +import xyz.driver.pdsuidomain.ListResponse import xyz.driver.pdsuidomain.entities._ import scala.concurrent.Future -object PatientLabelEvidenceService { - - trait DefaultAccessDeniedError { - def userMessage: String = "Access denied" - } - - trait DefaultPatientNotFoundError { - def userMessage: String = "Patient not found" - } - - sealed trait GetByIdReply - object GetByIdReply { - final case class Entity(x: PatientLabelEvidenceView) extends GetByIdReply - - type Error = GetByIdReply with DomainError - - final case class NotFoundError(userMessage: String) extends GetByIdReply with DomainError.NotFoundError - - final case class CommonError(userMessage: String) extends GetByIdReply with DomainError - - case object AuthorizationError - extends GetByIdReply with DomainError.AuthorizationError with DefaultAccessDeniedError - } - - sealed trait GetListReply - object GetListReply { - final case class EntityList(xs: Seq[PatientLabelEvidenceView], totalFound: Int) extends GetListReply - - type Error = GetListReply with DomainError - - case object PatientNotFoundError - extends GetListReply with DefaultPatientNotFoundError with DomainError.NotFoundError - - case object AuthorizationError - extends GetListReply with DomainError.AuthorizationError with DefaultAccessDeniedError - - final case class CommonError(userMessage: String) extends GetListReply with DomainError - } -} - trait PatientLabelEvidenceService { - import PatientLabelEvidenceService._ - def getById(patientId: UuidId[Patient], labelId: LongId[Label], id: LongId[PatientLabelEvidence])( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[GetByIdReply] + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[Option[PatientLabelEvidenceView]] def getAll(patientId: UuidId[Patient], labelId: LongId[Label], filter: SearchFilterExpr = SearchFilterExpr.Empty, sorting: Option[Sorting] = None, - pagination: Option[Pagination] = None)( - implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[GetListReply] + pagination: Pagination = Pagination.Default)( + implicit requestContext: AuthorizedServiceRequestContext[AuthUserInfo]): Future[ListResponse[PatientLabelEvidenceView]] } |