Skip to content

Commit

Permalink
Merge pull request #1025 from jmarin/api-model
Browse files Browse the repository at this point in the history
Refactor apiModel to api.model
  • Loading branch information
schbetsy authored Jun 30, 2017
2 parents 572897a + 47c196c commit f6e3152
Show file tree
Hide file tree
Showing 77 changed files with 127 additions and 127 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.SubmissionStatus
import spray.json.JsObject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import akka.http.scaladsl.model.Uri.Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.{ Filing, Submission }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.Filing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.Filing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

case class InstitutionWrapper(
id: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package hmda.apiModel.model
package hmda.api.model

case class Institutions(institutions: Set[InstitutionWrapper])
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.census.model.{ MsaSummary, Msa }
import hmda.persistence.PaginatedResource
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.lar.{ Applicant, Denial, Geography, Loan }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.persistence.WithPagination

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.SubmissionStatus
import hmda.model.parser.LarParsingError
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.SubmissionStatus

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.validation.engine.ValidationErrorsSummary

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package hmda.apiModel.model
package hmda.api.model

case class Status(status: String, service: String, time: String, host: String)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model
package hmda.api.model

import hmda.model.fi.Submission

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model.institutions.submissions
package hmda.api.model.institutions.submissions

case class ContactSummary(
name: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model.institutions.submissions
package hmda.api.model.institutions.submissions

case class FileSummary(
name: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model.institutions.submissions
package hmda.api.model.institutions.submissions

case class RespondentSummary(
name: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model.institutions.submissions
package hmda.api.model.institutions.submissions

case class SubmissionSummary(
respondent: RespondentSummary,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.model.public
package hmda.api.model.public

import hmda.model.institution.ExternalId

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hmda.apiModel.protocol
package hmda.api.protocol

import spray.json.DefaultJsonProtocol
import hmda.apiModel.model.Status
import hmda.api.model.Status

trait HmdaApiProtocol extends DefaultJsonProtocol {
implicit val statusFormat = jsonFormat4(Status.apply)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package hmda.apiModel.protocol.admin
package hmda.api.protocol.admin

import java.util.NoSuchElementException

import hmda.apiModel.protocol.processing.InstitutionProtocol
import hmda.api.protocol.processing.InstitutionProtocol
import hmda.model.institution.Agency._
import hmda.model.institution._
import spray.json._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hmda.apiModel.protocol.fi.lar
package hmda.api.protocol.fi.lar

import hmda.model.fi.lar._
import spray.json.DefaultJsonProtocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import akka.http.scaladsl.model.Uri.Path
import hmda.apiModel.model.ErrorResponse
import hmda.api.model.ErrorResponse
import spray.json.{ DefaultJsonProtocol, DeserializationException, JsString, JsValue, RootJsonFormat }

trait ApiErrorProtocol extends DefaultJsonProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.protocol.validation.ValidationResultProtocol
import hmda.apiModel.model._
import hmda.api.protocol.validation.ValidationResultProtocol
import hmda.api.model._
import spray.json._

trait EditResultsProtocol extends ValidationResultProtocol with SubmissionProtocol with PaginationProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ FilingDetail, Filings }
import hmda.api.model.{ FilingDetail, Filings }
import hmda.model.fi._
import spray.json.{ DefaultJsonProtocol, DeserializationException, JsNumber, JsObject, JsString, JsValue, RootJsonFormat }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ InstitutionDetail, InstitutionWrapper, Institutions }
import hmda.api.model.{ InstitutionDetail, InstitutionWrapper, Institutions }
import spray.json.DefaultJsonProtocol

trait InstitutionProtocol extends DefaultJsonProtocol with FilingProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ IrsResponse, PaginatedResponse }
import hmda.api.model.{ IrsResponse, PaginatedResponse }
import hmda.census.model.{ Msa, MsaSummary }
import spray.json._

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.PaginationLinks
import hmda.api.model.PaginationLinks
import spray.json.DefaultJsonProtocol

trait PaginationProtocol extends DefaultJsonProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ PaginatedResponse, ParsingErrorSummary }
import hmda.api.model.{ PaginatedResponse, ParsingErrorSummary }
import hmda.model.fi.SubmissionStatus
import hmda.model.parser.LarParsingError
import spray.json._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.model.fi._
import hmda.apiModel.model.institutions.submissions.{ ContactSummary, FileSummary, RespondentSummary, SubmissionSummary }
import hmda.apiModel.model.{ Receipt, Submissions }
import hmda.apiModel.protocol.validation.ValidationResultProtocol
import hmda.api.model.institutions.submissions.{ ContactSummary, FileSummary, RespondentSummary, SubmissionSummary }
import hmda.api.model.{ Receipt, Submissions }
import hmda.api.protocol.validation.ValidationResultProtocol
import spray.json.{ DeserializationException, JsNumber, JsObject, JsString, JsValue, RootJsonFormat }

trait SubmissionProtocol extends ValidationResultProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hmda.apiModel.protocol.public
package hmda.api.protocol.public

import hmda.apiModel.model.public.{ InstitutionSearch, InstitutionSearchResults }
import hmda.apiModel.protocol.admin.WriteInstitutionProtocol
import hmda.api.model.public.{ InstitutionSearch, InstitutionSearchResults }
import hmda.api.protocol.admin.WriteInstitutionProtocol
import hmda.model.institution.ExternalId

trait InstitutionSearchProtocol extends WriteInstitutionProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.validation
package hmda.api.protocol.validation

import hmda.apiModel.model.SingleValidationErrorResult
import hmda.api.model.SingleValidationErrorResult
import hmda.model.validation._
import hmda.validation.engine._
import spray.json.{ DefaultJsonProtocol, DeserializationException, JsString, JsValue, RootJsonFormat }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package hmda.apiModel.model
package hmda.api.model

import java.util.Calendar

import akka.http.scaladsl.model.Uri.Path
import hmda.apiModel.model.institutions.submissions.{ ContactSummary, FileSummary, RespondentSummary, SubmissionSummary }
import hmda.apiModel.model.public.InstitutionSearch
import hmda.api.model.institutions.submissions.{ ContactSummary, FileSummary, RespondentSummary, SubmissionSummary }
import hmda.api.model.public.InstitutionSearch
import org.scalacheck.Gen
import spray.json.{ JsObject, JsString }
import hmda.model.institution.InstitutionGenerators._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package hmda.apiModel.protocol
package hmda.api.protocol

import org.scalatest._
import prop._
import hmda.apiModel.model.{ ModelGenerators, Status }
import hmda.api.model.{ ModelGenerators, Status }
import spray.json._

class HmdaApiProtocolSpec extends PropSpec with PropertyChecks with MustMatchers with ModelGenerators with HmdaApiProtocol {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.admin
package hmda.api.protocol.admin

import hmda.apiModel.model.ModelGenerators
import hmda.api.model.ModelGenerators
import hmda.model.institution.InstitutionGenerators._
import hmda.model.institution.Institution
import org.scalatest.{ MustMatchers, PropSpec }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ ErrorResponse, ModelGenerators }
import hmda.api.model.{ ErrorResponse, ModelGenerators }
import org.scalatest.{ MustMatchers, PropSpec }
import org.scalatest.prop.PropertyChecks
import spray.json._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model._
import hmda.api.model._
import hmda.model.fi.ValidatedWithErrors
import org.scalatest.{ MustMatchers, PropSpec }
import org.scalatest.prop.PropertyChecks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ FilingDetail, ModelGenerators }
import hmda.api.model.{ FilingDetail, ModelGenerators }
import hmda.model.fi.Filing
import org.scalatest.prop.PropertyChecks
import org.scalatest.{ MustMatchers, PropSpec }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ InstitutionWrapper, ModelGenerators }
import hmda.api.model.{ InstitutionWrapper, ModelGenerators }
import hmda.model.institution.InstitutionGenerators._
import org.scalatest.prop.PropertyChecks
import org.scalatest.{ MustMatchers, PropSpec }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.IrsResponse
import hmda.api.model.IrsResponse
import hmda.census.model.{ Msa, MsaSummary }
import org.scalatest.{ MustMatchers, PropSpec }
import org.scalatest.prop.PropertyChecks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.{ ModelGenerators, ParsingErrorSummary }
import hmda.api.model.{ ModelGenerators, ParsingErrorSummary }
import hmda.model.fi.ParsedWithErrors
import hmda.model.parser.LarParsingError
import org.scalatest.{ MustMatchers, PropSpec }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hmda.apiModel.protocol.processing
package hmda.api.protocol.processing

