Skip to content

Commit

Permalink
Merge pull request #8 from hmrc/APSR-903
Browse files Browse the repository at this point in the history
APSR-903 adding scopes to suppress IV for individuals
  • Loading branch information
lburgos authored Nov 30, 2018
2 parents 626328e + ea11632 commit f982721
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/uk/gov/hmrc/models/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 1 addition & 3 deletions app/uk/gov/hmrc/models/JsonFormatters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f982721

Please sign in to comment.