diff --git a/app/routes/apply.js b/app/routes/apply.js index ed168add..4419dcb7 100644 --- a/app/routes/apply.js +++ b/app/routes/apply.js @@ -9,10 +9,29 @@ const sortByNameThenPostcode = (getPostcode = (item) => item.postcode) => (a, b) return 1 } +const findOrganisationById = (data, organisationId) => { + if (!organisationId) return null + return (data.organisations || []).find((organisation) => organisation.id === organisationId) || + (data.allOrganisations || []).find((organisation) => organisation.id === organisationId) +} + module.exports = router => { router.get('/apply/start', async (req, res) => { const data = req.session.data + let errors = [] + + if (req.query.error === 'no-pharmacy') { + errors.push({ + text: 'Select a pharmacy', + href: '#organisation-code' + }) + } else if (req.query.error === 'existing-account') { + errors.push({ + text: 'This pharmacy already has an account', + href: '#organisation-code' + }) + } const allOrganisations = data.allOrganisations.sort(sortByNameThenPostcode()) const allPharmacies = allOrganisations.filter((organisation) => organisation.type === "Community pharmacy") @@ -22,7 +41,8 @@ module.exports = router => { res.render('apply/start', { allOrganisations, allPharmacies, - allPharmacyCompanies + allPharmacyCompanies, + errors }) }) @@ -51,8 +71,9 @@ module.exports = router => { router.post('/apply/answer-pharmacy', (req, res) => { const data = req.session.data - const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisationId = data.organisationCode || data.organisationId + data.organisationId = organisationId + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start?error=no-pharmacy'); @@ -94,7 +115,7 @@ module.exports = router => { router.get('/apply/check-pharmacy', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } res.render('apply/check-pharmacy', { @@ -145,7 +166,7 @@ module.exports = router => { router.get('/apply/check', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } res.render('apply/check', { @@ -177,7 +198,7 @@ module.exports = router => { router.get('/apply/check-your-email', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } @@ -242,7 +263,7 @@ module.exports = router => { router.get('/apply/welcome-email', (req, res) => { const data = req.session.data const organisationId = data.organisationId - const organisation = data.allOrganisations.find((organisation) => organisation.id === organisationId) + const organisation = findOrganisationById(data, organisationId) if (!organisation) { res.redirect('/apply/start'); return } res.render('apply/welcome-email', { diff --git a/app/views/apply/start.html b/app/views/apply/start.html index c6e54e66..10f0f52e 100644 --- a/app/views/apply/start.html +++ b/app/views/apply/start.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} -{% set pageName = "Sign up" %} +{% set pageName = "Sign up for your pharmacy" %} {% block beforeContent %} {{ backLink({ @@ -12,35 +12,53 @@ {% block content %}
From 1 September 2026, community pharmacies must use Record a vaccination for all NHS vaccinations.
+ +If you need to sign up for more than 1 pharmacy, you can use this form multiple times.
- + +Sign up with your NHS email and get an account.
+Sign up for an account to access the service.
You can switch point of care systems at any time, and use different systems for different pharmacies.
+From 1 September 2026, community pharmacies must use Record a vaccination for all NHS vaccinations, including COVID-19 and flu.
+ +You can sign up for an account to use the service any time before the start of autumn vaccinations.
You will still have access to your previous system for at least 6 months so you can download reports.
-Other questions? Get in touch.
-This includes teams vaccinating in occupational health, maternity, in-patient and outreach settings.
-Your regions are responsible for inviting you to use the service.
+Your regions are responsible for inviting you to use Record a vaccination.
-If you want to use RAVS, contact your Regional Vaccination Operations Centre (RVOC).
+If you want to use the service, contact your Regional Vaccination Operations Centre (RVOC).