Skip to content

Commit 142504c

Browse files
Merge pull request #6505 from NHSDigital/alistair/national-reporting-cut-off-banner-extend-nivs
Change NIVS switch-off date to 2 days after cutoff
2 parents 9a59d10 + 9474a7f commit 142504c

3 files changed

Lines changed: 28 additions & 5 deletions

File tree

app/models/team.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class Team < ApplicationRecord
4444

4545
NATIONAL_REPORTING_YEAR_GROUPS = (-2..13).to_a.freeze
4646

47+
# The number of days after the national reporting cut-off date when users will lose access to NIVS
48+
NIVS_SWITCH_OFF_DELAY_DAYS = 2
49+
4750
audited associated_with: :organisation
4851
has_associated_audits
4952

app/views/immunisation_imports/new.html.erb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66

77
<% content_for :page_title, title %>
88

9-
<% if (cutoff_date = current_team.national_reporting_cut_off_date) && Date.today <= cutoff_date %>
9+
<% if (cutoff_date = current_team.national_reporting_cut_off_date) &&
10+
Date.today <= cutoff_date + Team::NIVS_SWITCH_OFF_DELAY_DAYS.days %>
1011
<%= govuk_notification_banner(title_text: "Important") do %>
1112
<h3 class="nhsuk-notification-banner__heading">
1213
Mavis national reporting replaces NIVS on <%= cutoff_date.to_fs(:long) %>
1314
</h3>
1415

1516
<h4 class="nhsuk-u-margin-bottom-2">Vaccinations given before <%= cutoff_date.to_fs(:long) %></h4>
16-
<p>Upload to NIVS by <%= cutoff_date.to_fs(:long) %>. After this, NIVS will no longer be available.</p>
17+
<p>
18+
Upload to NIVS by <%= (cutoff_date + Team::NIVS_SWITCH_OFF_DELAY_DAYS.days).to_fs(:long) %>.
19+
After this, NIVS will no longer be available.
20+
</p>
1721

1822
<h4 class="nhsuk-u-margin-bottom-2">Vaccinations given on or after <%= cutoff_date.to_fs(:long) %></h4>
1923
<p>Upload to Mavis national reporting only.</p>

spec/features/import_vaccination_records_national_reporting_spec.rb

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
context "cutoff date banner" do
5757
let(:cutoff_date) { Date.new(2026, 4, 20) }
5858

59-
context "when today is after the cutoff date" do
60-
around { |example| travel_to(cutoff_date + 1.day) { example.run } }
59+
context "when today is more than 2 days after the cutoff date" do
60+
around { |example| travel_to(cutoff_date + 3.days) { example.run } }
6161

6262
scenario "banner is not shown" do
6363
given_mavis_logins_are_configured(
@@ -69,6 +69,22 @@
6969
end
7070
end
7171

72+
context "when today is within 2 days after the cutoff date" do
73+
around { |example| travel_to(cutoff_date + 2.days) { example.run } }
74+
75+
scenario "banner is shown" do
76+
given_mavis_logins_are_configured(
77+
national_reporting_cut_off_date: cutoff_date
78+
)
79+
given_i_am_signed_in_as_a_national_reporting_user
80+
when_i_navigate_to_the_upload_page
81+
expect(page).to have_css(".nhsuk-notification-banner")
82+
expect(page).to have_content(
83+
"Mavis national reporting replaces NIVS on 20 April 2026"
84+
)
85+
end
86+
end
87+
7288
context "when today is before the cutoff date" do
7389
around { |example| travel_to(cutoff_date - 1.day) { example.run } }
7490

@@ -100,7 +116,7 @@
100116
)
101117
expect(page).to have_content("Vaccinations given before 20 April 2026")
102118
expect(page).to have_content(
103-
"Upload to NIVS by 20 April 2026. After this, NIVS will no longer be available."
119+
"Upload to NIVS by 22 April 2026. After this, NIVS will no longer be available."
104120
)
105121
expect(page).to have_content(
106122
"Vaccinations given on or after 20 April 2026"

0 commit comments

Comments
 (0)