diff --git a/app/data/appointments.js b/app/data/appointments.js index 9e999f49..a090e2ce 100644 --- a/app/data/appointments.js +++ b/app/data/appointments.js @@ -62,7 +62,7 @@ module.exports = [ } }, vaccinations: [ - "flu", "RSV" + "COVID-19", "RSV" ] }, { diff --git a/app/data/organisations.js b/app/data/organisations.js index 6546f175..bfe3b7bd 100644 --- a/app/data/organisations.js +++ b/app/data/organisations.js @@ -9157,5 +9157,88 @@ module.exports = [ type: 'Pharmacy HQ', status: 'Active', region: "Y56" + }, + { + id: "FCX831", + name: "Riverside Community Pharmacy", + address: { + line1: "42 River Street", + town: "Bristol", + postcode: "BS2 8NT" + }, + type: "Community Pharmacy", + status: "Closed", + region: "Y56", + companyId: "P0191N", + vaccines: [ + {name: "COVID-19", status: "enabled"}, + {name: "flu", status: "enabled"} + ], + sites: [ + { + id: "FCX831-01", + name: "Riverside Community Pharmacy", + address: { + line1: "42 River Street", + town: "Bristol", + postcode: "BS2 8NT" + } + } + ] + }, + { + id: "FDX942", + name: "Central Health Pharmacy", + address: { + line1: "78 Main Street", + town: "Oxford", + postcode: "OX1 3HR" + }, + type: "Community Pharmacy", + status: "Closed", + region: "Y56", + companyId: "P0191N", + vaccines: [ + {name: "COVID-19", status: "enabled"} + ], + sites: [ + { + id: "FDX942-01", + name: "Central Health Pharmacy", + address: { + line1: "78 Main Street", + town: "Oxford", + postcode: "OX1 3HR" + } + } + ] + }, + { + id: "FEY153", + name: "Wellcare Pharmacy", + address: { + line1: "156 High Street", + town: "Edinburgh", + postcode: "EH8 8DH" + }, + type: "Community Pharmacy", + status: "Closed", + region: "Y56", + companyId: "P15951", + vaccines: [ + {name: "COVID-19", status: "enabled"}, + {name: "MMR", status: "enabled"} + ], + sites: [ + { + id: "FEY153-01", + name: "Wellcare Pharmacy", + address: { + line1: "156 High Street", + town: "Edinburgh", + postcode: "EH8 8DH" + } + } + ] } ] diff --git a/app/data/users.js b/app/data/users.js index f0a34580..27d8578c 100644 --- a/app/data/users.js +++ b/app/data/users.js @@ -98,6 +98,19 @@ module.exports = [ "firstName": "Paulina", "lastName": "Sloan" }, + { + "id": "7301948572610", + "email": "michael.reid@nhs.net", + "organisations": [ + { + "id": "P0191N", + "permissionLevel": "Group administrator", + "status": "Active" + } + ], + "firstName": "Michael", + "lastName": "Reid" + }, // Each pharmacy in Paulina Sloan’s chain has its own vaccinator, some of whom are also admins { "id": "46436346", @@ -155,6 +168,34 @@ module.exports = [ "firstName": "Samantha", "lastName": "Black" }, + { + "id": "2195407736418", + "email": "nina.hunt@nhs.net", + "organisations": [ + { + "id": "FA424", + "permissionLevel": "Administrator", + "status": "Active", + "vaccinator": true + } + ], + "firstName": "Nina", + "lastName": "Hunt" + }, + { + "id": "8701294465302", + "email": "liam.byrne@nhs.net", + "organisations": [ + { + "id": "FA02S", + "permissionLevel": "Recorder", + "status": "Active", + "vaccinator": false + } + ], + "firstName": "Liam", + "lastName": "Byrne" + }, // Amanda White is a group administrator for the // MediCare Health Ltd chain of pharmacies { @@ -170,6 +211,47 @@ module.exports = [ } ] }, + { + "firstName": "Farah", + "lastName": "Iqbal", + "id": "6015872204914", + "email": "farah.iqbal@nhs.net", + "organisations": [ + { + "id": "P15951", + "permissionLevel": "Group administrator", + "status": "Active" + } + ] + }, + { + "id": "3041597862150", + "email": "kyle.mason@nhs.net", + "organisations": [ + { + "id": "FX9141", + "permissionLevel": "Administrator", + "status": "Active", + "vaccinator": true + } + ], + "firstName": "Kyle", + "lastName": "Mason" + }, + { + "id": "4586231970421", + "email": "elise.turner@nhs.net", + "organisations": [ + { + "id": "FX4825", + "permissionLevel": "Recorder", + "status": "Active", + "vaccinator": true + } + ], + "firstName": "Elise", + "lastName": "Turner" + }, { "id": "34634617277", "email": "peter.orange@nhs.net", diff --git a/app/filters.js b/app/filters.js index 57aa92fc..f9d9a048 100644 --- a/app/filters.js +++ b/app/filters.js @@ -38,6 +38,25 @@ module.exports = function () { } } + filters.joinWithAnd = function(array) { + if (!Array.isArray(array) || array.length === 0) { + return '' + } + + const items = array.map((item) => String(item)) + items[0] = filters.capitaliseFirstLetter(items[0]) + + if (items.length === 1) { + return items[0] + } + + if (items.length === 2) { + return `${items[0]} and ${items[1]}` + } + + return `${items.slice(0, -1).join(', ')} and ${items[items.length - 1]}` + } + /** * Returns the name of a month, eg 'November', when * given the number of the month, eg 11. diff --git a/app/routes/pharmacies.js b/app/routes/pharmacies.js index 682c27e9..cab382f9 100644 --- a/app/routes/pharmacies.js +++ b/app/routes/pharmacies.js @@ -19,11 +19,15 @@ module.exports = router => { const companyId = res.locals.currentOrganisation.id - const organisations = data.organisations.filter((organisation) => organisation.companyId === companyId).sort(sortByNameThenPostcode()) + const allOrganisations = data.organisations.filter((organisation) => organisation.companyId === companyId).sort(sortByNameThenPostcode()) + + // Separate active/deactivated pharmacies from closed ones + const organisations = allOrganisations.filter((org) => org.status !== 'Closed') + const closedOrganisations = allOrganisations.filter((org) => org.status === 'Closed') let organisationUserCounts = {} - for (const organisation of organisations) { + for (const organisation of allOrganisations) { organisationUserCounts[organisation.id] = data.users .filter((user) => (user.organisations || []) .find((orgPermission) => orgPermission.id === organisation.id) @@ -33,6 +37,7 @@ module.exports = router => { res.render('pharmacies/index', { organisations, + closedOrganisations, organisationUserCounts, added }) @@ -103,6 +108,11 @@ module.exports = router => { router.get('/pharmacies/users',(req, res) => { const data = req.session.data const companyId = res.locals.currentOrganisation.id + const deactivatedGroupAdminId = req.query.deactivatedGroupAdminId + const deactivatedUserId = req.query.deactivatedUserId + const deactivatedFromPharmacyId = req.query.deactivatedFromPharmacyId + const deactivatedFromAllUserId = req.query.deactivatedFromAllUserId + const deactivatedFromAllCount = parseInt(req.query.deactivatedFromAllCount, 10) || 0 const pharmacies = data.organisations.filter((organisation) => organisation.companyId === companyId) const pharmacyIds = pharmacies.map(pharmacy => pharmacy.id) @@ -119,18 +129,102 @@ module.exports = router => { }) const groupAdministrators = users.filter(function(user) { - return user.organisations.find(org => org.permissionLevel === "Group administrator") + return user.organisations.find(org => org.permissionLevel === "Group administrator" && org.status !== 'Deactivated') + }) + + const deactivatedGroupAdmin = deactivatedGroupAdminId + ? data.users.find((user) => user.id === deactivatedGroupAdminId) + : undefined + + const deactivatedUser = deactivatedUserId + ? data.users.find((user) => user.id === deactivatedUserId) + : undefined + + const deactivatedFromPharmacy = deactivatedFromPharmacyId + ? data.organisations.find((organisation) => organisation.id === deactivatedFromPharmacyId) + : undefined + + const deactivatedFromAllUser = deactivatedFromAllUserId + ? data.users.find((user) => user.id === deactivatedFromAllUserId) + : undefined + + // Show only active users added to individual pharmacies in the general user list. + users = users.filter((user) => { + if (groupAdministrators.includes(user)) { + return false + } + + return (user.organisations || []).some((organisation) => { + return pharmacyIds.includes(organisation.id) && organisation.status !== 'Deactivated' + }) }) - // Filter out group admins from the general user list - users = users.filter((user) => !groupAdministrators.includes(user)) + const userPharmacyCounts = {} + + for (const user of users) { + userPharmacyCounts[user.id] = (user.organisations || []).filter((organisation) => { + return pharmacyIds.includes(organisation.id) && organisation.status !== 'Deactivated' + }).length + } res.render('pharmacies/users/index', { users, - groupAdministrators + groupAdministrators, + deactivatedGroupAdmin, + deactivatedUser, + deactivatedFromPharmacy, + deactivatedFromAllUser, + deactivatedFromAllCount, + userPharmacyCounts + }) + }) + + router.get('/pharmacies/:groupId/users/:userId/deactivate-from-group',(req, res) => { + const data = req.session.data + const groupId = req.params.groupId + const userId = req.params.userId + + const user = data.users.find((item) => item.id === userId) + + if (!user) { + return res.redirect('/pharmacies/users') + } + + const groupRole = (user.organisations || []).find((org) => org.id === groupId && org.permissionLevel === 'Group administrator') + + if (!groupRole) { + return res.redirect('/pharmacies/users') + } + + res.render('pharmacies/users/deactivate-from-group', { + user, + groupId, + groupName: (res.locals.currentOrganisation && res.locals.currentOrganisation.name) || 'this pharmacy group' }) }) + router.post('/pharmacies/:groupId/users/:userId/deactivate-from-group-answer',(req, res) => { + const data = req.session.data + const groupId = req.params.groupId + const userId = req.params.userId + + const user = data.users.find((item) => item.id === userId) + + if (!user) { + return res.redirect('/pharmacies/users') + } + + const groupRole = (user.organisations || []).find((org) => org.id === groupId && org.permissionLevel === 'Group administrator') + + if (!groupRole) { + return res.redirect('/pharmacies/users') + } + + groupRole.status = 'Deactivated' + + res.redirect(`/pharmacies/users?deactivatedGroupAdminId=${user.id}`) + }) + router.get('/pharmacies/users/new',(req, res) => { res.render('pharmacies/users/new') @@ -159,7 +253,15 @@ module.exports = router => { router.get('/pharmacies/users/new-select-pharmacies-check',(req, res) => { const data = req.session.data - const pharmacyIds = data.pharmacyIds + const pharmacyIds = data.pharmacyIds || [] + + if (pharmacyIds.length === 0) { + return res.redirect('/pharmacies/users/new-select-pharmacies') + } + + if (pharmacyIds.length === 1) { + return res.redirect('/pharmacies/users/new-permission-level') + } // Get pharmacies selected on previous page const pharmacies = data.organisations.filter((organisation) => pharmacyIds.includes(organisation.id)) @@ -170,6 +272,22 @@ module.exports = router => { }) }) + router.get('/pharmacies/users/new-select-pharmacies-check/remove/:pharmacyId', (req, res) => { + const data = req.session.data + const pharmacyId = req.params.pharmacyId + const pharmacyIds = Array.isArray(data.pharmacyIds) + ? data.pharmacyIds + : (data.pharmacyIds ? [data.pharmacyIds] : []) + + data.pharmacyIds = pharmacyIds.filter((id) => id !== pharmacyId) + + if (data.pharmacyIds.length === 0) { + return res.redirect('/pharmacies/users/new-select-pharmacies') + } + + res.redirect('/pharmacies/users/new-select-pharmacies-check') + }) + router.get('/pharmacies/users/new-permission-level',(req, res) => { const data = req.session.data const pharmacyIds = data.pharmacyIds || [] @@ -269,7 +387,7 @@ module.exports = router => { pharmacy.status = 'Deactivated' - res.redirect(`/pharmacies/${id}`) + res.redirect(`/pharmacies/${id}?deactivated=true`) }) router.get('/pharmacies/:id/add-user',(req, res) => { @@ -390,13 +508,15 @@ module.exports = router => { const data = req.session.data const pharmacyId = req.params.pharmacyId const userId = req.params.userId + const from = req.query.from === 'pharmacy' ? 'pharmacy' : 'user' const user = data.users.find(user => user.id === userId) const pharmacy = data.organisations.find(organisation => organisation.id === pharmacyId) res.render('pharmacies/users/deactivate-from-pharmacy', { user, - pharmacy + pharmacy, + from }) }) @@ -404,6 +524,7 @@ module.exports = router => { const data = req.session.data const pharmacyId = req.params.pharmacyId const userId = req.params.userId + const from = req.query.from === 'pharmacy' ? 'pharmacy' : 'user' const user = data.users.find(user => user.id === userId) const pharmacy = data.organisations.find(organisation => organisation.id === pharmacyId) @@ -412,8 +533,88 @@ module.exports = router => { role.status = 'Deactivated' - res.redirect(`/pharmacies/users/${user.id}?deactivatedFromPharmacyId=${pharmacy.id}`) + if (from === 'user') { + return res.redirect(`/pharmacies/users/${user.id}?deactivatedFromPharmacyId=${pharmacy.id}`) + } + + res.redirect(`/pharmacies/${pharmacy.id}?tab=deactivated&deactivatedUserId=${user.id}&deactivatedFromPharmacyId=${pharmacy.id}`) + + }) + + router.get('/pharmacies/:pharmacyId/users/:userId/reactivate', (req, res) => { + const data = req.session.data + const pharmacyId = req.params.pharmacyId + const userId = req.params.userId + + const user = data.users.find((item) => item.id === userId) + const pharmacy = data.organisations.find((organisation) => organisation.id === pharmacyId) + + if (!user || !pharmacy) { + return res.redirect('/pharmacies') + } + + const role = (user.organisations || []).find((item) => item.id === pharmacyId) + + if (!role) { + return res.redirect(`/pharmacies/${pharmacyId}?tab=deactivated`) + } + + role.status = 'Active' + + res.redirect(`/pharmacies/${pharmacyId}?tab=active&reactivatedUserId=${userId}&reactivatedFromPharmacyId=${pharmacyId}`) + }) + + router.get('/pharmacies/users/:userId/deactivate-from-all-pharmacies', (req, res) => { + const data = req.session.data + const userId = req.params.userId + const companyId = res.locals.currentOrganisation.id + + const user = data.users.find((item) => item.id === userId) + + if (!user) { + return res.redirect('/pharmacies/users') + } + + const activePharmacyRolesAtCompany = (user.organisations || []) + .map((role) => { + const pharmacy = data.organisations.find((organisation) => organisation.id === role.id) + return { role, pharmacy } + }) + .filter(({ role, pharmacy }) => pharmacy && pharmacy.companyId === companyId && role.permissionLevel !== 'Group administrator' && role.status !== 'Deactivated') + + if (activePharmacyRolesAtCompany.length === 0) { + return res.redirect(`/pharmacies/users/${userId}`) + } + + res.render('pharmacies/users/deactivate-from-all-pharmacies', { + user, + pharmacies: activePharmacyRolesAtCompany.map(({ pharmacy }) => pharmacy) + }) + }) + + router.post('/pharmacies/users/:userId/deactivate-from-all-pharmacies-answer', (req, res) => { + const data = req.session.data + const userId = req.params.userId + const companyId = res.locals.currentOrganisation.id + + const user = data.users.find((item) => item.id === userId) + + if (!user) { + return res.redirect('/pharmacies/users') + } + + const deactivatedPharmacyIds = [] + for (const role of (user.organisations || [])) { + const pharmacy = data.organisations.find((organisation) => organisation.id === role.id) + + if (pharmacy && pharmacy.companyId === companyId && role.permissionLevel !== 'Group administrator' && role.status !== 'Deactivated') { + role.status = 'Deactivated' + deactivatedPharmacyIds.push(pharmacy.id) + } + } + + res.redirect(`/pharmacies/users?deactivatedFromAllUserId=${userId}&deactivatedFromAllCount=${deactivatedPharmacyIds.length}`) }) @@ -456,17 +657,66 @@ module.exports = router => { }) }) + router.get('/pharmacies/users/:id/add-to-select-pharmacies-check', (req, res) => { + const data = req.session.data + const userId = req.params.id + const user = data.users.find(user => user.id === userId) + + const selectedPharmacyIds = data.addToPharmacyIds + ? (Array.isArray(data.addToPharmacyIds) ? data.addToPharmacyIds : [data.addToPharmacyIds]) + : [] + + if (selectedPharmacyIds.length === 0) { + return res.redirect(`/pharmacies/users/${userId}/add-to`) + } + + if (selectedPharmacyIds.length === 1) { + return res.redirect(`/pharmacies/users/${userId}/add-to-permission-level`) + } + + const pharmacies = data.organisations.filter((organisation) => selectedPharmacyIds.includes(organisation.id)) + + res.render('pharmacies/users/add-to-select-pharmacies-check', { + user, + pharmacies + }) + }) + + router.get('/pharmacies/users/:id/add-to-select-pharmacies-check/remove/:pharmacyId', (req, res) => { + const data = req.session.data + const userId = req.params.id + const pharmacyId = req.params.pharmacyId + + const selectedPharmacyIds = data.addToPharmacyIds + ? (Array.isArray(data.addToPharmacyIds) ? data.addToPharmacyIds : [data.addToPharmacyIds]) + : [] + + data.addToPharmacyIds = selectedPharmacyIds.filter((id) => id !== pharmacyId) + + if (data.addToPharmacyIds.length === 0) { + return res.redirect(`/pharmacies/users/${userId}/add-to`) + } + + res.redirect(`/pharmacies/users/${userId}/add-to-select-pharmacies-check`) + }) + router.get('/pharmacies/users/:id/add-to-permission-level',(req, res) => { const data = req.session.data const userId = req.params.id const user = data.users.find(user => user.id === userId) - const pharmacy = data.organisations.find(organisation => organisation.id === data.pharmacyId) + const selectedPharmacyIds = data.addToPharmacyIds + ? (Array.isArray(data.addToPharmacyIds) ? data.addToPharmacyIds : [data.addToPharmacyIds]) + : [] + const pharmacies = data.organisations.filter((organisation) => selectedPharmacyIds.includes(organisation.id)) + if (pharmacies.length === 0) { + return res.redirect(`/pharmacies/users/${userId}/add-to`) + } res.render('pharmacies/users/add-to-permission-level', { user, - pharmacy + pharmacies }) }) @@ -475,12 +725,18 @@ module.exports = router => { const userId = req.params.id const user = data.users.find(user => user.id === userId) - const pharmacy = data.organisations.find(organisation => organisation.id === data.pharmacyId) + const selectedPharmacyIds = data.addToPharmacyIds + ? (Array.isArray(data.addToPharmacyIds) ? data.addToPharmacyIds : [data.addToPharmacyIds]) + : [] + const pharmacies = data.organisations.filter((organisation) => selectedPharmacyIds.includes(organisation.id)) + if (pharmacies.length === 0) { + return res.redirect(`/pharmacies/users/${userId}/add-to`) + } res.render('pharmacies/users/add-to-check', { user, - pharmacy + pharmacies }) }) @@ -488,21 +744,46 @@ module.exports = router => { const data = req.session.data const id = req.params.id const user = data.users.find(user => user.id === id) - const pharmacy = data.organisations.find(organisation => organisation.id === data.pharmacyId) - user.organisations.push({ - id: pharmacy.id, - status: 'Active', - permissionLevel: data.permissionLevel, - vaccinator: (data.vaccinator === 'yes') - }) + const selectedPharmacyIds = data.addToPharmacyIds + ? (Array.isArray(data.addToPharmacyIds) ? data.addToPharmacyIds : [data.addToPharmacyIds]) + : [] + const pharmacies = data.organisations.filter((organisation) => selectedPharmacyIds.includes(organisation.id)) + + if (pharmacies.length === 0) { + return res.redirect(`/pharmacies/users/${id}/add-to`) + } + + const existingOrganisationIds = (user.organisations || []).map(organisation => organisation.id) + + const addedPharmacyIds = [] + + for (const pharmacy of pharmacies) { + if (!existingOrganisationIds.includes(pharmacy.id)) { + user.organisations.push({ + id: pharmacy.id, + status: 'Active', + permissionLevel: data.permissionLevel, + vaccinator: (data.vaccinator === 'yes') + }) + addedPharmacyIds.push(pharmacy.id) + } + } // Reset answers data.permissionLevel = '' data.vaccinator = '' - data.pharmacyId = '' + data.addToPharmacyIds = [] - res.redirect(`/pharmacies/users/${id}?addedToPharmacyId=${pharmacy.id}`) + if (addedPharmacyIds.length === 0) { + return res.redirect(`/pharmacies/users/${id}`) + } + + if (addedPharmacyIds.length > 1) { + res.redirect(`/pharmacies/users/${id}?addedToPharmacyIds=${addedPharmacyIds.join(',')}`) + } else { + res.redirect(`/pharmacies/users/${id}?addedToPharmacyId=${addedPharmacyIds[0]}`) + } }) @@ -511,10 +792,18 @@ module.exports = router => { const id = req.params.id const added = req.query.added const addedUserId = req.query.addedUserId + const deactivated = req.query.deactivated + const deactivatedUserId = req.query.deactivatedUserId + const deactivatedFromPharmacyId = req.query.deactivatedFromPharmacyId + const reactivatedUserId = req.query.reactivatedUserId + const reactivatedFromPharmacyId = req.query.reactivatedFromPharmacyId + const tab = (req.query.tab || 'active').toLowerCase() const organisation = data.organisations.find((organisation) => organisation.id === id) const addedUser = data.users.find((user) => user.id === addedUserId) + const deactivatedUser = data.users.find((user) => user.id === deactivatedUserId) + const reactivatedUser = data.users.find((user) => user.id === reactivatedUserId) const userOrganisationPermissions = {} @@ -523,16 +812,43 @@ module.exports = router => { .find((orgPermission) => orgPermission.id === organisation.id) ) + const usersByStatus = { + invited: [], + active: [], + deactivated: [] + } + for (const user of users) { userOrganisationPermissions[user.id] = user.organisations.find((userOrganisation) => userOrganisation.id === organisation.id) + + const userOrganisationStatus = userOrganisationPermissions[user.id].status + + if (userOrganisationStatus === 'Invited') { + usersByStatus.invited.push(user) + } else if (userOrganisationStatus === 'Deactivated') { + usersByStatus.deactivated.push(user) + } else { + usersByStatus.active.push(user) + } } + const validTabs = ['invited', 'active', 'deactivated'] + const currentTab = validTabs.includes(tab) ? tab : 'active' + const usersForTab = usersByStatus[currentTab] + res.render('pharmacies/pharmacy', { organisation, - users, + users: usersForTab, + usersByStatus, + currentTab, userOrganisationPermissions, added, - addedUser + addedUser, + deactivated, + deactivatedUser, + deactivatedFromPharmacyId, + reactivatedUser, + reactivatedFromPharmacyId }) }) @@ -543,27 +859,53 @@ module.exports = router => { const user = data.users.find((user) => user.id === id) const companyId = res.locals.currentOrganisation.id + if (!user) { + return res.redirect('/pharmacies/users') + } + const addedToPharmacyId = req.query.addedToPharmacyId + const addedToPharmacyIds = req.query.addedToPharmacyIds const deactivatedFromPharmacyId = req.query.deactivatedFromPharmacyId + const deactivatedFromAllPharmacies = req.query.deactivatedFromAllPharmacies === 'true' + const deactivatedFromAllPharmacyIds = (req.query.deactivatedFromAllPharmacyIds || '').split(',').filter(Boolean) + const deactivatedFromAllCount = deactivatedFromAllPharmacyIds.length - let addedToPharmacy, deactivatedFromPharmacy + let addedToPharmacy, addedToPharmacies, deactivatedFromPharmacy if (addedToPharmacyId) { addedToPharmacy = data.organisations.find(organisation => organisation.id === addedToPharmacyId) } + if (addedToPharmacyIds) { + const ids = addedToPharmacyIds.split(',').filter(Boolean) + addedToPharmacies = data.organisations.filter((organisation) => ids.includes(organisation.id)) + } if (deactivatedFromPharmacyId) { deactivatedFromPharmacy = data.organisations.find(organisation => organisation.id === deactivatedFromPharmacyId) } const totalPharmaciesAtOrganisation = data.organisations.filter(organisation => organisation.companyId === companyId).length - const pharmacyRoles = (user.organisations || []).filter(role => role.permissionLevel !== "Group administrator") + const pharmacyRoles = (user.organisations || []) + .filter((role) => role.permissionLevel !== 'Group administrator') + .filter((role) => role.status !== 'Deactivated') + .map((role) => { + const pharmacy = data.organisations.find((organisation) => organisation.id === role.id) + + return { + ...role, + pharmacy + } + }) + .filter((role) => role.pharmacy && role.pharmacy.companyId === companyId) - res.render('pharmacies/users/user', { + res.render('pharmacies/users/manage-ind-user', { user, pharmacyRoles, addedToPharmacy, + addedToPharmacies, deactivatedFromPharmacy, + deactivatedFromAllPharmacies, + deactivatedFromAllCount, totalPharmaciesAtOrganisation }) }) diff --git a/app/views/appointments/_cancelled.html b/app/views/appointments/_cancelled.html index 58e90892..b5e5c173 100644 --- a/app/views/appointments/_cancelled.html +++ b/app/views/appointments/_cancelled.html @@ -25,7 +25,7 @@
From: NHS Record a vaccination service (RAVS)
+ Subject: Start using Record a vaccination at (Pharmacy company)
+
Dear (Name),
+ +You’ve been invited to use the NHS Record a vaccination service as a group administrator for (Pharmacy company).
+ +Get started
+ +We’ve created an Okta account for you to securely access the service.
+ +Here’s what you need to do:
+ +1. Activate your Okta account
+ +You’ll receive a 'Welcome to Okta' email (from noreply@okta.com).
+ +Activate the link within 7 days.
+ +If you cannot find the email, check your spam or junk.
+ +2. Log in to Record a vaccination
+ +Once you've activated your Okta account, log in to www.ravs.england.nhs.uk using your Okta username and password.
+ +You can also access the service through your Okta account by selecting 'RAVS (PROD) app'.
+ +Training and support
+To help you get started, you can:
+ +Kind regards,
+ NHS Record a vaccination
{{ existingUser.firstName }} {{ existingUser.lastName }} will receive this email inviting them to use the service at {{ organisation.name }} ({{ organisation.id }}).
+{{ existingUser.firstName }} {{ existingUser.lastName }} will receive this email.
{% else %} -{{ data.firstName }} {{ data.lastName }} will receive this email inviting them to use the service at {{ organisation.name }} ({{ organisation.id }}).
+{{ data.firstName }} {{ data.lastName }} will receive this email.
{% endif %}