aboutsummaryrefslogblamecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/services/KeywordService.scala
blob: 8824c414e881327f13d8f2351679a17ae1b2f1c0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                           
                                                                                             








                                               

                                                                                     
 
package xyz.driver.pdsuidomain.services

import xyz.driver.pdsuicommon.auth.AuthenticatedRequestContext
import xyz.driver.pdsuicommon.db.Sorting
import xyz.driver.pdsuicommon.error.DomainError
import xyz.driver.pdsuidomain.entities.KeywordWithLabels

import scala.concurrent.Future

object KeywordService {

  sealed trait GetListReply
  object GetListReply {
    case class EntityList(xs: Seq[KeywordWithLabels], totalFound: Int) extends GetListReply

    case object AuthorizationError extends GetListReply with DomainError.AuthorizationError {
      def userMessage: String = "Access denied"
    }
  }
}

trait KeywordService {

  import KeywordService._

  def getAll(sorting: Option[Sorting] = None)(
          implicit requestContext: AuthenticatedRequestContext): Future[GetListReply]
}