diff --git a/app/data/session-data-defaults.js b/app/data/session-data-defaults.js index 126a4c7..2e98efc 100644 --- a/app/data/session-data-defaults.js +++ b/app/data/session-data-defaults.js @@ -696,7 +696,8 @@ module.exports = { "FAH85": {"name": "Boots", "address": "77 High Street", "town": "Bromley", "postcode": "Br1 1Jy"}, "FAH9": {"name": "Whittington Pharmacy", "address": "13B Main Street,Whittington", "postcode": "Lichfield", "postcode": "Ws14 9Ju"}, "FAH94": {"name": "Lo'S Pharmacy,Outwood Park Medical Centre,Potovens Lane,Outwood,Wakefield", "postcode": "Wf1 2Pe"}, - "FAJ00": {"name": "Jades Chemist", "address": "19 The Parade", "town": "Crawley", "postcode": "Rh10 8Dt"} + "FAJ00": {"name": "Jades Chemist", "address": "19 The Parade", "town": "Crawley", "postcode": "Rh10 8Dt"}, + "FAZZZ": {"name": "Legally Closed Pharamcy", "address": "30 Legal Close", "town": "London", "postcode": "CL0 5ED", legallyClosed: "2001-02-04"} }, "sites": { "RWX15": { diff --git a/app/routes/regions.js b/app/routes/regions.js index 8d3e7de..5b64ecd 100644 --- a/app/routes/regions.js +++ b/app/routes/regions.js @@ -56,16 +56,18 @@ module.exports = router => { router.get('/regions/v1/organisation-details', (req, res) => { const organisationCode = req.session.data.organisationCode - let organisationName, organisationLine1, organisationTown, organisationPostcode, organisationType + let organisationName, organisationLine1, organisationTown, organisationPostcode, organisationType, legallyClosed if (organisationCode.startsWith('FA')) { organisationName = req.session.data.nhsPharmacies[organisationCode].name organisationLine1 = req.session.data.nhsPharmacies[organisationCode].address organisationTown = req.session.data.nhsPharmacies[organisationCode].town organisationPostcode = req.session.data.nhsPharmacies[organisationCode].postcode + legallyClosed = req.session.data.nhsPharmacies[organisationCode].legallyClosed organisationType = 'Community Pharmacy' } else { organisationName = req.session.data.nhsTrusts[organisationCode] + legallyClosed = false organisationLine1 = 'Cobbett House, Oxford Road' organisationTown = 'Manchester' organisationPostcode = 'M13 9WL' @@ -80,7 +82,8 @@ module.exports = router => { line1: organisationLine1, town: organisationTown, postcode: organisationPostcode - } + }, + legallyClosed: legallyClosed } res.render('regions/v1/organisation-details', { diff --git a/app/views/regions/v1/organisation-details.html b/app/views/regions/v1/organisation-details.html index 6983060..aff8d8e 100644 --- a/app/views/regions/v1/organisation-details.html +++ b/app/views/regions/v1/organisation-details.html @@ -23,6 +23,18 @@

Organisation

+ {% if organisation.legallyClosed %} + + {% set warningHtml %} +

This organisation was legally closed on {{ organisation.legallyClosed | govukDate }} and cannot be added.

+ {% endset %} + + {{ warningCallout({ + heading: "Important", + HTML: warningHtml + }) }} + {% endif %} + {{ summaryList({ rows: [ { @@ -60,12 +72,14 @@

Organisation

] }) }} + {% if not organisation.legallyClosed %} - {{ button({ - "text": "Continue", - href: "/regions/v1/add-email" - }) }} + {{ button({ + "text": "Continue", + href: "/regions/v1/add-email" + }) }} + {% endif %}