From 2bd057632c0047e0127390f2d88d66b116992d58 Mon Sep 17 00:00:00 2001 From: Andrew Charnley Date: Thu, 16 Nov 2023 15:13:08 +0000 Subject: [PATCH 01/10] feat: accessibility statement page --- server/controllers/staticController.test.ts | 9 ++ server/controllers/staticController.ts | 6 ++ .../paths/temporary-accommodation/static.ts | 2 + .../routes/temporary-accommodation/index.ts | 3 + server/views/partials/layout.njk | 4 + .../static/accessibilityStatement.njk | 94 +++++++++++++++++++ 6 files changed, 118 insertions(+) create mode 100644 server/views/temporary-accommodation/static/accessibilityStatement.njk diff --git a/server/controllers/staticController.test.ts b/server/controllers/staticController.test.ts index bae98bc63..b7ed14964 100644 --- a/server/controllers/staticController.test.ts +++ b/server/controllers/staticController.test.ts @@ -23,6 +23,15 @@ describe('StaticController', () => { }) }) + describe('accessibility statement', () => { + it('should render the page', () => { + const requestHandler = staticController.accessibilityStatement() + requestHandler(request, response, next) + + expect(response.render).toHaveBeenCalledWith('temporary-accommodation/static/accessibilityStatement') + }) + }) + describe('useNDelius', () => { it('should render the disabled-region page', () => { const requestHandler = staticController.useNDelius() diff --git a/server/controllers/staticController.ts b/server/controllers/staticController.ts index 38a858332..35644e493 100644 --- a/server/controllers/staticController.ts +++ b/server/controllers/staticController.ts @@ -7,6 +7,12 @@ export default class StaticController { } } + accessibilityStatement(): RequestHandler { + return (_req: Request, res: Response) => { + res.render('temporary-accommodation/static/accessibilityStatement') + } + } + useNDelius(): RequestHandler { return (_req: Request, res: Response) => { res.render('temporary-accommodation/static/useNDelius') diff --git a/server/paths/temporary-accommodation/static.ts b/server/paths/temporary-accommodation/static.ts index a4580e36f..eb6fff277 100644 --- a/server/paths/temporary-accommodation/static.ts +++ b/server/paths/temporary-accommodation/static.ts @@ -3,10 +3,12 @@ import { temporaryAccommodationPath } from '../service' const cookiesPath = temporaryAccommodationPath.path('cookies') const useNDeliusPath = temporaryAccommodationPath.path('use-ndelius') const notAuthorisedPath = temporaryAccommodationPath.path('not-authorised') +const accessibilityStatementPath = temporaryAccommodationPath.path('accessibility-statement') const paths = { static: { cookies: cookiesPath, + accessibilityStatement: accessibilityStatementPath, useNDelius: useNDeliusPath, notAuthorised: notAuthorisedPath, }, diff --git a/server/routes/temporary-accommodation/index.ts b/server/routes/temporary-accommodation/index.ts index f04707b45..42c0202b0 100644 --- a/server/routes/temporary-accommodation/index.ts +++ b/server/routes/temporary-accommodation/index.ts @@ -18,6 +18,9 @@ export default function routes(controllers: Controllers, services: Services): Ro get('/', landingController.index(), { auditEvent: 'VIEW_LANDING' }) get(paths.static.cookies.pattern, staticController.cookies(), { auditEvent: 'VIEW_COOKIES' }) + get(paths.static.accessibilityStatement.pattern, staticController.accessibilityStatement(), { + auditEvent: 'VIEW_ACCESSIBILITY_STATEMENT', + }) get(paths.static.useNDelius.pattern, staticController.useNDelius(), { auditEvent: 'VIEW_USE_NDELIUS' }) get(paths.static.notAuthorised.pattern, staticController.notAuthorised(), { auditEvent: 'VIEW_NOT_AUTHORISED' }) diff --git a/server/views/partials/layout.njk b/server/views/partials/layout.njk index c4ef71550..428ca6723 100644 --- a/server/views/partials/layout.njk +++ b/server/views/partials/layout.njk @@ -47,6 +47,10 @@ { href: paths.static.cookies({}), text: "Cookies" + }, + { + href: paths.static.accessibilityStatement({}), + text: "Accessibility statement" } ] }, diff --git a/server/views/temporary-accommodation/static/accessibilityStatement.njk b/server/views/temporary-accommodation/static/accessibilityStatement.njk new file mode 100644 index 000000000..7b0a8b4c3 --- /dev/null +++ b/server/views/temporary-accommodation/static/accessibilityStatement.njk @@ -0,0 +1,94 @@ +{% extends "partials/layout.njk" %} + +{% set pageTitle = "Accessibility Statement - " + applicationName %} + +{% block content %} +
+
+

Accessibility statement for the Transitional Accommodation service (CAS3)

+

This accessibility statement applies to the Transitional Accommodation (CAS3) digital service.

+

This service is run by the Ministry of Justice. We want as many people as possible to be able to use this service. + For example, that means you should be able to:

+
    +
  • change colours and contrast levels using browser or device settings
  • +
  • zoom in up to 400% without the text spilling off the screen
  • +
  • navigate most of the website using a keyboard or speech recognition software
  • +
  • use the website using a screen reader (including the most recent versions of JAWS, NVDA and VoiceOver) although there will be some problems - see below
  • +
  • We’ve also made the website text as simple as possible to understand.
  • +
+

+ We’ve also made the website text as simple as possible to understand. +

+

+ AbilityNet has advice on making your device easier to use if you have a disability. +

+

How accessible this website is

+

+ We know some parts of this website are not fully accessible: +

+
    +
  • Screen reader users will find some form questions with checkboxes, radio buttons and text areas are hard to link to the correct question without reading the whole page in sequence. They may also find the table sort feature to be hard to use and will speak too much text.
  • +
  • Links in the header may be confusing because the HMPPS” and “Temporary Accommodation” links actually go to the same page.
  • +
  • People with low vision may find it hard to see the focus indicator on the View a Bedspace page.
  • +
  • The navigation is disorienting when moving from bedspace search to viewing a bedspace on the ‘Search for Available Bedspaces’ page.
  • +
+

Feedback and contact information

+

+ If you find any problems not listed on this page or think we’re not meeting accessibility requirements, email the CAS3 digital team with details of the issue you have experienced. +

+

+ Email: cas3support@digital.justice.gov.uk +

+

+ We’ll consider your request and get back to you within 2 working days. +

+

Enforcement procedure

+

+ The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies + (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’). + If you’re not happy with how we respond to your complaint, contact the Equality Advisory and Support Service (EASS). +

+

Technical information about this website’s accessibility

+

+ The Ministry of Justice is committed to making its website accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018. +

+

Compliance status

+

+ This website is partially compliant with the Web Content Accessibility Guidelines version 2.2 AA standard, due to the non-compliances listed below. +

+

Non-accessible content

+

+ The content listed below is non-accessible for the following reasons. +

+
    +
  • Radio buttons are not programmatically associated with the question, and screen reader users may struggle to connect these radio buttons to the respective question (test issue 1.2). This fails WCAG 2.2 success criterion 1.3.1 (A). We plan to fix this by 30/03 2024.
  • +
  • Date input fields are not grouped with questions, so screen reader users may find it challenging to associate the date input field with the relevant question (test issue 1.3). This fails WCAG 2.2 success criterion 1.3.1 (A). We plan to fix this by 30/03 2024.
  • +
  • Conditionally revealed information is not announced to screen reader users on the Accommodation Needs page (test issue 1.4). This fails WCAG 2.2 success criterion 4.1.3 (AA). We plan to fix this by 30/03 2024.
  • +
  • Adjacent links go to the same target. On the page header, both the HMPPS logo and the adjacent text go to the same target URL. This can result in additional navigation and repetition for keyboard and screen reader users. Additionally, screen readers announce the two links differently: the first is announced as “HMPPS” while the second is announced as “Temporary Accommodation”. This could be confusing for screen reader users who might expect both links to go to different targets (test issue 1.5). This fails WCAG 2.2 success criteria 2.4.4 (A) and 3.2.4 (AA). We plan to fix this by 30/03 2024.
  • +
  • Throughout the site, the majority of textarea elements are not programmatically associated with the question they are related to. so screen reader users would need to navigate around the page to understand what question that area relates to (test issue 1.6). This fails WCAG 2.2 success criterion 1.3.1 (A). We plan to fix this by 30/03 2024.
  • +
  • On the Back Up Contact/Senior Probation Officer Details page, there is no programmatic association between the form fields and the associated question (test issue 2.3). This fails WCAG 2.2 success criterion 1.3.1 (A). We plan to fix this by 30/03 2024.
  • +
  • Checkboxes are not associated with the question throughout the services so screen reader users would need to navigate around the page to find what question the checkboxes are related to (test issue 2.4). This fails WCAG 2.2 success criterion 1.3.1 (A). We plan to fix this by 30/03 2024.
  • +
  • Sort icon buttons are not informative for screen reader users as they do not describe the function of the arrows and create audible clutter (test issue 3.2). This fails WCAG 2.2 success criterion 1.3.1 (A). We plan to fix this by 30/03 2024.
  • +
  • The focus indicator does not meet contrast requirements on View a Bedspace page - white text on yellow background when in focus (test issue 3.3). This fails WCAG 2.2 success criteria 1.4.3 (AA) and 1.4.11 (AA). We plan to fix this by 30/03 2024.
  • +
  • The navigation is disorienting when moving from bedspace search to viewing a bedspace on the ‘Search for Available Bedspaces’ page (test issue 3.4). This fails WCAG 2.2 success criterion 3.2.2 (A). We plan to fix this by 30/03 2024.
  • +
+

What we’re doing to improve accessibility

+

+ The improvements to accessibility in order to be fully compliant are in the CAS3 project backlog to be worked on over the course of the next 12 months. +

+

Preparation of this accessibility statement

+

+ This statement was prepared on 24 October 2023. It was last reviewed on 24 October 2023. +

+

+ This website was last tested on 25 September 2023. +

+

+ The test was carried out by User Vision Ltd, an independent accessibility testing company, to the WCAG 2.2 AA standard. +

+

+ You can read the full accessibility test report. +

+
+
+{% endblock %} \ No newline at end of file From 7afc792e77a57576a0b080785fcfd2e83569fcbc Mon Sep 17 00:00:00 2001 From: "communityaccommodationtypegen[bot]" Date: Thu, 16 Nov 2023 16:10:33 +0000 Subject: [PATCH 02/10] Updating hmpps-approved-premises-api models from OpenAPI specification --- server/@types/shared/index.d.ts | 1 + .../shared/models/ApprovedPremisesApplicationStatus.ts | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 server/@types/shared/models/ApprovedPremisesApplicationStatus.ts diff --git a/server/@types/shared/index.d.ts b/server/@types/shared/index.d.ts index a2090a0ba..2c1f2edcf 100644 --- a/server/@types/shared/index.d.ts +++ b/server/@types/shared/index.d.ts @@ -14,6 +14,7 @@ export type { ApplicationSummary } from './models/ApplicationSummary'; export type { ApplicationTimelineNote } from './models/ApplicationTimelineNote'; export type { ApprovedPremises } from './models/ApprovedPremises'; export type { ApprovedPremisesApplication } from './models/ApprovedPremisesApplication'; +export type { ApprovedPremisesApplicationStatus } from './models/ApprovedPremisesApplicationStatus'; export type { ApprovedPremisesApplicationSummary } from './models/ApprovedPremisesApplicationSummary'; export type { ApprovedPremisesAssessment } from './models/ApprovedPremisesAssessment'; export type { ApprovedPremisesAssessmentStatus } from './models/ApprovedPremisesAssessmentStatus'; diff --git a/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts b/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts new file mode 100644 index 000000000..8aca4f174 --- /dev/null +++ b/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ApprovedPremisesApplicationStatus = 'started' | 'submitted' | 'rejected' | 'awaitingAssesment' | 'unallocatedAssesment' | 'assesmentInProgress' | 'awaitingPlacement' | 'placementAllocated' | 'inapplicable' | 'withdrawn' | 'requestedFurtherInformation'; From 56a7837e324c30d859b37464323180c61157d664 Mon Sep 17 00:00:00 2001 From: "communityaccommodationtypegen[bot]" Date: Fri, 17 Nov 2023 09:54:06 +0000 Subject: [PATCH 03/10] Updating hmpps-approved-premises-api models from OpenAPI specification --- server/@types/shared/index.d.ts | 1 + .../shared/models/ApprovedPremisesApplicationStatus.ts | 6 ++++++ server/@types/shared/models/Cas2SubmittedApplication.ts | 2 -- .../@types/shared/models/Cas2SubmittedApplicationSummary.ts | 2 -- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 server/@types/shared/models/ApprovedPremisesApplicationStatus.ts diff --git a/server/@types/shared/index.d.ts b/server/@types/shared/index.d.ts index a2090a0ba..2c1f2edcf 100644 --- a/server/@types/shared/index.d.ts +++ b/server/@types/shared/index.d.ts @@ -14,6 +14,7 @@ export type { ApplicationSummary } from './models/ApplicationSummary'; export type { ApplicationTimelineNote } from './models/ApplicationTimelineNote'; export type { ApprovedPremises } from './models/ApprovedPremises'; export type { ApprovedPremisesApplication } from './models/ApprovedPremisesApplication'; +export type { ApprovedPremisesApplicationStatus } from './models/ApprovedPremisesApplicationStatus'; export type { ApprovedPremisesApplicationSummary } from './models/ApprovedPremisesApplicationSummary'; export type { ApprovedPremisesAssessment } from './models/ApprovedPremisesAssessment'; export type { ApprovedPremisesAssessmentStatus } from './models/ApprovedPremisesAssessmentStatus'; diff --git a/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts b/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts new file mode 100644 index 000000000..8aca4f174 --- /dev/null +++ b/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ApprovedPremisesApplicationStatus = 'started' | 'submitted' | 'rejected' | 'awaitingAssesment' | 'unallocatedAssesment' | 'assesmentInProgress' | 'awaitingPlacement' | 'placementAllocated' | 'inapplicable' | 'withdrawn' | 'requestedFurtherInformation'; diff --git a/server/@types/shared/models/Cas2SubmittedApplication.ts b/server/@types/shared/models/Cas2SubmittedApplication.ts index 3a732a8ec..2e4f25f64 100644 --- a/server/@types/shared/models/Cas2SubmittedApplication.ts +++ b/server/@types/shared/models/Cas2SubmittedApplication.ts @@ -4,7 +4,6 @@ /* eslint-disable */ import type { AnyValue } from './AnyValue'; -import type { ApplicationStatus } from './ApplicationStatus'; import type { Cas2StatusUpdate } from './Cas2StatusUpdate'; import type { NomisUser } from './NomisUser'; import type { Person } from './Person'; @@ -17,7 +16,6 @@ export type Cas2SubmittedApplication = { schemaVersion: string; outdatedSchema: boolean; document?: AnyValue; - status: ApplicationStatus; submittedAt?: string; statusUpdates?: Array; }; diff --git a/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts b/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts index f793c8e78..37eae3629 100644 --- a/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts +++ b/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts @@ -3,13 +3,11 @@ /* tslint:disable */ /* eslint-disable */ -import type { ApplicationStatus } from './ApplicationStatus'; import type { Person } from './Person'; export type Cas2SubmittedApplicationSummary = { id: string; createdByUserId: string; - status: ApplicationStatus; person: Person; createdAt: string; submittedAt?: string; From 3c85a6953cb155e6a1bd830c54988eab5cdefe56 Mon Sep 17 00:00:00 2001 From: Andrew Charnley Date: Fri, 17 Nov 2023 11:52:38 +0000 Subject: [PATCH 04/10] tidy: remove unnecessary value checking of string, as it's done downstream' --- server/controllers/landingController.test.ts | 3 +-- .../manage/reportsController.test.ts | 3 +-- server/middleware/userCheckMiddleware.test.ts | 8 ++++---- server/utils/userUtils.test.ts | 4 ++-- server/utils/userUtils.ts | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/server/controllers/landingController.test.ts b/server/controllers/landingController.test.ts index 8b01c6551..630843ce2 100644 --- a/server/controllers/landingController.test.ts +++ b/server/controllers/landingController.test.ts @@ -8,7 +8,6 @@ import { userFactory } from '../testutils/factories' import { UnauthorizedError } from '../utils/errors' import { isApplyEnabledForUser } from '../utils/userUtils' import LandingController from './landingController' -import { TemporaryAccommodationUserRole } from '../@types/shared' jest.mock('../utils/userUtils', () => { const module = jest.requireActual('../utils/userUtils') @@ -97,7 +96,7 @@ describe('LandingController', () => { const response: DeepMocked = createMock({ locals: { user: userFactory.build({ - roles: ['reporter' as TemporaryAccommodationUserRole], + roles: ['reporter'], }), }, }) diff --git a/server/controllers/temporary-accommodation/manage/reportsController.test.ts b/server/controllers/temporary-accommodation/manage/reportsController.test.ts index 79c6ca6a5..9bca224ff 100644 --- a/server/controllers/temporary-accommodation/manage/reportsController.test.ts +++ b/server/controllers/temporary-accommodation/manage/reportsController.test.ts @@ -9,7 +9,6 @@ import extractCallConfig from '../../../utils/restUtils' import { filterProbationRegions } from '../../../utils/userUtils' import { getYearsSince, monthsArr } from '../../../utils/dateUtils' import { catchValidationErrorOrPropogate, fetchErrorsAndUserInput, insertGenericError } from '../../../utils/validation' -import { TemporaryAccommodationUserRole } from '../../../@types/shared' jest.mock('../../../utils/validation') jest.mock('../../../utils/restUtils') @@ -108,7 +107,7 @@ describe('ReportsController', () => { ;(getYearsSince as jest.Mock).mockReturnValue([]) response = createMock({ - locals: { user: userFactory.build({ roles: ['reporter' as TemporaryAccommodationUserRole] }) }, + locals: { user: userFactory.build({ roles: ['reporter'] }) }, }) await requestHandler(request, response, next) diff --git a/server/middleware/userCheckMiddleware.test.ts b/server/middleware/userCheckMiddleware.test.ts index 882df80f5..82cc63b56 100644 --- a/server/middleware/userCheckMiddleware.test.ts +++ b/server/middleware/userCheckMiddleware.test.ts @@ -2,7 +2,7 @@ import { createMock } from '@golevelup/ts-jest' import { Request, Response } from 'express' import { userFactory } from '../testutils/factories' import { UnauthorizedError } from '../utils/errors' -import { TemporaryAccommodationUserRole, TemporaryAccommodationUser as User } from '../@types/shared' +import { TemporaryAccommodationUser as User } from '../@types/shared' import { createUserCheckMiddleware, userIsAuthorisedForManage } from './userCheckMiddleware' import paths from '../paths/temporary-accommodation/manage' @@ -91,7 +91,7 @@ describe('createUserCheckMiddleware', () => { const request = createMock({ path: paths.reports.new({}) }) const response = createMock({ locals: { - user: userFactory.build({ roles: ['reporter' as TemporaryAccommodationUserRole] }), + user: userFactory.build({ roles: ['reporter'] }), }, }) const next = jest.fn() @@ -108,7 +108,7 @@ describe('createUserCheckMiddleware', () => { const request = createMock({ path: paths.reports.create({}) }) const response = createMock({ locals: { - user: userFactory.build({ roles: ['reporter' as TemporaryAccommodationUserRole] }), + user: userFactory.build({ roles: ['reporter'] }), }, }) const next = jest.fn() @@ -125,7 +125,7 @@ describe('createUserCheckMiddleware', () => { const request = createMock({ path: paths.assessments.index({}) }) const response = createMock({ locals: { - user: userFactory.build({ roles: ['reporter' as TemporaryAccommodationUserRole] }), + user: userFactory.build({ roles: ['reporter'] }), }, }) const next = jest.fn() diff --git a/server/utils/userUtils.test.ts b/server/utils/userUtils.test.ts index 233ba66f7..ae0d29b0b 100644 --- a/server/utils/userUtils.test.ts +++ b/server/utils/userUtils.test.ts @@ -10,7 +10,7 @@ import { userHasReferrerRoleAndIsApplyEnabled, userHasReporterRole, } from './userUtils' -import { TemporaryAccommodationUserRole as Role, TemporaryAccommodationUserRole } from '../@types/shared' +import { TemporaryAccommodationUserRole as Role } from '../@types/shared' import config from '../config' jest.mock('./enabledRegions', () => { @@ -122,7 +122,7 @@ describe('userHasAssessorRole', () => { describe('userHasReporterRole', () => { it('returns true when user has got the role "reporter"', () => { - const user = userFactory.build({ roles: ['reporter' as TemporaryAccommodationUserRole] }) + const user = userFactory.build({ roles: ['reporter'] }) expect(userHasReporterRole(user)).toBe(true) }) diff --git a/server/utils/userUtils.ts b/server/utils/userUtils.ts index 2efb2de7c..fd0829ed9 100644 --- a/server/utils/userUtils.ts +++ b/server/utils/userUtils.ts @@ -1,5 +1,5 @@ import { Request } from 'express' -import { ProbationRegion, TemporaryAccommodationUserRole, TemporaryAccommodationUser as User } from '../@types/shared' +import { ProbationRegion, TemporaryAccommodationUser as User } from '../@types/shared' import enabledRegions from './enabledRegions' import config from '../config' @@ -20,7 +20,7 @@ export function userHasAssessorRole(user: User): boolean { } export function userHasReporterRole(user: User): boolean { - return user.roles.includes('reporter' as TemporaryAccommodationUserRole) + return user.roles.includes('reporter') } export function userHasReferrerRoleAndIsApplyEnabled(user: User): boolean { From 561d558ac8ddbc16ecd21a951e8c04b470eb04a7 Mon Sep 17 00:00:00 2001 From: "communityaccommodationtypegen[bot]" Date: Mon, 20 Nov 2023 17:00:55 +0000 Subject: [PATCH 05/10] Updating hmpps-approved-premises-api models from OpenAPI specification --- server/@types/shared/index.d.ts | 1 + server/@types/shared/models/ApprovedPremisesApplication.ts | 4 ++-- .../shared/models/ApprovedPremisesApplicationStatus.ts | 6 ++++++ .../shared/models/ApprovedPremisesApplicationSummary.ts | 4 ++-- server/@types/shared/models/Cas2SubmittedApplication.ts | 2 -- .../@types/shared/models/Cas2SubmittedApplicationSummary.ts | 2 -- server/@types/shared/models/MigrationJobType.ts | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 server/@types/shared/models/ApprovedPremisesApplicationStatus.ts diff --git a/server/@types/shared/index.d.ts b/server/@types/shared/index.d.ts index a2090a0ba..2c1f2edcf 100644 --- a/server/@types/shared/index.d.ts +++ b/server/@types/shared/index.d.ts @@ -14,6 +14,7 @@ export type { ApplicationSummary } from './models/ApplicationSummary'; export type { ApplicationTimelineNote } from './models/ApplicationTimelineNote'; export type { ApprovedPremises } from './models/ApprovedPremises'; export type { ApprovedPremisesApplication } from './models/ApprovedPremisesApplication'; +export type { ApprovedPremisesApplicationStatus } from './models/ApprovedPremisesApplicationStatus'; export type { ApprovedPremisesApplicationSummary } from './models/ApprovedPremisesApplicationSummary'; export type { ApprovedPremisesAssessment } from './models/ApprovedPremisesAssessment'; export type { ApprovedPremisesAssessmentStatus } from './models/ApprovedPremisesAssessmentStatus'; diff --git a/server/@types/shared/models/ApprovedPremisesApplication.ts b/server/@types/shared/models/ApprovedPremisesApplication.ts index 7291602ba..3a1cc5d2e 100644 --- a/server/@types/shared/models/ApprovedPremisesApplication.ts +++ b/server/@types/shared/models/ApprovedPremisesApplication.ts @@ -5,7 +5,7 @@ import type { AnyValue } from './AnyValue'; import type { Application } from './Application'; -import type { ApplicationStatus } from './ApplicationStatus'; +import type { ApprovedPremisesApplicationStatus } from './ApprovedPremisesApplicationStatus'; import type { AssessmentDecision } from './AssessmentDecision'; import type { PersonRisks } from './PersonRisks'; @@ -21,7 +21,7 @@ export type ApprovedPremisesApplication = (Application & { outdatedSchema: boolean; data?: AnyValue; document?: AnyValue; - status: ApplicationStatus; + status: ApprovedPremisesApplicationStatus; assessmentId?: string; assessmentDecision?: AssessmentDecision; assessmentDecisionDate?: string; diff --git a/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts b/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts new file mode 100644 index 000000000..8aca4f174 --- /dev/null +++ b/server/@types/shared/models/ApprovedPremisesApplicationStatus.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ApprovedPremisesApplicationStatus = 'started' | 'submitted' | 'rejected' | 'awaitingAssesment' | 'unallocatedAssesment' | 'assesmentInProgress' | 'awaitingPlacement' | 'placementAllocated' | 'inapplicable' | 'withdrawn' | 'requestedFurtherInformation'; diff --git a/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts b/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts index 2287c88cf..09bba9401 100644 --- a/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts +++ b/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts @@ -3,8 +3,8 @@ /* tslint:disable */ /* eslint-disable */ -import type { ApplicationStatus } from './ApplicationStatus'; import type { ApplicationSummary } from './ApplicationSummary'; +import type { ApprovedPremisesApplicationStatus } from './ApprovedPremisesApplicationStatus'; import type { PersonRisks } from './PersonRisks'; export type ApprovedPremisesApplicationSummary = (ApplicationSummary & { @@ -15,7 +15,7 @@ export type ApprovedPremisesApplicationSummary = (ApplicationSummary & { arrivalDate?: string; risks?: PersonRisks; createdByUserId: string; - status: ApplicationStatus; + status: ApprovedPremisesApplicationStatus; tier?: string; }); diff --git a/server/@types/shared/models/Cas2SubmittedApplication.ts b/server/@types/shared/models/Cas2SubmittedApplication.ts index 3a732a8ec..2e4f25f64 100644 --- a/server/@types/shared/models/Cas2SubmittedApplication.ts +++ b/server/@types/shared/models/Cas2SubmittedApplication.ts @@ -4,7 +4,6 @@ /* eslint-disable */ import type { AnyValue } from './AnyValue'; -import type { ApplicationStatus } from './ApplicationStatus'; import type { Cas2StatusUpdate } from './Cas2StatusUpdate'; import type { NomisUser } from './NomisUser'; import type { Person } from './Person'; @@ -17,7 +16,6 @@ export type Cas2SubmittedApplication = { schemaVersion: string; outdatedSchema: boolean; document?: AnyValue; - status: ApplicationStatus; submittedAt?: string; statusUpdates?: Array; }; diff --git a/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts b/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts index f793c8e78..37eae3629 100644 --- a/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts +++ b/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts @@ -3,13 +3,11 @@ /* tslint:disable */ /* eslint-disable */ -import type { ApplicationStatus } from './ApplicationStatus'; import type { Person } from './Person'; export type Cas2SubmittedApplicationSummary = { id: string; createdByUserId: string; - status: ApplicationStatus; person: Person; createdAt: string; submittedAt?: string; diff --git a/server/@types/shared/models/MigrationJobType.ts b/server/@types/shared/models/MigrationJobType.ts index 5ecc2cdbe..ab1e28833 100644 --- a/server/@types/shared/models/MigrationJobType.ts +++ b/server/@types/shared/models/MigrationJobType.ts @@ -3,4 +3,4 @@ /* tslint:disable */ /* eslint-disable */ -export type MigrationJobType = 'update_all_users_from_community_api' | 'update_application_statuses'; +export type MigrationJobType = 'update_all_users_from_community_api'; From 579955e3779f4936d2041fc1bdc0eb2f5b38b97f Mon Sep 17 00:00:00 2001 From: "communityaccommodationtypegen[bot]" Date: Tue, 21 Nov 2023 13:39:41 +0000 Subject: [PATCH 06/10] Updating hmpps-approved-premises-api models from OpenAPI specification --- server/@types/shared/models/ApprovedPremisesApplication.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/@types/shared/models/ApprovedPremisesApplication.ts b/server/@types/shared/models/ApprovedPremisesApplication.ts index 7291602ba..3a1cc5d2e 100644 --- a/server/@types/shared/models/ApprovedPremisesApplication.ts +++ b/server/@types/shared/models/ApprovedPremisesApplication.ts @@ -5,7 +5,7 @@ import type { AnyValue } from './AnyValue'; import type { Application } from './Application'; -import type { ApplicationStatus } from './ApplicationStatus'; +import type { ApprovedPremisesApplicationStatus } from './ApprovedPremisesApplicationStatus'; import type { AssessmentDecision } from './AssessmentDecision'; import type { PersonRisks } from './PersonRisks'; @@ -21,7 +21,7 @@ export type ApprovedPremisesApplication = (Application & { outdatedSchema: boolean; data?: AnyValue; document?: AnyValue; - status: ApplicationStatus; + status: ApprovedPremisesApplicationStatus; assessmentId?: string; assessmentDecision?: AssessmentDecision; assessmentDecisionDate?: string; From 68f01058a8ab0d17871896cca87c263f9caad19f Mon Sep 17 00:00:00 2001 From: Andrew Charnley Date: Wed, 22 Nov 2023 10:54:01 +0000 Subject: [PATCH 07/10] fix: invalid application type casts --- .../accommodation-need/eligibility/eligibilityReason.ts | 2 +- .../behaviour-in-cas/previousStaysDetails.ts | 2 +- .../licence-conditions/additionalLicenceConditions.ts | 2 +- .../prison-information/acctAlerts.ts | 6 +++--- .../prison-information/adjudications.ts | 6 +++--- .../disability-cultural-and-specific-needs/needs.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/server/form-pages/apply/accommodation-need/eligibility/eligibilityReason.ts b/server/form-pages/apply/accommodation-need/eligibility/eligibilityReason.ts index 4fd152970..8738e26cb 100644 --- a/server/form-pages/apply/accommodation-need/eligibility/eligibilityReason.ts +++ b/server/form-pages/apply/accommodation-need/eligibility/eligibilityReason.ts @@ -1,4 +1,4 @@ -import { ApprovedPremisesApplication as Application } from '@approved-premises/api' +import { TemporaryAccommodationApplication as Application } from '@approved-premises/api' import type { TaskListErrors } from '@approved-premises/ui' import { Page } from '../../../utils/decorators' diff --git a/server/form-pages/apply/assess-placement-risks-and-needs/behaviour-in-cas/previousStaysDetails.ts b/server/form-pages/apply/assess-placement-risks-and-needs/behaviour-in-cas/previousStaysDetails.ts index 02489a727..87fcaa4a7 100644 --- a/server/form-pages/apply/assess-placement-risks-and-needs/behaviour-in-cas/previousStaysDetails.ts +++ b/server/form-pages/apply/assess-placement-risks-and-needs/behaviour-in-cas/previousStaysDetails.ts @@ -1,4 +1,4 @@ -import { ApprovedPremisesApplication as Application } from '@approved-premises/api' +import { TemporaryAccommodationApplication as Application } from '@approved-premises/api' import type { TaskListErrors } from '@approved-premises/ui' import { Page } from '../../../utils/decorators' diff --git a/server/form-pages/apply/assess-placement-risks-and-needs/licence-conditions/additionalLicenceConditions.ts b/server/form-pages/apply/assess-placement-risks-and-needs/licence-conditions/additionalLicenceConditions.ts index 77561efda..67d9cb43d 100644 --- a/server/form-pages/apply/assess-placement-risks-and-needs/licence-conditions/additionalLicenceConditions.ts +++ b/server/form-pages/apply/assess-placement-risks-and-needs/licence-conditions/additionalLicenceConditions.ts @@ -1,4 +1,4 @@ -import { ApprovedPremisesApplication as Application } from '@approved-premises/api' +import { TemporaryAccommodationApplication as Application } from '@approved-premises/api' import type { TaskListErrors } from '@approved-premises/ui' import { Page } from '../../../utils/decorators' diff --git a/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/acctAlerts.ts b/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/acctAlerts.ts index 504bd4b1d..a71baea19 100644 --- a/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/acctAlerts.ts +++ b/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/acctAlerts.ts @@ -1,4 +1,4 @@ -import type { ApprovedPremisesApplication, PersonAcctAlert } from '@approved-premises/api' +import type { TemporaryAccommodationApplication as Application, PersonAcctAlert } from '@approved-premises/api' import type { DataServices, PageResponse } from '@approved-premises/ui' import { CallConfig } from '../../../../data/restClient' import { DateFormats } from '../../../../utils/dateUtils' @@ -32,12 +32,12 @@ export default class AcctAlerts implements TasklistPage { constructor( readonly body: Partial, - readonly application: ApprovedPremisesApplication, + readonly application: Application, ) {} static async initialize( _: Record, - application: ApprovedPremisesApplication, + application: Application, callConfig: CallConfig, dataServices: DataServices, ) { diff --git a/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/adjudications.ts b/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/adjudications.ts index 0b233189b..c8a839b33 100644 --- a/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/adjudications.ts +++ b/server/form-pages/apply/assess-placement-risks-and-needs/prison-information/adjudications.ts @@ -1,4 +1,4 @@ -import type { Adjudication, ApprovedPremisesApplication } from '@approved-premises/api' +import type { Adjudication, TemporaryAccommodationApplication as Application } from '@approved-premises/api' import type { DataServices, PageResponse } from '@approved-premises/ui' import { CallConfig } from '../../../../data/restClient' import { DateFormats } from '../../../../utils/dateUtils' @@ -34,12 +34,12 @@ export default class Adjudications implements TasklistPage { constructor( readonly body: Partial, - readonly application: ApprovedPremisesApplication, + readonly application: Application, ) {} static async initialize( _: Record, - application: ApprovedPremisesApplication, + application: Application, callConfig: CallConfig, dataServices: DataServices, ) { diff --git a/server/form-pages/apply/requirements-for-placement/disability-cultural-and-specific-needs/needs.ts b/server/form-pages/apply/requirements-for-placement/disability-cultural-and-specific-needs/needs.ts index 3f6ce44c6..18c0371ab 100644 --- a/server/form-pages/apply/requirements-for-placement/disability-cultural-and-specific-needs/needs.ts +++ b/server/form-pages/apply/requirements-for-placement/disability-cultural-and-specific-needs/needs.ts @@ -1,4 +1,4 @@ -import { ApprovedPremisesApplication as Application } from '@approved-premises/api' +import { TemporaryAccommodationApplication as Application } from '@approved-premises/api' import type { TaskListErrors } from '@approved-premises/ui' import { Page } from '../../../utils/decorators' From c9f7ecffd90671bf444adbe1fbd42b42abf91c36 Mon Sep 17 00:00:00 2001 From: "communityaccommodationtypegen[bot]" Date: Wed, 22 Nov 2023 14:33:41 +0000 Subject: [PATCH 08/10] Updating hmpps-approved-premises-api models from OpenAPI specification --- server/@types/shared/models/ExternalUser.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/@types/shared/models/ExternalUser.ts b/server/@types/shared/models/ExternalUser.ts index 53f23eb65..4c8045d3b 100644 --- a/server/@types/shared/models/ExternalUser.ts +++ b/server/@types/shared/models/ExternalUser.ts @@ -6,6 +6,8 @@ export type ExternalUser = { id: string; username: string; + name: string; + email: string; origin?: string; }; From cb02cbae3b52d4733713e4d005aa30d0a85cf9b9 Mon Sep 17 00:00:00 2001 From: "communityaccommodationtypegen[bot]" Date: Thu, 23 Nov 2023 09:27:54 +0000 Subject: [PATCH 09/10] Updating hmpps-approved-premises-api models from OpenAPI specification --- server/@types/shared/models/ExternalUser.ts | 2 ++ .../shared/models/TemporaryAccommodationPremisesSummary.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/server/@types/shared/models/ExternalUser.ts b/server/@types/shared/models/ExternalUser.ts index 53f23eb65..4c8045d3b 100644 --- a/server/@types/shared/models/ExternalUser.ts +++ b/server/@types/shared/models/ExternalUser.ts @@ -6,6 +6,8 @@ export type ExternalUser = { id: string; username: string; + name: string; + email: string; origin?: string; }; diff --git a/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts b/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts index cc9700f8e..c6a017d14 100644 --- a/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts +++ b/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts @@ -7,6 +7,7 @@ import type { PremisesSummary } from './PremisesSummary'; export type TemporaryAccommodationPremisesSummary = (PremisesSummary & { pdu?: string; + localAuthorityAreaName?: string; } & { pdu: string; }); From 03195d863da6119db8c441b85e76d9b59757655c Mon Sep 17 00:00:00 2001 From: "communityaccommodationtypegen[bot]" Date: Thu, 23 Nov 2023 16:32:55 +0000 Subject: [PATCH 10/10] Updating hmpps-approved-premises-api models from OpenAPI specification --- server/@types/shared/index.d.ts | 1 + server/@types/shared/models/ExternalUser.ts | 2 ++ .../TemporaryAccommodationPremisesSummary.ts | 1 + server/@types/shared/models/UserWithWorkload.ts | 17 +++++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 server/@types/shared/models/UserWithWorkload.ts diff --git a/server/@types/shared/index.d.ts b/server/@types/shared/index.d.ts index 2c1f2edcf..cc3e8f92c 100644 --- a/server/@types/shared/index.d.ts +++ b/server/@types/shared/index.d.ts @@ -237,5 +237,6 @@ export type { User } from './models/User'; export type { UserQualification } from './models/UserQualification'; export type { UserRolesAndQualifications } from './models/UserRolesAndQualifications'; export type { UserSortField } from './models/UserSortField'; +export type { UserWithWorkload } from './models/UserWithWorkload'; export type { ValidationError } from './models/ValidationError'; export type { WithdrawalReason } from './models/WithdrawalReason'; diff --git a/server/@types/shared/models/ExternalUser.ts b/server/@types/shared/models/ExternalUser.ts index 53f23eb65..4c8045d3b 100644 --- a/server/@types/shared/models/ExternalUser.ts +++ b/server/@types/shared/models/ExternalUser.ts @@ -6,6 +6,8 @@ export type ExternalUser = { id: string; username: string; + name: string; + email: string; origin?: string; }; diff --git a/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts b/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts index cc9700f8e..c6a017d14 100644 --- a/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts +++ b/server/@types/shared/models/TemporaryAccommodationPremisesSummary.ts @@ -7,6 +7,7 @@ import type { PremisesSummary } from './PremisesSummary'; export type TemporaryAccommodationPremisesSummary = (PremisesSummary & { pdu?: string; + localAuthorityAreaName?: string; } & { pdu: string; }); diff --git a/server/@types/shared/models/UserWithWorkload.ts b/server/@types/shared/models/UserWithWorkload.ts new file mode 100644 index 000000000..8f77332be --- /dev/null +++ b/server/@types/shared/models/UserWithWorkload.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ApprovedPremisesUserRole } from './ApprovedPremisesUserRole'; +import type { User } from './User'; +import type { UserQualification } from './UserQualification'; + +export type UserWithWorkload = (User & { + numAssessmentsPending?: number; + numAssessmentsCompleted7Days?: number; + numAssessmentsCompleted30Days?: number; + qualifications?: Array; + roles?: Array; +}); +