From 54b15dae509212f6661dc1f1bc4ca248cb487443 Mon Sep 17 00:00:00 2001 From: Kseniya Tomskikh Date: Fri, 20 Oct 2017 16:25:04 +0700 Subject: PDSUI-2336 Deleted api classes of play format, userhistory and message services --- .../formats/json/document/ApiProviderType.scala | 27 ---------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala') diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala deleted file mode 100644 index 9c0c216..0000000 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/document/ApiProviderType.scala +++ /dev/null @@ -1,27 +0,0 @@ -package xyz.driver.pdsuidomain.formats.json.document - -import play.api.libs.functional.syntax._ -import play.api.libs.json.{Format, JsPath} -import xyz.driver.pdsuidomain.entities.ProviderType - -final case class ApiProviderType(id: Long, name: String) { - - def toDomain: ProviderType = - ProviderType - .fromString(name) - .getOrElse(throw new IllegalArgumentException(s"Unknown provider type name $name")) - -} - -object ApiProviderType { - - implicit val format: Format[ApiProviderType] = ( - (JsPath \ "id").format[Long] and - (JsPath \ "name").format[String] - )(ApiProviderType.apply, unlift(ApiProviderType.unapply)) - - def fromDomain(providerType: ProviderType) = ApiProviderType( - id = providerType.id.id, - name = providerType.name - ) -} -- cgit v1.2.3