Skip to content

Commit c9c68f1

Browse files
authored
[APB-10778] Shared code updates (#211)
* [APB-10778] Shared code updates * [APB-10778] Dependency update
1 parent b3baee8 commit c9c68f1

File tree

12 files changed

+176
-7
lines changed

12 files changed

+176
-7
lines changed

app/uk/gov/hmrc/agentregistrationfrontend/model/ApplicationForRiskingStatus.scala renamed to app/uk/gov/hmrc/agentregistration/shared/risking/ApplicationForRiskingStatus.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package uk.gov.hmrc.agentregistrationfrontend.model
17+
package uk.gov.hmrc.agentregistration.shared.risking
1818

1919
import play.api.libs.json.Format
2020
import uk.gov.hmrc.agentregistration.shared.util.JsonFormatsFactory
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2025 HM Revenue & Customs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package uk.gov.hmrc.agentregistration.shared.risking
18+
19+
import org.bson.types.ObjectId
20+
import play.api.libs.json.Format
21+
import play.api.mvc.PathBindable
22+
import uk.gov.hmrc.agentregistration.shared.util.JsonFormatsFactory
23+
import uk.gov.hmrc.agentregistration.shared.util.ValueClassBinder
24+
25+
import javax.inject.Singleton
26+
27+
/** Application Reference used by Minerva as a unique identifier for an Entity(application)
28+
*/
29+
final case class ApplicationReference(value: String)
30+
31+
object ApplicationReference:
32+
33+
given format: Format[ApplicationReference] = JsonFormatsFactory.makeValueClassFormat
34+
given pathBindable: PathBindable[ApplicationReference] = ValueClassBinder.valueClassBinder[ApplicationReference](_.value)
35+
36+
@Singleton
37+
class ApplicationReferenceGenerator:
38+
def nextApplicationReference(): ApplicationReference = ApplicationReference(ObjectId.get().toHexString)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2026 HM Revenue & Customs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package uk.gov.hmrc.agentregistration.shared.risking
18+
19+
import play.api.libs.json.Json
20+
import play.api.libs.json.OFormat
21+
22+
final case class ApplicationRiskingResponse(
23+
applicationReference: ApplicationReference,
24+
status: ApplicationForRiskingStatus,
25+
individuals: List[IndividualRiskingResponse],
26+
failures: Option[List[Failure]]
27+
)
28+
29+
object ApplicationRiskingResponse:
30+
31+
given OFormat[ApplicationRiskingResponse] = Json.format[ApplicationRiskingResponse]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2026 HM Revenue & Customs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package uk.gov.hmrc.agentregistration.shared.risking
18+
19+
import play.api.libs.json.Json
20+
import play.api.libs.json.OFormat
21+
22+
final case class Failure(
23+
reasonCode: String,
24+
reasonDescription: String,
25+
checkId: String,
26+
checkDescription: String,
27+
additionalInfo: Option[String]
28+
) {}
29+
30+
object Failure {
31+
implicit val format: OFormat[Failure] = Json.format[Failure]
32+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2026 HM Revenue & Customs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package uk.gov.hmrc.agentregistration.shared.risking
18+
19+
import play.api.libs.json.Json
20+
import play.api.libs.json.OFormat
21+
22+
final case class IndividualRiskingResponse(
23+
personReference: PersonReference,
24+
status: ApplicationForRiskingStatus,
25+
failures: Option[List[Failure]]
26+
)
27+
28+
object IndividualRiskingResponse:
29+
30+
given OFormat[IndividualRiskingResponse] = Json.format[IndividualRiskingResponse]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2025 HM Revenue & Customs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package uk.gov.hmrc.agentregistration.shared.risking
18+
19+
import org.bson.types.ObjectId
20+
import play.api.libs.json.Format
21+
import play.api.mvc.PathBindable
22+
import uk.gov.hmrc.agentregistration.shared.util.JsonFormatsFactory
23+
import uk.gov.hmrc.agentregistration.shared.util.ValueClassBinder
24+
25+
import javax.inject.Singleton
26+
27+
/** Person Reference used by Minerva as a unique identifier for an individual
28+
*/
29+
final case class PersonReference(value: String)
30+
31+
object PersonReference:
32+
33+
given format: Format[PersonReference] = JsonFormatsFactory.makeValueClassFormat
34+
given pathBindable: PathBindable[PersonReference] = ValueClassBinder.valueClassBinder[PersonReference](_.value)
35+
36+
@Singleton
37+
class PersonReferenceGenerator:
38+
def nextPersonReference(): PersonReference = PersonReference(ObjectId.get().toHexString)

app/uk/gov/hmrc/agentregistrationfrontend/connectors/AgentRegistrationRiskingConnector.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
package uk.gov.hmrc.agentregistrationfrontend.connectors
1818

1919
import uk.gov.hmrc.agentregistration.shared.AgentApplicationId
20+
import uk.gov.hmrc.agentregistration.shared.risking.ApplicationForRiskingStatus
2021
import uk.gov.hmrc.agentregistration.shared.risking.SubmitForRiskingRequest
2122
import uk.gov.hmrc.agentregistrationfrontend.config.AppConfig
22-
import uk.gov.hmrc.agentregistrationfrontend.model.ApplicationForRiskingStatus
2323
import uk.gov.hmrc.http.client.HttpClientV2
2424

2525
import javax.inject.Inject

app/uk/gov/hmrc/agentregistrationfrontend/controllers/applicant/AgentApplicationController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import play.api.mvc.Action
2020
import play.api.mvc.AnyContent
2121
import play.api.mvc.MessagesControllerComponents
2222
import uk.gov.hmrc.agentregistration.shared.AgentApplication
23+
import uk.gov.hmrc.agentregistration.shared.risking.ApplicationForRiskingStatus
2324
import uk.gov.hmrc.agentregistrationfrontend.action.applicant.ApplicantActions
2425
import uk.gov.hmrc.agentregistrationfrontend.config.AppConfig
25-
import uk.gov.hmrc.agentregistrationfrontend.model.ApplicationForRiskingStatus
2626
import uk.gov.hmrc.agentregistrationfrontend.services.applicant.AgentRegistrationRiskingService
2727
import uk.gov.hmrc.agentregistrationfrontend.util.DisplayDate.displayDateForLang
2828
import uk.gov.hmrc.agentregistrationfrontend.views.html.SimplePage

app/uk/gov/hmrc/agentregistrationfrontend/services/applicant/AgentRegistrationRiskingService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ package uk.gov.hmrc.agentregistrationfrontend.services.applicant
1818

1919
import play.api.mvc.RequestHeader
2020
import uk.gov.hmrc.agentregistration.shared.AgentApplicationId
21+
import uk.gov.hmrc.agentregistration.shared.risking.ApplicationForRiskingStatus
2122
import uk.gov.hmrc.agentregistration.shared.risking.SubmitForRiskingRequest
2223
import uk.gov.hmrc.agentregistrationfrontend.connectors.AgentRegistrationRiskingConnector
23-
import uk.gov.hmrc.agentregistrationfrontend.model.ApplicationForRiskingStatus
2424
import uk.gov.hmrc.agentregistrationfrontend.util.RequestAwareLogging
2525

2626
import javax.inject.Inject

project/AppDependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import sbt._
55

66
object AppDependencies {
77

8-
private val bootstrapVersion = "10.6.0"
8+
private val bootstrapVersion = "10.7.0"
99
private val hmrcMongoVersion = "2.12.0"
1010

1111
val compile: Seq[ModuleID] = Seq(

0 commit comments

Comments
 (0)