diff --git a/app/uk/gov/hmrc/models/Application.scala b/app/uk/gov/hmrc/models/Application.scala index e424b7fa8..3b98e64e2 100644 --- a/app/uk/gov/hmrc/models/Application.scala +++ b/app/uk/gov/hmrc/models/Application.scala @@ -213,7 +213,7 @@ case class GrantWithoutConsent(scopes: Set[String]) extends OverrideFlag { val overrideType = OverrideType.GRANT_WITHOUT_TAXPAYER_CONSENT } -case class SuppressIvForIndividuals() extends OverrideFlag { +case class SuppressIvForIndividuals(scopes: Set[String]) extends OverrideFlag { val overrideType = OverrideType.SUPPRESS_IV_FOR_INDIVIDUALS } diff --git a/app/uk/gov/hmrc/models/JsonFormatters.scala b/app/uk/gov/hmrc/models/JsonFormatters.scala index b6a41dc96..d7cd79f63 100644 --- a/app/uk/gov/hmrc/models/JsonFormatters.scala +++ b/app/uk/gov/hmrc/models/JsonFormatters.scala @@ -44,9 +44,7 @@ object JsonFormatters { Writes { _ => Json.obj() }) private implicit val formatSuppressIvForAgents = Json.format[SuppressIvForAgents] private implicit val formatSuppressIvForOrganisations = Json.format[SuppressIvForOrganisations] - private implicit val formatSuppressIvForIndividuals = Format[SuppressIvForIndividuals]( - Reads { _ => JsSuccess(SuppressIvForIndividuals()) }, - Writes { _ => Json.obj() }) + private implicit val formatSuppressIvForIndividuals = Json.format[SuppressIvForIndividuals] implicit val formatOverride = Union.from[OverrideFlag]("overrideType") .and[GrantWithoutConsent](GRANT_WITHOUT_TAXPAYER_CONSENT.toString) diff --git a/test/it/uk/gov/hmrc/component/ThirdPartyApplicationComponentSpec.scala b/test/it/uk/gov/hmrc/component/ThirdPartyApplicationComponentSpec.scala index a85fdadc5..65416a716 100644 --- a/test/it/uk/gov/hmrc/component/ThirdPartyApplicationComponentSpec.scala +++ b/test/it/uk/gov/hmrc/component/ThirdPartyApplicationComponentSpec.scala @@ -276,7 +276,7 @@ class ThirdPartyApplicationComponentSpec extends BaseFeatureSpec { Given("A third party application") val originalOverrides: Set[OverrideFlag] = Set(PersistLogin(), GrantWithoutConsent(Set("scope")), - SuppressIvForAgents(Set("scope")), SuppressIvForOrganisations(Set("scope")), SuppressIvForIndividuals()) + SuppressIvForAgents(Set("scope")), SuppressIvForOrganisations(Set("scope")), SuppressIvForIndividuals(Set("Scope"))) val application = createApplication(access = standardAccess.copy(overrides = originalOverrides)) When("I request to update the application") val newApplicationName = "My Renamed Application"