diff --git a/server/routes/personalDetails.ts b/server/routes/personalDetails.ts index e3a0d91c..9c52e37d 100644 --- a/server/routes/personalDetails.ts +++ b/server/routes/personalDetails.ts @@ -8,6 +8,7 @@ import ArnsApiClient from '../data/arnsApiClient' import TierApiClient from '../data/tierApiClient' import type { Route } from '../@types' import { toPredictors, toRoshWidget } from '../utils/utils' +import renders from '../controllers/renders' export default function personalDetailRoutes(router: Router, { hmppsAuthClient }: Services) { const get = (path: string | string[], handler: Route) => router.get(path, asyncMiddleware(handler)) @@ -47,6 +48,8 @@ export default function personalDetailRoutes(router: Router, { hmppsAuthClient } }) }) + get('/case/:crn/personal-details/staff-contacts', renders.staffContacts(hmppsAuthClient)) + get('/case/:crn/personal-details/personal-contact/:id', async (req, res, _next) => { const { crn } = req.params const { id } = req.params diff --git a/server/views/pages/personal-details.njk b/server/views/pages/personal-details.njk index 093d0a38..d4a2aa52 100644 --- a/server/views/pages/personal-details.njk +++ b/server/views/pages/personal-details.njk @@ -359,8 +359,7 @@ attributes: {'data-qa': 'identityNumberCard'}, titleText: "Identity numbers", classes: 'govuk-!-margin-bottom-6 app-summary-card--large-title', - html: identityNumbers, - actions: {} + html: identityNumbers }) }} {% if personalDetails.staffContacts %} @@ -368,7 +367,7 @@ {% for staffContact in personalDetails.staffContacts %} {% set staffContactRows = (staffContactRows.push({ key: { html: '' + staffContact.role + '
Last updated ' + staffContact.lastUpdated | dateWithYear + '' }, - value: { html: '' + staffContact.name + '' } + value: { html: '' + staffContact.name + '' } }), staffContactRows) %} {% endfor %} @@ -383,7 +382,14 @@ titleText: "Staff contacts", classes: 'govuk-!-margin-bottom-6 app-summary-card--large-title', html: staffContactList, - actions: {} + actions: { + items: [ + { + text: 'View staff contacts', + href: '/case/' + crn + '/personal-details/staff-contacts' + } + ] + } }) }} {% endif %} diff --git a/wiremock/mappings/X000001-full.json b/wiremock/mappings/X000001-full.json index 2e83416c..ba961dd5 100644 --- a/wiremock/mappings/X000001-full.json +++ b/wiremock/mappings/X000001-full.json @@ -321,28 +321,37 @@ ], "staffContacts": [ { - "contactId": "123", "name": "Arhsimna Xolfo", - "email": "", - "telephoneNumber": "", "role": "Prison Offender Manager (POM)", - "lastUpdated": "2024-11-15" + "email": "arhsimna.xolfo@moj.gov.uk", + "telephoneNumber": "07321165373", + "provider": "London", + "probationDeliveryUnit": "All London", + "team": "Unallocated Team (N07)", + "allocatedUntil": "2025-04-22", + "lastUpdated": "2024-04-30" }, { - "contactId": "456", "name": "Yrhreender Hanandra", - "email": "", - "telephoneNumber": "", "role": "Community Offender Manager (COM)", - "lastUpdated": "2024-11-15" + "email": "yrhreender.hanandra@moj.gov.uk", + "telephoneNumber": "07321165373", + "provider": "London", + "probationDeliveryUnit": "All London", + "team": "Unallocated Team (N07)", + "allocatedUntil": "2025-04-22", + "lastUpdated": "2024-04-30" }, { - "contactId": "789", "name": "Iwendeps Yvygsee", - "email": "", - "telephoneNumber": "", "role": "Probation practitioner", - "lastUpdated": "2024-11-15" + "email": "iwendeps.yvygsee@moj.gov.uk", + "telephoneNumber": "07321165373", + "provider": "London", + "probationDeliveryUnit": "All London", + "team": "Unallocated Team (N07)", + "allocatedUntil": "2025-04-22", + "lastUpdated": "2024-04-30" } ], "mainAddress": {