diff --git a/scripts/generate-adjustment-types.sh b/scripts/generate-adjustment-types.sh index 02176592..e214251c 100755 --- a/scripts/generate-adjustment-types.sh +++ b/scripts/generate-adjustment-types.sh @@ -1 +1,2 @@ npx openapi-typescript https://adjustments-api-dev.hmpps.service.justice.gov.uk/v3/api-docs > ../server/@types/adjustments/index.d.ts +# npx openapi-typescript http://localhost:8089/v3/api-docs > ../server/@types/adjustments/index.d.ts diff --git a/server/@types/adjustments/index.d.ts b/server/@types/adjustments/index.d.ts index eeb53927..12e4e1ad 100644 --- a/server/@types/adjustments/index.d.ts +++ b/server/@types/adjustments/index.d.ts @@ -209,7 +209,7 @@ export interface components { * @description The type of UAL * @enum {string} */ - type: 'RECALL' | 'ESCAPE' | 'SENTENCED_IN_ABSENCE' | 'RELEASE_IN_ERROR' + type?: 'RECALL' | 'ESCAPE' | 'SENTENCED_IN_ABSENCE' | 'RELEASE_IN_ERROR' } LegacyAdjustmentCreatedResponse: { /** Format: uuid */ @@ -226,11 +226,16 @@ export interface components { * @enum {string} */ code: + | 'RADA_FROM_DATE_NOT_NULL' | 'RADA_REDUCES_BY_MORE_THAN_HALF' | 'MORE_RADAS_THAN_ADAS' | 'RADA_DATE_CANNOT_BE_FUTURE' | 'RADA_DATA_MUST_BE_AFTER_SENTENCE_DATE' | 'RADA_DAYS_MUST_BE_POSTIVE' + | 'UAL_FROM_DATE_NOT_NULL' + | 'UAL_TO_DATE_NOT_NULL' + | 'UAL_FROM_DATE_AFTER_TO_DATE' + | 'UAL_TYPE_NOT_NULL' arguments: string[] message: string /** @enum {string} */ diff --git a/server/routes/adjustmentRoutes.test.ts b/server/routes/adjustmentRoutes.test.ts index fad89adc..21b246ae 100644 --- a/server/routes/adjustmentRoutes.test.ts +++ b/server/routes/adjustmentRoutes.test.ts @@ -382,7 +382,7 @@ describe('Adjustment routes tests', () => { expect(res.text).toContain('Number of days restored') expect(res.text).toContain('24') expect(res.text).toContain('Submit') - expect(res.text).toContain(`/${NOMS_ID}/restored-additional-days/view`) + expect(res.text).toContain(`/${NOMS_ID}/restored-additional-days/edit`) }) }) diff --git a/server/views/pages/adjustments/review.njk b/server/views/pages/adjustments/review.njk index a86cf19e..ee69b61e 100644 --- a/server/views/pages/adjustments/review.njk +++ b/server/views/pages/adjustments/review.njk @@ -50,9 +50,9 @@ attributes: { 'data-qa': 'submit' } }) }} {{ govukButton({ - text: "Cancel", + text: "Edit", classes: "govuk-button--secondary", - href: model.cancelLink() + href: "/" + model.prisonerDetail.offenderNo + "/" + model.adjustmentType().url + "/edit" }) }}