Repository: DFE-Digital/buy-for-your-school
Pull request #2109: [Route Path Update] Updated new route paths
Author: login: edwin-jebaraj
Created: 2025-05-02T15:06:35Z | Merged: 2025-05-02T15:58:09Z

<!--
  1. New dependency? Is there an accompanying ADR?
  2. New route? Is the code covered by functional (unit) and feature (browser) tests?
  3. New method/class? Have you documented your code using valid Yard syntax?
  4. Do you need to update the CHANGELOG and add a PR ref?
-->

## Changes in this PR

[f5c9e37](https://github.com/DFE-Digital/buy-for-your-school/commit/f5c9e378251b46f9594795791d7501dccfdeb955)  Updated new route paths for the existing energy module


<!--
  Succinct list of changes explaining what has changed and why.
-->

## Screen-shots or screen-capture of UI changes

<!--
  # Screen-shots
  - Include full page from header to footer, cropping the sides to fit.

  # Screen-captures
  - Record only the browser window
  - Don't full screen the browser window (to avoid large files)
  - Break into separate videos if there are several journeys being presented
  - Mac guide: https://support.apple.com/en-gb/HT208721
  - Windows guide: https://support.microsoft.com/en-us/windows/5328cd25-9046-4472-8a14-c485f138802c
-->



Diff:
diff --git a/app/controllers/energy/application_controller.rb b/app/controllers/energy/application_controller.rb
index 07b8276079..4770a71717 100644
--- a/app/controllers/energy/application_controller.rb
+++ b/app/controllers/energy/application_controller.rb
@@ -13,12 +13,12 @@ def check_flag
       render "errors/not_found", status: :not_found unless Flipper.enabled?(:energy)
     end
 
-    def organisation_details(id = params[:onboarding_case_id])
-      @onboarding_organisation = Energy::OnboardingCaseOrganisation.find_by(energy_onboarding_case_id: id)
-      onboardable_type = @onboarding_organisation.onboardable_type
+    def organisation_details(id = params[:case_id])
+      @onboarding_case_organisation = Energy::OnboardingCaseOrganisation.find_by(energy_onboarding_case_id: id)
+      onboardable_type = @onboarding_case_organisation.onboardable_type
 
       if ALLOWED_CLASSES.include?(onboardable_type)
-        @organisation_detail = onboardable_type.safe_constantize.find(@onboarding_organisation.onboardable_id)
+        @organisation_detail = onboardable_type.safe_constantize.find(@onboarding_case_organisation.onboardable_id)
         user_has_access_to_organisation?
       else
         render("errors/not_found", status: :not_found)
diff --git a/app/controllers/energy/authorisation_controller.rb b/app/controllers/energy/authorisation_controller.rb
index ada847f295..3c9d34df2d 100644
--- a/app/controllers/energy/authorisation_controller.rb
+++ b/app/controllers/energy/authorisation_controller.rb
@@ -9,7 +9,7 @@ def update
       return unless params[:type] == "single"
 
       onboarding_case = existing_onboarding_case? || create_onboarding_case
-      redirect_to energy_switch_energy_path(id: onboarding_case.energy_onboarding_case_id)
+      redirect_to energy_case_switch_energy_path(case_id: onboarding_case.energy_onboarding_case_id)
     end
 
   private
diff --git a/app/controllers/energy/gas_meter_controller.rb b/app/controllers/energy/gas_meter_controller.rb
new file mode 100644
index 0000000000..39c6ce1551
--- /dev/null
+++ b/app/controllers/energy/gas_meter_controller.rb
@@ -0,0 +1,60 @@
+class Energy::GasMeterController < Energy::ApplicationController
+  before_action :organisation_details
+  before_action :set_gas_meter_detail, only: %i[edit update destroy]
+
+  before_action only: %i[new index] do
+    @back_url = energy_case_switch_energy_path
+  end
+
+  before_action only: %i[edit destroy] do
+    @back_url = energy_case_org_gas_meter_index_path
+  end
+
+  def index
+    @gas_meter_details = @onboarding_case_organisation.gas_meters.all
+  end
+
+  def new
+    @gas_meter_detail = @onboarding_case_organisation.gas_meters.new
+  end
+
+  def edit; end
+
+  def create
+    @gas_meter_detail = @onboarding_case_organisation.gas_meters.new(form_params)
+
+    if @gas_meter_detail.save
+      # redirect path will be updated later
+      redirect_to energy_case_tasks_path
+    else
+      render :new
+    end
+  end
+
+  def update
+    if @gas_meter_detail.update(form_params)
+      # redirect path will be updated later
+      redirect_to energy_case_tasks_path
+    else
+      render :edit
+    end
+  end
+
+  def destroy
+    return unless params[:confirm]
+
+    @gas_meter_detail.destroy!
+    redirect_to energy_case_org_gas_meter_index_path,
+                notice: I18n.t("energy.gas_meter_details.remove_page.removed")
+  end
+
+private
+
+  def set_gas_meter_detail
+    @gas_meter_detail = @onboarding_case_organisation.gas_meters.find(params[:id])
+  end
+
+  def form_params
+    params.fetch(:energy_gas_meter).permit(:mprn, :gas_usage)
+  end
+end
diff --git a/app/controllers/energy/gas_meter_details_controller.rb b/app/controllers/energy/gas_meter_details_controller.rb
deleted file mode 100644
index 557c031ffa..0000000000
--- a/app/controllers/energy/gas_meter_details_controller.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-class Energy::GasMeterDetailsController < Energy::ApplicationController
-  before_action :organisation_details
-  before_action :set_gas_meter_detail, only: %i[edit update]
-  before_action { @back_url = energy_switch_energy_path(id: params[:onboarding_case_id]) }
-  def new
-    @gas_meter_detail = @onboarding_organisation.gas_meters.new
-  end
-
-  def edit; end
-
-  def create
-    @gas_meter_detail = @onboarding_organisation.gas_meters.new(form_params)
-
-    if @gas_meter_detail.save
-      # redirect path will be updated later
-      redirect_to energy_task_path(id: params[:onboarding_case_id])
-    else
-      render :new
-    end
-  end
-
-  def update
-    if @gas_meter_detail.update(form_params)
-      # redirect path will be updated later
-      redirect_to energy_task_path(id: params[:onboarding_case_id])
-    else
-      render :edit
-    end
-  end
-
-private
-
-  def set_gas_meter_detail
-    @gas_meter_detail = @onboarding_organisation.gas_meters.find(params[:id])
-  end
-
-  def form_params
-    params.fetch(:energy_gas_meter).permit(:mprn, :gas_usage)
-  end
-end
diff --git a/app/controllers/energy/switch_energy_controller.rb b/app/controllers/energy/switch_energies_controller.rb
similarity index 56%
rename from app/controllers/energy/switch_energy_controller.rb
rename to app/controllers/energy/switch_energies_controller.rb
index 2d2145f584..8d46e05cd9 100644
--- a/app/controllers/energy/switch_energy_controller.rb
+++ b/app/controllers/energy/switch_energies_controller.rb
@@ -1,13 +1,8 @@
-class Energy::SwitchEnergyController < ApplicationController
+class Energy::SwitchEnergiesController < Energy::ApplicationController
+  before_action :organisation_details
   before_action :form, only: %i[update]
   before_action :switching_energy
-  before_action :organisation_detail
-  before_action { @back_url = energy_authorisation_path }
-
-  ALLOWED_CLASSES = [
-    "Support::Organisation",
-    "Support::EstablishmentGroup",
-  ].freeze
+  before_action { @back_url = school_type_energy_authorisation_path(id: @organisation_detail.urn, type: "single") }
 
   def show
     @form = Energy::SwitchEnergyForm.new(**switching_energy.to_h.compact)
@@ -25,21 +20,11 @@ def update
 private
 
   def switching_energy
-    @switching_energy = Energy::OnboardingCaseOrganisation.find_by(energy_onboarding_case_id: params[:id])
+    @switching_energy = Energy::OnboardingCaseOrganisation.find_by(energy_onboarding_case_id: params[:case_id])
   end
 
   def redirect_path
-    params[:commit] == I18n.t("generic.button.save_continue") ? energy_switch_energy_path : energy_task_path
-  end
-
-  def organisation_detail
-    onboardable_class = @switching_energy&.onboardable_type
-
-    if ALLOWED_CLASSES.include?(onboardable_class)
-      @organisation_detail = onboardable_class.safe_constantize.find(@switching_energy.onboardable_id)
-    else
-      render("errors/not_found", status: :not_found)
-    end
+    params[:commit] == I18n.t("generic.button.save_continue") ? energy_case_switch_energy_path : energy_case_tasks_path
   end
 
   def form
diff --git a/app/controllers/energy/tasks_controller.rb b/app/controllers/energy/tasks_controller.rb
index dd17ccee13..9ebb77b963 100644
--- a/app/controllers/energy/tasks_controller.rb
+++ b/app/controllers/energy/tasks_controller.rb
@@ -1,28 +1,10 @@
 module Energy
-  class TasksController < ApplicationController
+  class TasksController < Energy::ApplicationController
     before_action :organisation_details
-
-    ALLOWED_CLASSES = [
-      "Support::Organisation",
-      "Support::EstablishmentGroup",
-    ].freeze
     def show; end
 
     def update
       render :show
     end
-
-  private
-
-    def organisation_details
-      onboarding_organisation = Energy::OnboardingCaseOrganisation.find_by(energy_onboarding_case_id: params[:id])
-      onboardable_class = onboarding_organisation&.onboardable_type
-
-      return render("errors/not_found", status: :not_found) unless onboarding_organisation
-
-      if ALLOWED_CLASSES.include?(onboardable_class)
-        @organisation_detail = onboardable_class.safe_constantize.find(onboarding_organisation.onboardable_id)
-      end
-    end
   end
 end
diff --git a/app/views/energy/gas_meter_details/_form.html.erb b/app/views/energy/gas_meter/_form.html.erb
similarity index 71%
rename from app/views/energy/gas_meter_details/_form.html.erb
rename to app/views/energy/gas_meter/_form.html.erb
index d33dff563a..4879c54845 100644
--- a/app/views/energy/gas_meter_details/_form.html.erb
+++ b/app/views/energy/gas_meter/_form.html.erb
@@ -1,7 +1,7 @@
 <%= form_with(
       model: @gas_meter_detail,
-      url: @gas_meter_detail.new_record? ? energy_onboarding_case_gas_meter_details_path(onboarding_case_id: params[:onboarding_case_id])
-                                  : energy_onboarding_case_gas_meter_detail_path(onboarding_case_id: @onboarding_organisation.energy_onboarding_case_id, id: params[:id]),
+      url: @gas_meter_detail.new_record? ? energy_case_org_gas_meter_index_path
+                                  : energy_case_org_gas_meter_path(id: params[:id]),
     ) do |form| %>
     <%= form.govuk_error_summary %>
 
diff --git a/app/views/energy/gas_meter/destroy.html.erb b/app/views/energy/gas_meter/destroy.html.erb
new file mode 100644
index 0000000000..40b38477bc
--- /dev/null
+++ b/app/views/energy/gas_meter/destroy.html.erb
@@ -0,0 +1,20 @@
+<div class="govuk-grid-row">
+  <div class="govuk-grid-column-two-thirds">
+    <span class="govuk-caption-l"><%= @organisation_detail.name%>: <%= I18n.t("energy.gas_meter_details.title") %></span>
+    <h1 class="govuk-heading-l">
+       <%= I18n.t("energy.gas_meter_details.remove_page.heading") %>
+    </h1>
+
+    <div class="govuk-button-group flex-align-center">
+      <%= link_to I18n.t("energy.gas_meter_details.remove_page.remove_mprn"),
+                  energy_case_org_gas_meter_path(@gas_meter_detail, case_id: @onboarding_case_organisation.energy_onboarding_case_id, org_id: @onboarding_case_organisation.onboardable_id,  confirm: true),
+                  method: :delete,
+                  class: "govuk-button govuk-button--warning" %>
+
+      <%= link_to I18n.t("generic.button.cancel"),
+                  energy_case_org_gas_meter_index_path,
+                  class: "govuk-link govuk-link--no-visited-state" %>
+    </div>
+
+  </div>
+</div>
\ No newline at end of file
diff --git a/app/views/energy/gas_meter_details/edit.html.erb b/app/views/energy/gas_meter/edit.html.erb
similarity index 100%
rename from app/views/energy/gas_meter_details/edit.html.erb
rename to app/views/energy/gas_meter/edit.html.erb
diff --git a/app/views/energy/gas_meter/index.html.erb b/app/views/energy/gas_meter/index.html.erb
new file mode 100644
index 0000000000..154a1045a0
--- /dev/null
+++ b/app/views/energy/gas_meter/index.html.erb
@@ -0,0 +1,55 @@
+<div class="govuk-grid-row">
+  <div class="govuk-grid-column-two-thirds">
+    <span class="govuk-caption-l"><%= @organisation_detail.name%>: <%= I18n.t("energy.gas_meter_details.title") %></span>
+    <h1 class="govuk-heading-l"><%= I18n.t("energy.gas_meter_details.list_item.heading") %></h1>
+    <table class="govuk-table messages-table">
+      <caption class="govuk-table__caption govuk-table__caption--m">
+        <%= I18n.t("energy.gas_meter_details.list_item.total_mprn", total: @gas_meter_details.count) %>
+      </caption>
+      <thead class="govuk-table__head">
+        <tr class="govuk-table__row">
+          <th scope="col" class="govuk-table__header"
+            ><%= I18n.t("energy.gas_meter_details.list_item.mprn") %></th>
+          <th scope="col" class="govuk-table__header"
+            ><%= I18n.t("energy.gas_meter_details.list_item.gas_usage") %></th>
+          <th scope="col" class="govuk-table__header"></th>
+        </tr>
+      </thead>
+      <tbody class="govuk-table__body">
+        <% @gas_meter_details.each do |gas_meter| %>
+          <div class="govuk-summary-list__row">
+            <tr>
+              <td class="govuk-table__cell"><%= gas_meter.mprn %></td>
+              <td class="govuk-table__cell"><%= gas_meter.gas_usage %></td>
+              <td class="govuk-table__cell govuk-table__cell--numeric">
+                  <%= link_to safe_join([I18n.t("generic.link.change"),
+                      content_tag(:span, "Change details for #{gas_meter.mprn}", class: "govuk-visually-hidden")]),
+                          edit_energy_case_org_gas_meter_path(id: gas_meter.id),
+                           class: "govuk-link govuk-!-margin-right-3" %>
+                  <%= link_to safe_join([I18n.t("generic.button.remove"), 
+                      content_tag(:span, "Remove details for #{gas_meter.mprn}", class: "govuk-visually-hidden")]),
+                          energy_case_org_gas_meter_path(id: gas_meter.id),
+                          class: "govuk-link", method: :delete %>
+              </td>
+            </tr>
+          </div>
+        <% end %>
+      </tbody>
+    </table>
+
+<%= link_to I18n.t("energy.gas_meter_details.list_item.add_another_mprn"),
+            new_energy_case_org_gas_meter_path(onboarding_case_id: @onboarding_case_organisation.energy_onboarding_case_id), 
+            class: 'govuk-button govuk-button--secondary' %>
+
+<br>
+
+<%= link_to I18n.t("generic.button.save_continue"),
+            new_energy_case_org_gas_meter_path(onboarding_case_id: @onboarding_case_organisation.energy_onboarding_case_id),
+            class: 'govuk-button' %>
+
+
+
+  </div>
+</div>
+
+
diff --git a/app/views/energy/gas_meter_details/new.html.erb b/app/views/energy/gas_meter/new.html.erb
similarity index 100%
rename from app/views/energy/gas_meter_details/new.html.erb
rename to app/views/energy/gas_meter/new.html.erb
diff --git a/app/views/energy/switch_energy/_form.html.erb b/app/views/energy/switch_energies/_form.html.erb
similarity index 94%
rename from app/views/energy/switch_energy/_form.html.erb
rename to app/views/energy/switch_energies/_form.html.erb
index ca3a5bf7e4..a352affcc9 100644
--- a/app/views/energy/switch_energy/_form.html.erb
+++ b/app/views/energy/switch_energies/_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_with model: @form, scope: :energy_type_form, url: energy_switch_energy_path, method: :patch do |form| %>
+<%= form_with model: @form, scope: :energy_type_form, url: energy_case_switch_energy_path, method: :patch do |form| %>
     <%= form.govuk_error_summary %>
 
     <%= form.hidden_field :switching_energy_type, value: form.object.switching_energy_type %>
diff --git a/app/views/energy/switch_energy/show.html.erb b/app/views/energy/switch_energies/show.html.erb
similarity index 100%
rename from app/views/energy/switch_energy/show.html.erb
rename to app/views/energy/switch_energies/show.html.erb
diff --git a/app/views/energy/tasks/show.html.erb b/app/views/energy/tasks/show.html.erb
index 36dad30dc4..6f23382cf5 100644
--- a/app/views/energy/tasks/show.html.erb
+++ b/app/views/energy/tasks/show.html.erb
@@ -23,7 +23,7 @@
 
     <div class="govuk-button-group flex-align-center">
         <%= link_to I18n.t("generic.button.continue"),
-          energy_task_path,
+          energy_case_tasks_path,
           method: :patch,
           class: "govuk-button" 
         %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index d48c136a26..b815508596 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -460,6 +460,16 @@ en:
       gas_usage_label: Estimated annual gas usage for this meter, in kilowatt hours
       gas_usage_hint: Check your latest gas bill. Some suppliers include your annual estimated usage on the bill. Alternatively, add up the kWh from your last 12 gas bills to calculate your total usage.
       gas_usage_suffix: kWh
+      list_item:
+        heading: MPRN summary
+        total_mprn: 'You have added %{total} MPRNs'
+        mprn: MPRN
+        gas_usage: Estimated annual gas usage
+        add_another_mprn: Add another MPRN
+      remove_page:
+        heading: Are you sure you want to remove this MPRN?
+        remove_mprn: Remove MPRN
+        removed: MPRN successfully removed
 
   errors:
     contentful_entry_not_found:
diff --git a/config/routes.rb b/config/routes.rb
index 534396b79e..4992089916 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -504,10 +504,11 @@
         patch ":type", to: "authorisation#update"
       end
     end
-    resources :switch_energy, only: %i[show update]
-    resources :tasks, only: %i[show update]
-    resources :onboarding_case, only: %i[show] do
-      resources :gas_meter_details, except: %i[index] do
+    resources :case, only: %i[show] do
+      resource :switch_energy, only: %i[show update]
+      resource :tasks, only: %i[show update]
+      resources :org, except: %i[show] do
+        resources :gas_meter, except: %i[show]
       end
     end
   end
diff --git a/spec/features/energy/gas_meter_details_spec.rb b/spec/features/energy/gas_meter_details_spec.rb
index ca9d2d9958..e70d16d4a6 100644
--- a/spec/features/energy/gas_meter_details_spec.rb
+++ b/spec/features/energy/gas_meter_details_spec.rb
@@ -5,14 +5,14 @@
   let(:user) { create(:user, :many_supported_schools_and_groups) }
   let(:support_case) { create(:support_case, organisation: support_organisation) }
   let(:onboarding_case) { create(:onboarding_case, support_case:) }
-  let(:energy_onboarding_case_organisation) { create(:energy_onboarding_case_organisation, onboarding_case:, onboardable: support_organisation) }
+  let(:case_organisation) { create(:energy_onboarding_case_organisation, onboarding_case:, onboardable: support_organisation) }
 
   specify "Adding gas usage" do
     Current.user = user
     user_exists_in_dfe_sign_in(user:)
     user_is_signed_in(user:)
 
-    visit new_energy_onboarding_case_gas_meter_detail_path(onboarding_case_id: energy_onboarding_case_organisation.energy_onboarding_case_id)
+    visit new_energy_case_org_gas_meter_path(case_id: case_organisation.energy_onboarding_case_id, org_id: case_organisation.onboardable_id)
 
     expect(page).to have_text("Gas meter details")
 
diff --git a/spec/features/energy/switch_energy_spec.rb b/spec/features/energy/switch_energy_spec.rb
index 7e5f4f967d..33024aadff 100644
--- a/spec/features/energy/switch_energy_spec.rb
+++ b/spec/features/energy/switch_energy_spec.rb
@@ -1,17 +1,18 @@
 require "rails_helper"
 
 describe "User can update energy type", :js do
-  let(:user) { create(:user) }
-  let(:support_case) { create(:support_case) }
+  let(:support_organisation) { create(:support_organisation, urn: 100_253) }
+  let(:user) { create(:user, :many_supported_schools_and_groups) }
+  let(:support_case) { create(:support_case, organisation: support_organisation) }
   let(:onboarding_case) { create(:onboarding_case, support_case:) }
-  let(:energy_onboarding_case_organisation) { create(:energy_onboarding_case_organisation, onboarding_case:) }
+  let(:case_organisation) { create(:energy_onboarding_case_organisation, onboarding_case:, onboardable: support_organisation) }
 
   specify "Verify the single school fuel selection" do
     Current.user = user
     user_exists_in_dfe_sign_in(user:)
     user_is_signed_in(user:)
 
-    visit energy_switch_energy_path(id: energy_onboarding_case_organisation.energy_onboarding_case_id)
+    visit energy_case_switch_energy_path(case_id: case_organisation.energy_onboarding_case_id, org_id: case_organisation.onboardable_id)
 
     expect(page).to have_text("Are you switching electricity, gas or both?")
 


Reviews:
user: login: doctorpod
body: LGTM
state: APPROVED
author_association: NONE
submitted_at: 2025-05-02T15:18:59Z
user: login: dinesh16
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T15:29:51Z
user: login: edwin-jebaraj
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-02T15:36:40Z
user: login: dinesh16
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-02T15:56:25Z

Review comments:
diff_hunk: @@ -13,7 +13,7 @@ def check_flag
       render "errors/not_found", status: :not_found unless Flipper.enabled?(:energy)
     end
 
-    def organisation_details(id = params[:onboarding_case_id])
+    def organisation_details(id = params[:case_id])
       @onboarding_organisation = Energy::OnboardingCaseOrganisation.find_by(energy_onboarding_case_id: id)
path: app/controllers/energy/application_controller.rb
user: login: dinesh16
body: @edwin-jebaraj could we change this to `@onboarding_case_organisation` for consistency nice to have instance name matching with model name.
created_at: 2025-05-02T15:29:51Z
author_association: COLLABORATOR
diff_hunk: @@ -13,7 +13,7 @@ def check_flag
       render "errors/not_found", status: :not_found unless Flipper.enabled?(:energy)
     end
 
-    def organisation_details(id = params[:onboarding_case_id])
+    def organisation_details(id = params[:case_id])
       @onboarding_organisation = Energy::OnboardingCaseOrganisation.find_by(energy_onboarding_case_id: id)
path: app/controllers/energy/application_controller.rb
user: login: edwin-jebaraj
body: updated
created_at: 2025-05-02T15:36:40Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-02T15:48:46Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=DFE-Digital_buy-for-your-school&pullRequest=2109) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=DFE-Digital_buy-for-your-school&pullRequest=2109&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=DFE-Digital_buy-for-your-school&pullRequest=2109&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=DFE-Digital_buy-for-your-school&pullRequest=2109&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=DFE-Digital_buy-for-your-school&pullRequest=2109&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=DFE-Digital_buy-for-your-school&pullRequest=2109&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=DFE-Digital_buy-for-your-school&pullRequest=2109)


author_association: NONE
user: login: github-actions[bot]
created_at: 2025-05-02T15:58:00Z
body: # Test coverage
**Line:** 86.23%
**Branch:** 75.11%
author_association: NONE