diff --git a/Frontend/CO.CDP.OrganisationApp.Tests/LocalizationTests.cs b/Frontend/CO.CDP.OrganisationApp.Tests/LocalizationTests.cs index cd684162f..f632de927 100644 --- a/Frontend/CO.CDP.OrganisationApp.Tests/LocalizationTests.cs +++ b/Frontend/CO.CDP.OrganisationApp.Tests/LocalizationTests.cs @@ -82,7 +82,7 @@ public async Task OrganisationNamePage_DisplaysCorrectly_WhenLanguageIsDefaulted responseBody.Should().NotBeNull(); response.StatusCode.Should().Be(HttpStatusCode.OK); - responseBody.Should().Contain("Enter the organisation's name"); + responseBody.Should().Contain("Enter your organisation's name"); } [Fact] @@ -102,7 +102,7 @@ public async Task OrganisationNamePage_DisplaysCorrectly_WhenLanguageIsEnglish() responseBody.Should().NotBeNull(); response.StatusCode.Should().Be(HttpStatusCode.OK); - responseBody.Should().Contain("Enter the organisation's name"); + responseBody.Should().Contain("Enter your organisation's name"); } [Fact] @@ -142,7 +142,7 @@ public async Task OrganisationNamePage_DisplaysErrorMessageCorrectly_WhenLanguag responseBody.Should().NotBeNull(); response.StatusCode.Should().Be(HttpStatusCode.OK); - responseBody.Should().Contain("Enter the organisation's name"); + responseBody.Should().Contain("Enter your organisation's name"); } [Fact] diff --git a/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml b/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml index 1c5e56071..dceb7b72f 100644 --- a/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml +++ b/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml @@ -1,5 +1,7 @@ @page "/organisation/{id}/name" @model CO.CDP.OrganisationApp.Pages.Organisation.OrganisationNameModel +@using CO.CDP.OrganisationApp.WebApiClients +@using CO.CDP.Localization @{ ViewData["Title"] = Html.DisplayNameFor(m => m.OrganisationName); @@ -24,7 +26,16 @@ -
As registered with Companies House if incorporated, or the trading name of the company
+
+ @if (Model.Organisation != null && (Model.Organisation.IsBuyer() || Model.Organisation.IsPendingBuyer())) + { + @Html.Raw(StaticTextResource.Organisation_EnterOrganisationName_Buyer_Hint) + } + else + { + @StaticTextResource.Organisation_EnterOrganisationName_Supplier_Hint + } +
@if (organisationNameHasError) diff --git a/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml.cs b/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml.cs index 9c18565f1..aed179e89 100644 --- a/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml.cs +++ b/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationName.cshtml.cs @@ -20,15 +20,16 @@ public class OrganisationNameModel(IOrganisationClient organisationClient) : Pag [BindProperty(SupportsGet = true)] public Guid Id { get; set; } + public OrganisationWebApiClient.Organisation? Organisation; public async Task OnGet() { try { - var organisation = await organisationClient.GetOrganisationAsync(Id); - if (organisation == null) return Redirect("/page-not-found"); + Organisation = await organisationClient.GetOrganisationAsync(Id); + if (Organisation == null) return Redirect("/page-not-found"); - OrganisationName = organisation.Name; + OrganisationName = Organisation.Name; return Page(); } @@ -45,9 +46,9 @@ public async Task OnPost() return Page(); } - var organisation = await organisationClient.GetOrganisationAsync(Id); + Organisation = await organisationClient.GetOrganisationAsync(Id); - if (organisation == null) + if (Organisation == null) { return Redirect("/page-not-found"); } diff --git a/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationRegisteredAddress.cshtml.cs b/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationRegisteredAddress.cshtml.cs index 876d4f421..22b717ec2 100644 --- a/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationRegisteredAddress.cshtml.cs +++ b/Frontend/CO.CDP.OrganisationApp/Pages/Organisation/OrganisationRegisteredAddress.cshtml.cs @@ -1,4 +1,5 @@ using CO.CDP.OrganisationApp.Constants; +using CO.CDP.OrganisationApp.Models; using CO.CDP.OrganisationApp.Pages.Shared; using CO.CDP.OrganisationApp.WebApiClients; using Microsoft.AspNetCore.Authorization; @@ -24,15 +25,17 @@ public class OrganisationRegisteredAddressModel(OrganisationWebApiClient.IOrgani [BindProperty] public bool? RedirectToOverview { get; set; } + public OrganisationWebApiClient.Organisation? Organisation; public async Task OnGet() { - SetupAddress(true); + Organisation = await organisationClient.GetOrganisationAsync(Id); + + if (Organisation == null) return Redirect("/page-not-found"); - var organisation = await organisationClient.GetOrganisationAsync(Id); - if (organisation == null) return Redirect("/page-not-found"); + SetupAddress(true); - var regsiteredAddress = organisation.Addresses.FirstOrDefault(x => x.Type == AddressType.Registered); + var regsiteredAddress = Organisation.Addresses.FirstOrDefault(x => x.Type == AddressType.Registered); if (regsiteredAddress == null) return Redirect("/page-not-found"); @@ -57,8 +60,6 @@ public async Task OnPost() } try { - var organisation = await organisationClient.GetOrganisationAsync(Id); - ICollection addresses = [ new OrganisationWebApiClient.OrganisationAddress( streetAddress: Address.AddressLine1, @@ -91,11 +92,24 @@ private void SetupAddress(bool reset = false) { if (reset) Address = new AddressPartialModel { UkOrNonUk = UkOrNonUk }; - Address.Heading = Address.IsNonUkAddress ? - "Enter your organisation's registered non-UK address" : "Enter your organisation's registered address"; - - Address.AddressHint = Address.IsNonUkAddress ? - "The address recorded on public records or within the public domain" : "The address registered with Companies House, or the principal address the business conducts its activities. For example, a head office."; + if (Address.IsNonUkAddress) + { + Address.Heading = "Enter your organisation's registered non-UK address"; + Address.AddressHint = "The address recorded on public records or within the public domain."; + } + else + { + if (Organisation != null && (Organisation.IsBuyer() || Organisation.IsPendingBuyer())) + { + Address.Heading = "Enter your organisation's address"; + Address.AddressHint = "The principal address the organisation conducts its activities. For example, a head office."; + } + else + { + Address.Heading = "Enter your organisation's registered address"; + Address.AddressHint = "The address registered with Companies House, or the principal address the business conducts its activities. For example, a head office."; + } + } Address.NonUkAddressLink = $"/organisation/{Id}/address/non-uk{(RedirectToOverview == true ? "?frm-overview" : "")}"; } diff --git a/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationName.cshtml b/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationName.cshtml index fa7ee0abf..280fdc9aa 100644 --- a/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationName.cshtml +++ b/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationName.cshtml @@ -44,7 +44,16 @@ -
@StaticTextResource.OrganisationRegistration_EnterOrganisationName_Hint
+
+ @if (Model.RegistrationDetails.OrganisationType == Constants.OrganisationType.Buyer) + { + @Html.Raw(StaticTextResource.Organisation_EnterOrganisationName_Buyer_Hint) + } + else + { + @StaticTextResource.Organisation_EnterOrganisationName_Supplier_Hint + } +
@if (organisationNameHasError) diff --git a/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationRegisteredAddress.cshtml.cs b/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationRegisteredAddress.cshtml.cs index 22c2178bf..a6db68bb6 100644 --- a/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationRegisteredAddress.cshtml.cs +++ b/Frontend/CO.CDP.OrganisationApp/Pages/Registration/OrganisationRegisteredAddress.cshtml.cs @@ -85,11 +85,22 @@ private void SetupAddress(bool reset = false) { if (reset) Address = new AddressPartialModel { UkOrNonUk = UkOrNonUk }; - Address.Heading = Address.IsNonUkAddress ? - "Enter the organisation's registered non-UK address" : "Enter the organisation's registered address"; - - Address.AddressHint = Address.IsNonUkAddress ? - "The address recorded on public records or within the public domain" : "The address registered with Companies House, or the principal address the business conducts its activities. For example, a head office."; + if (Address.IsNonUkAddress) + { + Address.Heading = "Enter your organisation's registered non-UK address"; + Address.AddressHint = "The address recorded on public records or within the public domain."; + } else + { + if(RegistrationDetails.OrganisationType == OrganisationType.Buyer) + { + Address.Heading = "Enter your organisation's address"; + Address.AddressHint = "The principal address the organisation conducts its activities. For example, a head office."; + } else + { + Address.Heading = "Enter your organisation's registered address"; + Address.AddressHint = "The address registered with Companies House, or the principal address the business conducts its activities. For example, a head office."; + } + } Address.NonUkAddressLink = $"/registration/organisation-registered-address/non-uk{(RedirectToSummary == true ? "?frm-summary" : "")}"; } diff --git a/Services/CO.CDP.Localization/StaticTextResource.cy.resx b/Services/CO.CDP.Localization/StaticTextResource.cy.resx index 535cb7dad..c730ff157 100644 --- a/Services/CO.CDP.Localization/StaticTextResource.cy.resx +++ b/Services/CO.CDP.Localization/StaticTextResource.cy.resx @@ -1,17 +1,17 @@  - @@ -138,7 +138,7 @@ Rhowch enw’r sefydliad - + Fel y'i cofrestrwyd â Thŷ'r Cwmnïau os yw'n gorfforedig, neu enw masnachu'r cwmni. diff --git a/Services/CO.CDP.Localization/StaticTextResource.resx b/Services/CO.CDP.Localization/StaticTextResource.resx index fe40a370a..c6771064d 100644 --- a/Services/CO.CDP.Localization/StaticTextResource.resx +++ b/Services/CO.CDP.Localization/StaticTextResource.resx @@ -1,17 +1,17 @@  - @@ -160,10 +160,13 @@ {0} records - Enter the organisation's name + Enter your organisation's name + + + If you’re a department, agency or public body on the <a class="govuk-link" target="_blank" href="https://www.gov.uk/government/organisations">GOV.UK organisations list (opens in a new tab)</a>, use the exact name shown. If not, use your full official name. For example, HM Revenue & Customs not HMRC. - - As registered on Companies House if incorporated, or the trading name of the company + + As registered on Companies House if incorporated, or the trading name of the company. Error @@ -171,4 +174,4 @@ Continue - + \ No newline at end of file