Skip to content

Commit

Permalink
Merge pull request #213 from hmrc/Jonathan/DLS-10889/remove-jsonx
Browse files Browse the repository at this point in the history
DLS-10889: Removed jsonx
  • Loading branch information
johno1985 authored Sep 10, 2024
2 parents 25f724a + 0d0358d commit e5fe0f1
Show file tree
Hide file tree
Showing 10 changed files with 860 additions and 1,222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@

package uk.gov.hmrc.helptosavestub.controllers

import java.util.UUID

import org.apache.pekko.actor.{ActorSystem, Scheduler}
import cats.instances.string._
import cats.syntax.eq._
import com.google.inject.Inject
import org.apache.pekko.actor.{ActorSystem, Scheduler}
import org.scalacheck.Gen
import play.api.libs.json.{Format, JsValue, Json}
import play.api.libs.json.{Format, Json}
import play.api.mvc.{Action, AnyContent, ControllerComponents, Result}
import uk.gov.hmrc.helptosavestub.controllers.DWPController.UCDetails
import uk.gov.hmrc.helptosavestub.util.Delays.DelayConfig
import uk.gov.hmrc.helptosavestub.util.{Delays, Logging}
import uk.gov.hmrc.play.bootstrap.backend.controller.BackendController

import java.util.UUID
import scala.concurrent.ExecutionContext

class DWPController @Inject()(actorSystem: ActorSystem, cc: ControllerComponents)(implicit ec: ExecutionContext)
Expand Down
1,189 changes: 1 addition & 1,188 deletions app/uk/gov/hmrc/helptosavestub/controllers/NSIGetAccountBehaviour.scala

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@

package uk.gov.hmrc.helptosavestub.controllers

import ai.x.play.json.Encoders.encoder

import java.time.{LocalDate, Month}
import ai.x.play.json.Jsonx
import play.api.libs.json.{Format, Json}
import uk.gov.hmrc.helptosavestub.models.{ErrorDetails, NSIErrorResponse}

import java.time.{LocalDate, Month}

object NSIGetTransactionsBehaviour {

val today: LocalDate = LocalDate.now()
Expand Down Expand Up @@ -115,10 +113,8 @@ object NSIGetTransactionsBehaviour {
}

object NSIGetTransactionsByNinoResponse {

implicit val format: Format[NSIGetTransactionsByNinoResponse] =
Jsonx.formatCaseClass[NSIGetTransactionsByNinoResponse]

Json.format[NSIGetTransactionsByNinoResponse]

def bethTransaction: List[Transaction] = List[Transaction](
Transaction(
Expand Down Expand Up @@ -162,6 +158,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 1),
LocalDate.of(2018, 3, 1))
)

def peteTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -220,6 +217,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 2),
LocalDate.of(2018, 3, 2))
)

def lauraTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -302,6 +300,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 2, 17),
LocalDate.of(2018, 2, 17))
)

def tonyTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -352,7 +351,9 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 3),
LocalDate.of(2018, 3, 3))
)

val monikaTransaction: List[Transaction] = List.empty

def happyTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -739,6 +740,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 2, 1),
LocalDate.of(2018, 2, 1))
)

def takenTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -941,6 +943,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2016, 3, 2),
LocalDate.of(2016, 3, 2))
)

def spencerTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1135,6 +1138,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 2),
LocalDate.of(2018, 3, 2))
)

def alexTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1441,6 +1445,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 2),
LocalDate.of(2018, 3, 2))
)

def closedAccountTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1483,6 +1488,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 1),
LocalDate.of(2018, 3, 1))
)

def accountBlockedTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1525,6 +1531,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 1),
LocalDate.of(2018, 3, 1))
)

def clientBlockedTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1567,6 +1574,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 1),
LocalDate.of(2018, 3, 1))
)

def annaTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1737,7 +1745,9 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 2),
LocalDate.of(2018, 3, 2))
)

def closedAccount2Transaction: List[Transaction] = List.empty

def closedAccount3Transaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand All @@ -1756,6 +1766,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 1, 1),
LocalDate.of(2018, 1, 1))
)

def closedAccount4Transaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1790,6 +1801,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 1, 1),
LocalDate.of(2018, 1, 1))
)

def accountUnspecifiedBlockedTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1832,6 +1844,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(2018, 3, 1),
LocalDate.of(2018, 3, 1))
)

def tomTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1879,6 +1892,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(xMonthsAgoYear(0), xMonthsAgoMonth(0), 1)
)
)

def angelaTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -1944,6 +1958,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(xMonthsAgoYear(0), xMonthsAgoMonth(0), 2)
)
)

def ivoTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -2036,6 +2051,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(xMonthsAgoYear(1), xMonthsAgoMonth(1), 17)
)
)

def arsenyTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -2092,6 +2108,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(xMonthsAgoYear(0), xMonthsAgoMonth(0), 3)
)
)

def sunanTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -2526,6 +2543,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(xMonthsAgoYear(1), xMonthsAgoMonth(1), 1)
)
)

def ranaTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -2753,6 +2771,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(xMonthsAgoYear(24), xMonthsAgoMonth(24), 2)
)
)

def marshalTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down Expand Up @@ -2971,6 +2990,7 @@ object NSIGetTransactionsBehaviour {
LocalDate.of(xMonthsAgoYear(0), xMonthsAgoMonth(0), 2)
)
)

def dennisTransaction: List[Transaction] = List[Transaction](
Transaction(
"1",
Expand Down
28 changes: 28 additions & 0 deletions app/uk/gov/hmrc/helptosavestub/models/CurrentInvestmentMonth.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2024 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package uk.gov.hmrc.helptosavestub.models

import play.api.libs.json.{Format, Json}

import java.time.LocalDate

case class CurrentInvestmentMonth(investmentRemaining: String, investmentLimit: String, endDate: LocalDate)

object CurrentInvestmentMonth {
//noinspection ScalaStyle
implicit val format: Format[CurrentInvestmentMonth] = Json.format[CurrentInvestmentMonth]
}
Loading

0 comments on commit e5fe0f1

Please sign in to comment.