diff --git a/app/uk/gov/hmrc/models/Application.scala b/app/uk/gov/hmrc/models/Application.scala index af7512abf..e424b7fa8 100644 --- a/app/uk/gov/hmrc/models/Application.scala +++ b/app/uk/gov/hmrc/models/Application.scala @@ -213,10 +213,13 @@ case class GrantWithoutConsent(scopes: Set[String]) extends OverrideFlag { val overrideType = OverrideType.GRANT_WITHOUT_TAXPAYER_CONSENT } -object OverrideType extends Enumeration { - val PERSIST_LOGIN_AFTER_GRANT, GRANT_WITHOUT_TAXPAYER_CONSENT, SUPPRESS_IV_FOR_AGENTS, SUPPRESS_IV_FOR_ORGANISATIONS = Value +case class SuppressIvForIndividuals() extends OverrideFlag { + val overrideType = OverrideType.SUPPRESS_IV_FOR_INDIVIDUALS } +object OverrideType extends Enumeration { + val PERSIST_LOGIN_AFTER_GRANT, GRANT_WITHOUT_TAXPAYER_CONSENT, SUPPRESS_IV_FOR_AGENTS, SUPPRESS_IV_FOR_ORGANISATIONS, SUPPRESS_IV_FOR_INDIVIDUALS = Value +} case class ApplicationWithUpliftRequest(id: UUID, name: String, diff --git a/app/uk/gov/hmrc/models/JsonFormatters.scala b/app/uk/gov/hmrc/models/JsonFormatters.scala index 76b32f347..b6a41dc96 100644 --- a/app/uk/gov/hmrc/models/JsonFormatters.scala +++ b/app/uk/gov/hmrc/models/JsonFormatters.scala @@ -44,12 +44,16 @@ 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() }) implicit val formatOverride = Union.from[OverrideFlag]("overrideType") .and[GrantWithoutConsent](GRANT_WITHOUT_TAXPAYER_CONSENT.toString) .and[PersistLogin](PERSIST_LOGIN_AFTER_GRANT.toString) .and[SuppressIvForAgents](SUPPRESS_IV_FOR_AGENTS.toString) .and[SuppressIvForOrganisations](SUPPRESS_IV_FOR_ORGANISATIONS.toString) + .and[SuppressIvForIndividuals](SUPPRESS_IV_FOR_INDIVIDUALS.toString) .format implicit val formatTotp = Json.format[TOTP] diff --git a/test/it/uk/gov/hmrc/component/ThirdPartyApplicationComponentSpec.scala b/test/it/uk/gov/hmrc/component/ThirdPartyApplicationComponentSpec.scala index 6533668dd..a85fdadc5 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"))) + SuppressIvForAgents(Set("scope")), SuppressIvForOrganisations(Set("scope")), SuppressIvForIndividuals()) val application = createApplication(access = standardAccess.copy(overrides = originalOverrides)) When("I request to update the application") val newApplicationName = "My Renamed Application"