Skip to content

Commit

Permalink
delete API
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii committed Sep 28, 2023
1 parent e93bc21 commit c653dfc
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 216 deletions.
4 changes: 0 additions & 4 deletions commercial/app/AppLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import commercial.CommercialLifecycle
import commercial.controllers.{CommercialControllers, HealthCheck}
import commercial.model.capi.CapiAgent
import commercial.model.feeds.{FeedsFetcher, FeedsParser}
import commercial.model.merchandise.books.{BestsellersAgent, BookFinder, MagentoService}
import commercial.model.merchandise.events.{LiveEventAgent, MasterclassAgent}
import commercial.model.merchandise.jobs.{Industries, JobsAgent}
import commercial.model.merchandise.travel.TravelOffersAgent
Expand Down Expand Up @@ -38,12 +37,9 @@ trait CommercialServices {
def pekkoActorSystem: PekkoActorSystem
implicit val executionContext: ExecutionContext

lazy val magentoService = wire[MagentoService]
lazy val capiHttpClient: HttpClient = wire[CapiHttpClient]
lazy val contentApiClient = wire[ContentApiClient]

lazy val bookFinder = wire[BookFinder]
lazy val bestsellersAgent = wire[BestsellersAgent]
lazy val liveEventAgent = wire[LiveEventAgent]
lazy val masterclassAgent = wire[MasterclassAgent]
lazy val travelOffersAgent = wire[TravelOffersAgent]
Expand Down
55 changes: 0 additions & 55 deletions commercial/app/controllers/BookOffersController.scala

This file was deleted.

4 changes: 0 additions & 4 deletions commercial/app/controllers/CommercialControllers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package commercial.controllers

import com.softwaremill.macwire._
import commercial.model.capi.CapiAgent
import commercial.model.merchandise.books.{BestsellersAgent, BookFinder}
import commercial.model.merchandise.events.{LiveEventAgent, MasterclassAgent}
import commercial.model.merchandise.jobs.JobsAgent
import commercial.model.merchandise.travel.TravelOffersAgent
Expand All @@ -12,16 +11,13 @@ import play.api.mvc.ControllerComponents

trait CommercialControllers {
def contentApiClient: ContentApiClient
def bestsellersAgent: BestsellersAgent
def liveEventAgent: LiveEventAgent
def bookFinder: BookFinder
def capiAgent: CapiAgent
def masterclassAgent: MasterclassAgent
def travelOffersAgent: TravelOffersAgent
def jobsAgent: JobsAgent
def controllerComponents: ControllerComponents
implicit def appContext: ApplicationContext
lazy val bookOffersController = wire[BookOffersController]
lazy val contentApiOffersController = wire[ContentApiOffersController]
lazy val creativeTestPage = wire[CreativeTestPage]
lazy val hostedContentController = wire[HostedContentController]
Expand Down
12 changes: 0 additions & 12 deletions commercial/app/controllers/Multi.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package commercial.controllers

import commercial.model.Segment
import commercial.model.merchandise.books.BestsellersAgent
import commercial.model.merchandise.events.MasterclassAgent
import commercial.model.merchandise.jobs.JobsAgent
import commercial.model.merchandise.travel.TravelOffersAgent
Expand All @@ -12,7 +11,6 @@ import play.api.libs.json.{JsArray, Json}
import play.api.mvc._

class Multi(
bestsellersAgent: BestsellersAgent,
masterclassAgent: MasterclassAgent,
travelOffersAgent: TravelOffersAgent,
jobsAgent: JobsAgent,
Expand All @@ -28,16 +26,6 @@ class Multi(
val components: Seq[(String, Option[String])] = offerTypes zip offerIds

components flatMap {

case ("Book", Some(bookId)) =>
bestsellersAgent.getSpecificBooks(Seq(bookId)) match {
case Nil => bestsellersAgent.bestsellersTargetedAt(segment)
case books => books
}

case ("Book", None) =>
bestsellersAgent.bestsellersTargetedAt(segment)

case ("Job", Some(jobId)) =>
jobsAgent.specificJobs(Seq(jobId))

Expand Down
15 changes: 1 addition & 14 deletions commercial/app/model/feeds/FeedParser.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package commercial.model.feeds

import commercial.model.merchandise.books.BestsellersAgent
import commercial.model.merchandise.events.{LiveEventAgent, MasterclassAgent}
import commercial.model.merchandise.jobs.JobsAgent
import commercial.model.merchandise.travel.TravelOffersAgent
Expand All @@ -17,7 +16,6 @@ sealed trait FeedParser[+T] {
}

class FeedsParser(
bestsellersAgent: BestsellersAgent,
liveEventAgent: LiveEventAgent,
masterclassAgent: MasterclassAgent,
travelOffersAgent: TravelOffersAgent,
Expand All @@ -35,17 +33,6 @@ class FeedsParser(
}
}

private val bestsellers: Option[FeedParser[Book]] = {
Configuration.commercial.magento.domain map { domain =>
new FeedParser[Book] {

val feedMetaData = BestsellersFeedMetaData(domain)

def parse(feedContent: => Option[String]) = bestsellersAgent.refresh(feedMetaData, feedContent)
}
}
}

private val masterclasses: Option[FeedParser[Masterclass]] = {
Configuration.commercial.masterclassesToken map { accessToken =>
new FeedParser[Masterclass] {
Expand Down Expand Up @@ -79,7 +66,7 @@ class FeedsParser(
}
}

val all = Seq(jobs, bestsellers, masterclasses, liveEvents, travelOffers).flatten
val all = Seq(jobs, masterclasses, liveEvents, travelOffers).flatten
}

case class ParsedFeed[+T](contents: Seq[T], parseDuration: Duration)
Expand Down
37 changes: 0 additions & 37 deletions commercial/app/model/merchandise/books/BestsellersAgent.scala

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions commercial/app/model/merchandise/books/MagentoException.scala

This file was deleted.

4 changes: 0 additions & 4 deletions commercial/conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ GET /commercial/travel/api/offers.json comm
# Job merchandising components
GET /commercial/jobs/api/jobs.json commercial.controllers.JobsController.getJobs

# Book merchandising components
GET /commercial/books/api/book.json commercial.controllers.BookOffersController.getBook
GET /commercial/books/api/books.json commercial.controllers.BookOffersController.getBooks

# Live events merchandising components
GET /commercial/api/liveevent.json commercial.controllers.LiveEventsController.getLiveEvent

Expand Down

0 comments on commit c653dfc

Please sign in to comment.