Skip to content

Commit a732c1b

Browse files
authored
APB-10944 use business type defaults for GRS stubbed CRN values (#213)
1 parent 120f869 commit a732c1b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

app/uk/gov/hmrc/agentregistrationfrontend/testonly/controllers/applicant/GrsStubController.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ extends FrontendController(mcc, actions):
306306
).contains(businessType)
307307
then
308308
Some(CompanyProfile(
309-
companyNumber = Crn("12345678"),
309+
companyNumber = companyNumberForBusinessType(businessType),
310310
companyName = if businessType === LimitedCompany then "Test Company Ltd" else "Test Partnership",
311311
dateOfIncorporation = Some(LocalDate.now().minusYears(10)),
312312
unsanitisedCHROAddress = Some(ChroAddress(
@@ -329,3 +329,12 @@ extends FrontendController(mcc, actions):
329329
then Some("AA1 1AA")
330330
else None
331331
))
332+
333+
// these defaults are to match any stubs we have used for Companies House lookups including officer searches
334+
private def companyNumberForBusinessType(businessType: BusinessType): Crn =
335+
businessType match
336+
case LimitedCompany => Crn("11111111")
337+
case LimitedLiabilityPartnership => Crn("22222222")
338+
case LimitedPartnership => Crn("33333333")
339+
case ScottishLimitedPartnership => Crn("44444444")
340+
case _ => Crn("12345678") // we don't have a matching CH stub for any other business type so return the original default

app/uk/gov/hmrc/agentregistrationfrontend/testonly/services/GrsStubService.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ class GrsStubService @Inject() (
7979
organisationType = "5T"
8080
))
8181
case _ => None,
82+
crn = businessType match
83+
case BusinessType.Partnership.LimitedLiabilityPartnership | BusinessType.LimitedCompany | BusinessType.Partnership.LimitedPartnership | BusinessType.Partnership.ScottishLimitedPartnership =>
84+
journeyData.companyProfile.map(_.companyNumber.value)
85+
case _ => None,
8286
addressDetails = AddressDetails(
8387
addressLine1 = "1 Test Street",
8488
addressLine2 = Some("Test Area"),

0 commit comments

Comments
 (0)