import hmda.apiModel.model.ModelGenerators
import hmda.apiModel.model.institutions.submissions.SubmissionSummary
import hmda.api.model.ModelGenerators
import hmda.api.model.institutions.submissions.SubmissionSummary
import hmda.model.fi.Submission
import org.scalatest.{ MustMatchers, PropSpec }
import org.scalatest.prop.PropertyChecks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hmda.apiModel.protocol.public
package hmda.api.protocol.public

import hmda.apiModel.model.ModelGenerators
import hmda.apiModel.model.public.InstitutionSearch
import hmda.api.model.ModelGenerators
import hmda.api.model.public.InstitutionSearch
import org.scalatest.{ MustMatchers, PropSpec }
import org.scalatest.prop.PropertyChecks
import spray.json._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hmda.apiModel.protocol.validation
package hmda.api.protocol.validation

import hmda.apiModel.model.ModelGenerators
import hmda.api.model.ModelGenerators
import hmda.model.validation.ValidationErrorGenerators._
import hmda.model.validation._
import org.scalatest.{ MustMatchers, PropSpec }
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/scala/hmda/api/http/BaseHttpApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import akka.event.LoggingAdapter
import akka.http.scaladsl.marshalling.ToResponseMarshallable
import akka.http.scaladsl.server.Directives._
import akka.stream.ActorMaterializer
import hmda.apiModel.model.Status
import hmda.api.model.Status
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import hmda.apiModel.protocol.HmdaApiProtocol
import hmda.api.protocol.HmdaApiProtocol
import spray.json._

trait BaseHttpApi extends HmdaApiProtocol with HmdaCustomDirectives {
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/scala/hmda/api/http/HmdaCustomDirectives.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import akka.http.scaladsl.server.Directives._
import akka.event.LoggingAdapter
import akka.http.scaladsl.marshalling.ToResponseMarshallable
import akka.http.scaladsl.model.{ StatusCodes, Uri }
import hmda.apiModel.model.ErrorResponse
import hmda.apiModel.protocol.processing.ApiErrorProtocol
import hmda.api.model.ErrorResponse
import hmda.api.protocol.processing.ApiErrorProtocol
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._

trait HmdaCustomDirectives extends ApiErrorProtocol {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/scala/hmda/api/http/InstitutionsHttpApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import akka.stream.ActorMaterializer
import akka.util.Timeout
import hmda.api.http.institutions.submissions._
import hmda.api.http.institutions.{ FilingPaths, InstitutionPaths, UploadPaths }
import hmda.apiModel.protocol.processing.{ ApiErrorProtocol, InstitutionProtocol }
import hmda.api.protocol.processing.{ ApiErrorProtocol, InstitutionProtocol }

import scala.concurrent.ExecutionContext

Expand Down
Loading

0 comments on commit f6e3152

Please sign in to comment.