Skip to content

Commit

Permalink
remove warnings, enable some old traits
Browse files Browse the repository at this point in the history
  • Loading branch information
RawToast committed Nov 18, 2023
1 parent 6e09350 commit 644f33d
Show file tree
Hide file tree
Showing 20 changed files with 490 additions and 476 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/hygiene/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package hygiene
// import org.http4s.server.blaze.BlazeBuilder
// import org.http4s.util.StreamApp

object Server

// object Server extends StreamApp {

// // Construct services / inject here
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/hygiene/client/JsonClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ package hygiene.client
// import org.http4s.dsl._
// import org.log4s._

trait Client[F[_], R]:
def fetch(path: String): F[R]

// class JsonClient(client: Client, baseUri:Uri){

// lazy val logger: Logger = getLogger
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/hygiene/domain/Authority.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package hygiene.domain

// case class Authority(name: String, id: Int, establishments: Int)
case class Authority(name: String, id: Int, establishments: Int)
2 changes: 1 addition & 1 deletion src/main/scala/hygiene/middleware/CachingMiddleware.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package hygiene.middleware
// import org.log4s._
// import org.http4s.dsl._

// object CachingMiddleware {
object CachingMiddleware

// lazy val logger = getLogger

Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/hygiene/routes/AuthorityController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package hygiene.routes
// import play.twirl.api.Html
// import org.http4s.twirl._

object HereToShutupTheCompiler

// class AuthorityController(establishmentService: HygieneRatings, authorityService: ListAuthorities) {
// val endpoints: HttpService = HttpService {

Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/hygiene/services/AuthorityService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package hygiene.services

// import fs2.Task
// import hygiene.client.JsonClient
// import hygiene.domain.Authority
import hygiene.domain.Authority
// import hygiene.services.util.AuthorityParser
// import io.circe.Json
// import org.log4s.{Logger, getLogger}

// trait ListAuthorities {
// def authorities: Task[Seq[Authority]]
// }
trait ListAuthorities[F[_]]:
def authorities: F[Seq[Authority]]

// class AuthorityService(client: JsonClient, authorityParser: AuthorityParser[Json])
// extends ListAuthorities {
Expand Down
5 changes: 2 additions & 3 deletions src/main/scala/hygiene/services/EstablishmentService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ package hygiene.services
// import io.circe.Json
// import org.log4s.{Logger, getLogger}

// trait HygieneRatings {
// def hygieneRatings(id: Int, establishments: Int): Task[Map[String, Double]]
// }
trait HygieneRatings[F[_]]:
def hygieneRatings(id: Int, establishments: Int): F[Map[String, Double]]

// class EstablishmentService(client: JsonClient,
// establishmentParser: EstablishmentParser[Json],
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/hygiene/services/util/AuthorityParser.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hygiene.services.util

// import hygiene.domain.Authority
import hygiene.domain.Authority
// import io.circe.Json
// import io.circe.optics.JsonPath._
// import monocle.{Optional, Traversal}
Expand Down Expand Up @@ -28,6 +28,6 @@ package hygiene.services.util
// }
// }

// trait AuthorityParser[T] {
// def summariseAuthorites(authData: T): Seq[Authority]
// }
trait AuthorityParser[T] {
def summariseAuthorites(authData: T): Seq[Authority]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package hygiene.services.util

// import io.circe.Json

// trait EstablishmentParser[T] {
// def establishmentRating(singleEstablishment: T): Option[String]
trait EstablishmentParser[T]:
def establishmentRating(singleEstablishment: T): Option[String]

// def countEstablishmentRatings(validEstablishmentsJson: T): Map[String, Int]
// }
def countEstablishmentRatings(validEstablishmentsJson: T): Map[String, Int]

// object JsonEstablishmentParser extends EstablishmentParser[Json] {

Expand Down
5 changes: 2 additions & 3 deletions src/main/scala/hygiene/services/util/RatingsFormatter.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package hygiene.services.util

// trait RatingsFormatter {
// def summariseRatings(ratings: Map[String, Int]): Map[String, Double]
// }
trait RatingsFormatter:
def summariseRatings(ratings: Map[String, Int]): Map[String, Double]

// object UniversalRatingsFormatter extends RatingsFormatter {
// /**
Expand Down
Loading

0 comments on commit 644f33d

Please sign in to comment.