From 5e7acbf51b4d0b875712371979c3f37b921f2d7f Mon Sep 17 00:00:00 2001 From: alexbzea Date: Thu, 19 Mar 2026 14:58:27 +0000 Subject: [PATCH 01/16] create final situation interstitial page --- .../yourHouseHoldAndCircumstances.json | 13 +++++++ .../yourHouseHoldAndCircumstances.json | 13 +++++++ .../situation-interstitial/index.ts | 13 +++++++ .../situationInterstitial.njk | 34 +++++++++++++------ 4 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json create mode 100644 src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json diff --git a/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json b/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json new file mode 100644 index 000000000..0ab1d432c --- /dev/null +++ b/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json @@ -0,0 +1,13 @@ +{ + "pageTitle": "cyHome and circumstances", + "caption": "cyRespond to a property possession claim", + "heading": "cyYour household and circumstances", + "paragraph1": "cyYou must now answer some questions about your household and personal circumstances. This will help a judge understand your situation.", + "paragraph2": "cyYou’ll be asked about:", + "bullet1": "cyany dependants you have (people you look after financially)", + "bullet2": "cyother adults that live in your home", + "bullet3": "cywhether you would have anywhere else to live if you were asked to leave your home", + "bullet4": "cyany personal circumstances that have led to your case that you think a judge should know about", + "bullet5": "cyany exceptional hardship you’d experience if you were asked to leave your home", + "paragraph3": "cyThe claimant will be able to see your answers." +} \ No newline at end of file diff --git a/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json b/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json new file mode 100644 index 000000000..dd8e967ff --- /dev/null +++ b/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json @@ -0,0 +1,13 @@ +{ + "pageTitle": "Home and circumstances", + "caption": "Respond to a property possession claim", + "heading": "Your household and circumstances", + "paragraph1": "You must now answer some questions about your household and personal circumstances. This will help a judge understand your situation.", + "paragraph2": "You’ll be asked about:", + "bullet1": "any dependants you have (people you look after financially)", + "bullet2": "other adults that live in your home", + "bullet3": "whether you would have anywhere else to live if you were asked to leave your home", + "bullet4": "any personal circumstances that have led to your case that you think a judge should know about", + "bullet5": "any exceptional hardship you’d experience if you were asked to leave your home", + "paragraph3": "The claimant will be able to see your answers." +} \ No newline at end of file diff --git a/src/main/steps/respond-to-claim/situation-interstitial/index.ts b/src/main/steps/respond-to-claim/situation-interstitial/index.ts index eb6a6ef35..bfb486301 100644 --- a/src/main/steps/respond-to-claim/situation-interstitial/index.ts +++ b/src/main/steps/respond-to-claim/situation-interstitial/index.ts @@ -8,6 +8,19 @@ export const step: StepDefinition = createFormStep({ journeyFolder: 'respondToClaim', stepDir: __dirname, flowConfig, + translationKeys: { + pageTitle: 'pageTitle', + caption: 'caption', + heading: 'heading', + paragraph1: 'paragraph1', + paragraph2: 'paragraph2', + bullet1: 'bullet1', + bullet2: 'bullet2', + bullet3: 'bullet3', + bullet4: 'bullet4', + bullet5: 'bullet5', + paragraph3: 'paragraph3', + }, fields: [], customTemplate: `${__dirname}/situationInterstitial.njk`, }); diff --git a/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk b/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk index 6b8fd83e4..0cb0a73c1 100644 --- a/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk +++ b/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk @@ -1,24 +1,36 @@ {% extends "stepsTemplate.njk" %} {% from "govuk/components/button/macro.njk" import govukButton %} -{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "macros/csrf.njk" import csrfProtection %} + +{% block pageTitle %} + {{ pageTitle }} - HM Courts & Tribunals Service – GOV.UK +{% endblock %} {% block mainContent %} - {% if errorSummary %} - {{ govukErrorSummary(errorSummary) }} + {% if caption %} + {{ caption }} + {% endif %} + {% if heading %} +

{{ heading }}

{% endif %} -

Your Household And Circumstances (placeholder)

-

This is a placeholder for the Your Household And Circumstances step.

+

{{ paragraph1 }}

+

{{ paragraph2 }}

+ +

{{ paragraph3 }}

{{ govukButton({ text: continue, - attributes: { type: 'submit', name: 'action', value: 'continue' } - }) }} - {{ govukButton({ - text: saveForLater, - classes: 'govuk-button--secondary', - attributes: { type: 'submit', name: 'action', value: 'saveForLater' } + attributes: { name: 'action', value: 'continue' } }) }} +

+ {{ cancel }} +

{{ csrfProtection(csrfToken) }}
From 098a2330fef36dcd8e0afbdcec202ca7bdb447c4 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Thu, 19 Mar 2026 15:01:27 +0000 Subject: [PATCH 02/16] fix linting issues --- .../cy/respondToClaim/yourHouseHoldAndCircumstances.json | 2 +- .../en/respondToClaim/yourHouseHoldAndCircumstances.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json b/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json index 0ab1d432c..9645b07ca 100644 --- a/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json +++ b/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json @@ -10,4 +10,4 @@ "bullet4": "cyany personal circumstances that have led to your case that you think a judge should know about", "bullet5": "cyany exceptional hardship you’d experience if you were asked to leave your home", "paragraph3": "cyThe claimant will be able to see your answers." -} \ No newline at end of file +} diff --git a/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json b/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json index dd8e967ff..48fe65de6 100644 --- a/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json +++ b/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json @@ -10,4 +10,4 @@ "bullet4": "any personal circumstances that have led to your case that you think a judge should know about", "bullet5": "any exceptional hardship you’d experience if you were asked to leave your home", "paragraph3": "The claimant will be able to see your answers." -} \ No newline at end of file +} From 56061ace021d03717a6cbe2fdaab005c6032b8ad Mon Sep 17 00:00:00 2001 From: alexbzea Date: Mon, 23 Mar 2026 16:41:06 +0000 Subject: [PATCH 03/16] almost final dependant children page --- .../doYouHaveAnyDependantChildren.json | 16 +++ .../doYouHaveAnyDependantChildren.json | 16 +++ src/main/interfaces/ccdCase.interface.ts | 7 ++ .../dependant-children/dependantChildren.njk | 29 +++++- .../dependant-children/index.ts | 99 ++++++++++++++++++- 5 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json create mode 100644 src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json new file mode 100644 index 000000000..fdb405ae3 --- /dev/null +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json @@ -0,0 +1,16 @@ +{ + "pageTitle": "cyDependant children", + "caption": "cyRespond to a property possession claim", + "heading": "cyDo you have any dependant children?", + "dependantChildrenHint": "cyDependant children are children you look after financially.", + "options": { + "yes": "cyYes", + "no": "cyNo" + }, + "dependantChildrenDetailsLabel": "cyGive details about your dependant children", + "dependantChildrenDetailsHint": "cyYou should include details about how many dependant children you have and how old they are", + "errors": { + "dependantChildren": "cySelect if you have any dependant children.", + "dependantChildrenDetails": "cyGive details about your dependant children." + } +} \ No newline at end of file diff --git a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json new file mode 100644 index 000000000..6bd3a505c --- /dev/null +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json @@ -0,0 +1,16 @@ +{ + "pageTitle": "Dependant children", + "caption": "Respond to a property possession claim", + "heading": "Do you have any dependant children?", + "dependantChildrenHint": "Dependant children are children you look after financially.", + "options": { + "yes": "Yes", + "no": "No" + }, + "dependantChildrenDetailsLabel": "Give details about your dependant children", + "dependantChildrenDetailsHint": "You should include details about how many dependant children you have and how old they are", + "errors": { + "dependantChildren": "Select if you have any dependant children.", + "dependantChildrenDetails": "Give details about your dependant children." + } +} \ No newline at end of file diff --git a/src/main/interfaces/ccdCase.interface.ts b/src/main/interfaces/ccdCase.interface.ts index 7bb95aa32..00ccf2767 100644 --- a/src/main/interfaces/ccdCase.interface.ts +++ b/src/main/interfaces/ccdCase.interface.ts @@ -4,9 +4,15 @@ export enum CaseState { } export type YesNoValue = 'YES' | 'NO' | null; +export type YesNoCapitalised = 'Yes' | 'No'; export type YesNoNotSureValue = 'YES' | 'NO' | 'NOT_SURE'; +export interface HouseholdCircumstances { + dependantChildren?: YesNoCapitalised; + dependantChildrenDetails?: string; +} + export interface CcdUserCase { id: string; state: CaseState; @@ -56,6 +62,7 @@ export interface PossessionClaimResponse { defendantNameConfirmation?: string; dateOfBirth?: string; landlordRegistered?: YesNoNotSureValue; + householdCircumstances?: HouseholdCircumstances; }; } diff --git a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk index ca8881ad4..dd1c24342 100644 --- a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk +++ b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk @@ -1,23 +1,42 @@ {% extends "stepsTemplate.njk" %} +{% from "govuk/components/radios/macro.njk" import govukRadios %} {% from "govuk/components/button/macro.njk" import govukButton %} {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "macros/csrf.njk" import csrfProtection %} + +{% block pageTitle %} + {{ pageTitle }} - HM Courts & Tribunals Service – GOV.UK +{% endblock %} + {% block mainContent %} {% if errorSummary %} {{ govukErrorSummary(errorSummary) }} {% endif %} -

Do You Have Any Dependant Children? (placeholder)

-

This is a placeholder for Do You Have Any Dependant Children step.

+ {% if caption %} + {{ caption }} + {% endif %} + {% if heading %} +

{{ heading }}

+ {% endif %} +
+ {% for field in fields %} + {% if field.component and field.componentType %} + {% if field.componentType == 'radios' %} + {{ govukRadios(field.component) }} + {% endif %} + {% endif %} + {% endfor %} +
{{ govukButton({ - text: continue, - attributes: { type: 'submit', name: 'action', value: 'continue' } + text: saveAndContinue, + attributes: { name: 'action', value: 'continue' } }) }} {{ govukButton({ text: saveForLater, classes: 'govuk-button--secondary', - attributes: { type: 'submit', name: 'action', value: 'saveForLater' } + attributes: { name: 'action', value: 'saveForLater' } }) }}
{{ csrfProtection(csrfToken) }} diff --git a/src/main/steps/respond-to-claim/dependant-children/index.ts b/src/main/steps/respond-to-claim/dependant-children/index.ts index 70fb51cab..191c96c2e 100644 --- a/src/main/steps/respond-to-claim/dependant-children/index.ts +++ b/src/main/steps/respond-to-claim/dependant-children/index.ts @@ -1,13 +1,110 @@ +import type { PossessionClaimResponse } from '../../../interfaces/ccdCase.interface'; import type { StepDefinition } from '../../../interfaces/stepFormData.interface'; +import { buildCcdCaseForPossessionClaimResponse } from '../../utils/populateResponseToClaimPayloadmap'; import { flowConfig } from '../flow.config'; import { createFormStep } from '@modules/steps'; +import type { HouseholdCircumstances, YesNoCapitalised } from '../../../interfaces/ccdCase.interface'; + export const step: StepDefinition = createFormStep({ stepName: 'do-you-have-any-dependant-children', journeyFolder: 'respondToClaim', stepDir: __dirname, flowConfig, - fields: [], customTemplate: `${__dirname}/dependantChildren.njk`, + translationKeys: { + pageTitle: 'pageTitle', + heading: 'heading', + caption: 'caption', + }, + beforeRedirect: async req => { + const dependantChildren: string = req.body?.dependantChildren; + + if (!dependantChildren) { + return; + } + + const enumMapping: Record = { + yes: 'Yes', + no: 'No', + }; + + const dependantChildrenCcd = enumMapping[dependantChildren]; + if (!dependantChildrenCcd) { + return; + } + + const dependantChildrenDetails: string | undefined = + dependantChildrenCcd === 'Yes' + ? (req.body?.['dependantChildren.dependantChildrenDetails']) + : undefined; + + const possessionClaimResponse: PossessionClaimResponse = { + defendantResponses: { + householdCircumstances: { + dependantChildren: dependantChildrenCcd, + ...(dependantChildrenDetails !== undefined ? { dependantChildrenDetails } : {}), + }, + }, + }; + console.log('Possession claim response to save to CCD', possessionClaimResponse); + await buildCcdCaseForPossessionClaimResponse(req, possessionClaimResponse); + }, + getInitialFormData: req => { + const caseData = req.res?.locals?.validatedCase?.data; + const householdCircumstances: HouseholdCircumstances = caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; + console.log('Household circumstances from CCD', householdCircumstances); + const dependantChildrenCcd: YesNoCapitalised | undefined = householdCircumstances?.dependantChildren; + + if (!dependantChildrenCcd) { + return {}; + } + + if (dependantChildrenCcd === 'Yes') { + const dependantChildrenDetails: string | undefined = householdCircumstances?.dependantChildrenDetails; + return { + dependantChildren: 'yes', + 'dependantChildren.dependantChildrenDetails': dependantChildrenDetails ?? '', + }; + } + + return { dependantChildren: 'no' }; + }, + fields: [ + { + name: 'dependantChildren', + type: 'radio', + required: true, + legendClasses: 'govuk-visually-hidden', + translationKey: { + label: 'heading', + hint: 'dependantChildrenHint', + }, + errorMessage: 'errors.dependantChildren', + options: [ + { + value: 'yes', + translationKey: 'options.yes', + subFields: { + dependantChildrenDetails: { + name: 'dependantChildrenDetails', + type: 'character-count', + required: true, + maxLength: 500, + translationKey: { + label: 'dependantChildrenDetailsLabel', + hint: 'dependantChildrenDetailsHint', + }, + attributes: { + rows: 5, + }, + errorMessage: 'errors.dependantChildrenDetails', + }, + }, + }, + { value: 'no', translationKey: 'options.no' }, + ], + }, + ], }); From 84cee341634931c39069532707e2d8119678ee22 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Tue, 24 Mar 2026 10:21:04 +0000 Subject: [PATCH 04/16] changing payload to send dependantChildrenDetails value as empty string in case user changes from yes to no in order to clear old value --- src/main/interfaces/ccdCase.interface.ts | 4 ++++ .../steps/respond-to-claim/dependant-children/index.ts | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/interfaces/ccdCase.interface.ts b/src/main/interfaces/ccdCase.interface.ts index 00ccf2767..9a31deb71 100644 --- a/src/main/interfaces/ccdCase.interface.ts +++ b/src/main/interfaces/ccdCase.interface.ts @@ -41,6 +41,10 @@ export interface Address { Country?: string; } +export interface CaseData { + possessionClaimResponse?: PossessionClaimResponse; +} + export interface PossessionClaimResponse { defendantContactDetails?: { party?: { diff --git a/src/main/steps/respond-to-claim/dependant-children/index.ts b/src/main/steps/respond-to-claim/dependant-children/index.ts index 191c96c2e..36a737afc 100644 --- a/src/main/steps/respond-to-claim/dependant-children/index.ts +++ b/src/main/steps/respond-to-claim/dependant-children/index.ts @@ -4,7 +4,7 @@ import { buildCcdCaseForPossessionClaimResponse } from '../../utils/populateResp import { flowConfig } from '../flow.config'; import { createFormStep } from '@modules/steps'; -import type { HouseholdCircumstances, YesNoCapitalised } from '../../../interfaces/ccdCase.interface'; +import type { CaseData, HouseholdCircumstances, YesNoCapitalised } from '../../../interfaces/ccdCase.interface'; export const step: StepDefinition = createFormStep({ @@ -44,7 +44,7 @@ export const step: StepDefinition = createFormStep({ defendantResponses: { householdCircumstances: { dependantChildren: dependantChildrenCcd, - ...(dependantChildrenDetails !== undefined ? { dependantChildrenDetails } : {}), + dependantChildrenDetails : dependantChildrenDetails ?? '', }, }, }; @@ -52,8 +52,8 @@ export const step: StepDefinition = createFormStep({ await buildCcdCaseForPossessionClaimResponse(req, possessionClaimResponse); }, getInitialFormData: req => { - const caseData = req.res?.locals?.validatedCase?.data; - const householdCircumstances: HouseholdCircumstances = caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; + const caseData: CaseData | undefined = req.res?.locals?.validatedCase?.data; + const householdCircumstances: HouseholdCircumstances | undefined = caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; console.log('Household circumstances from CCD', householdCircumstances); const dependantChildrenCcd: YesNoCapitalised | undefined = householdCircumstances?.dependantChildren; From de980e2438cae063ea7f953a5fb08aa4b37bdb95 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Tue, 24 Mar 2026 10:33:29 +0000 Subject: [PATCH 05/16] fixing linting issues --- .../doYouHaveAnyDependantChildren.json | 2 +- .../doYouHaveAnyDependantChildren.json | 2 +- .../respond-to-claim/dependant-children/index.ts | 13 +++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json index fdb405ae3..830f5ed83 100644 --- a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json @@ -13,4 +13,4 @@ "dependantChildren": "cySelect if you have any dependant children.", "dependantChildrenDetails": "cyGive details about your dependant children." } -} \ No newline at end of file +} diff --git a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json index 6bd3a505c..ef52807f3 100644 --- a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json @@ -13,4 +13,4 @@ "dependantChildren": "Select if you have any dependant children.", "dependantChildrenDetails": "Give details about your dependant children." } -} \ No newline at end of file +} diff --git a/src/main/steps/respond-to-claim/dependant-children/index.ts b/src/main/steps/respond-to-claim/dependant-children/index.ts index 36a737afc..4615e1b20 100644 --- a/src/main/steps/respond-to-claim/dependant-children/index.ts +++ b/src/main/steps/respond-to-claim/dependant-children/index.ts @@ -1,11 +1,9 @@ -import type { PossessionClaimResponse } from '../../../interfaces/ccdCase.interface'; +import type { CaseData , HouseholdCircumstances, PossessionClaimResponse, YesNoCapitalised } from '../../../interfaces/ccdCase.interface'; import type { StepDefinition } from '../../../interfaces/stepFormData.interface'; import { buildCcdCaseForPossessionClaimResponse } from '../../utils/populateResponseToClaimPayloadmap'; import { flowConfig } from '../flow.config'; import { createFormStep } from '@modules/steps'; -import type { CaseData, HouseholdCircumstances, YesNoCapitalised } from '../../../interfaces/ccdCase.interface'; - export const step: StepDefinition = createFormStep({ stepName: 'do-you-have-any-dependant-children', @@ -36,15 +34,13 @@ export const step: StepDefinition = createFormStep({ } const dependantChildrenDetails: string | undefined = - dependantChildrenCcd === 'Yes' - ? (req.body?.['dependantChildren.dependantChildrenDetails']) - : undefined; + dependantChildrenCcd === 'Yes' ? req.body?.['dependantChildren.dependantChildrenDetails'] : undefined; const possessionClaimResponse: PossessionClaimResponse = { defendantResponses: { householdCircumstances: { dependantChildren: dependantChildrenCcd, - dependantChildrenDetails : dependantChildrenDetails ?? '', + dependantChildrenDetails: dependantChildrenDetails ?? '', }, }, }; @@ -53,7 +49,8 @@ export const step: StepDefinition = createFormStep({ }, getInitialFormData: req => { const caseData: CaseData | undefined = req.res?.locals?.validatedCase?.data; - const householdCircumstances: HouseholdCircumstances | undefined = caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; + const householdCircumstances: HouseholdCircumstances | undefined = + caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; console.log('Household circumstances from CCD', householdCircumstances); const dependantChildrenCcd: YesNoCapitalised | undefined = householdCircumstances?.dependantChildren; From 0b289225e1adfa28dcf742af79de97020bbf9f54 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Tue, 24 Mar 2026 11:00:22 +0000 Subject: [PATCH 06/16] removing logging --- src/main/steps/respond-to-claim/dependant-children/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/steps/respond-to-claim/dependant-children/index.ts b/src/main/steps/respond-to-claim/dependant-children/index.ts index 4615e1b20..64d85c492 100644 --- a/src/main/steps/respond-to-claim/dependant-children/index.ts +++ b/src/main/steps/respond-to-claim/dependant-children/index.ts @@ -44,14 +44,12 @@ export const step: StepDefinition = createFormStep({ }, }, }; - console.log('Possession claim response to save to CCD', possessionClaimResponse); await buildCcdCaseForPossessionClaimResponse(req, possessionClaimResponse); }, getInitialFormData: req => { const caseData: CaseData | undefined = req.res?.locals?.validatedCase?.data; const householdCircumstances: HouseholdCircumstances | undefined = caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; - console.log('Household circumstances from CCD', householdCircumstances); const dependantChildrenCcd: YesNoCapitalised | undefined = householdCircumstances?.dependantChildren; if (!dependantChildrenCcd) { From f5f8fa59843bc02ba32c4ee45561f053f76483e0 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Tue, 24 Mar 2026 11:07:48 +0000 Subject: [PATCH 07/16] more linting.. --- .../steps/respond-to-claim/dependant-children/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/steps/respond-to-claim/dependant-children/index.ts b/src/main/steps/respond-to-claim/dependant-children/index.ts index 64d85c492..ee1636e2e 100644 --- a/src/main/steps/respond-to-claim/dependant-children/index.ts +++ b/src/main/steps/respond-to-claim/dependant-children/index.ts @@ -1,4 +1,9 @@ -import type { CaseData , HouseholdCircumstances, PossessionClaimResponse, YesNoCapitalised } from '../../../interfaces/ccdCase.interface'; +import type { + CaseData, + HouseholdCircumstances, + PossessionClaimResponse, + YesNoCapitalised, +} from '../../../interfaces/ccdCase.interface'; import type { StepDefinition } from '../../../interfaces/stepFormData.interface'; import { buildCcdCaseForPossessionClaimResponse } from '../../utils/populateResponseToClaimPayloadmap'; import { flowConfig } from '../flow.config'; From 8db0d88cace8caea60993945bd0fdb05e39f459f Mon Sep 17 00:00:00 2001 From: alexbzea Date: Tue, 24 Mar 2026 15:20:34 +0000 Subject: [PATCH 08/16] adding other dependants page --- .../doYouHaveAnyOtherDependants.json | 16 +++ .../doYouHaveAnyOtherDependants.json | 16 +++ src/main/interfaces/ccdCase.interface.ts | 2 + .../anyOtherDependants.njk | 29 +++++- .../any-other-dependants/index.ts | 99 ++++++++++++++++++- 5 files changed, 156 insertions(+), 6 deletions(-) create mode 100644 src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json create mode 100644 src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json new file mode 100644 index 000000000..ee296de9e --- /dev/null +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json @@ -0,0 +1,16 @@ +{ + "pageTitle": "cyOther dependants", + "caption": "cyRespond to a property possession claim", + "heading": "cyDo you have any other dependants?", + "otherDependantsHint": "cyDependants are people you look after financially, like elderly relatives.", + "options": { + "yes": "cyYes", + "no": "cyNo" + }, + "otherDependantDetailsLabel": "cyGive details about your other dependants", + "otherDependantDetailsHint": "cyYou should include details about how many other dependants you have, how old they are and anything else you think the court should know about them", + "errors": { + "otherDependants": "cySelect if you have any other dependants.", + "otherDependantDetails": "cyGive details about your other dependants." + } +} \ No newline at end of file diff --git a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json new file mode 100644 index 000000000..8294b07a5 --- /dev/null +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json @@ -0,0 +1,16 @@ +{ + "pageTitle": "Other dependants", + "caption": "Respond to a property possession claim", + "heading": "Do you have any other dependants?", + "otherDependantsHint": "Dependants are people you look after financially, like elderly relatives.", + "options": { + "yes": "Yes", + "no": "No" + }, + "otherDependantDetailsLabel": "Give details about your other dependants", + "otherDependantDetailsHint": "You should include details about how many other dependants you have, how old they are and anything else you think the court should know about them", + "errors": { + "otherDependants": "Select if you have any other dependants.", + "otherDependantDetails": "Give details about your other dependants." + } +} diff --git a/src/main/interfaces/ccdCase.interface.ts b/src/main/interfaces/ccdCase.interface.ts index 65d0b4c08..07cff7b44 100644 --- a/src/main/interfaces/ccdCase.interface.ts +++ b/src/main/interfaces/ccdCase.interface.ts @@ -13,6 +13,8 @@ export type ContactPreference = 'EMAIL' | 'POST' | null; export interface HouseholdCircumstances { dependantChildren?: YesNoCapitalised; dependantChildrenDetails?: string; + otherDependants?: YesNoCapitalised; + otherDependantDetails?: string; } export interface CcdUserCase { diff --git a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk index 5e3474609..dd1c24342 100644 --- a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk +++ b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk @@ -1,23 +1,42 @@ {% extends "stepsTemplate.njk" %} +{% from "govuk/components/radios/macro.njk" import govukRadios %} {% from "govuk/components/button/macro.njk" import govukButton %} {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "macros/csrf.njk" import csrfProtection %} + +{% block pageTitle %} + {{ pageTitle }} - HM Courts & Tribunals Service – GOV.UK +{% endblock %} + {% block mainContent %} {% if errorSummary %} {{ govukErrorSummary(errorSummary) }} {% endif %} -

Do you have any other dependants? (placeholder)

-

This is a placeholder for Do You Have Any Other Dependants step.

+ {% if caption %} + {{ caption }} + {% endif %} + {% if heading %} +

{{ heading }}

+ {% endif %} + + {% for field in fields %} + {% if field.component and field.componentType %} + {% if field.componentType == 'radios' %} + {{ govukRadios(field.component) }} + {% endif %} + {% endif %} + {% endfor %} +
{{ govukButton({ - text: continue, - attributes: { type: 'submit', name: 'action', value: 'continue' } + text: saveAndContinue, + attributes: { name: 'action', value: 'continue' } }) }} {{ govukButton({ text: saveForLater, classes: 'govuk-button--secondary', - attributes: { type: 'submit', name: 'action', value: 'saveForLater' } + attributes: { name: 'action', value: 'saveForLater' } }) }}
{{ csrfProtection(csrfToken) }} diff --git a/src/main/steps/respond-to-claim/any-other-dependants/index.ts b/src/main/steps/respond-to-claim/any-other-dependants/index.ts index 00ef36c4d..93bcfa0ca 100644 --- a/src/main/steps/respond-to-claim/any-other-dependants/index.ts +++ b/src/main/steps/respond-to-claim/any-other-dependants/index.ts @@ -1,4 +1,11 @@ +import type { + CaseData, + HouseholdCircumstances, + PossessionClaimResponse, + YesNoCapitalised, +} from '../../../interfaces/ccdCase.interface'; import type { StepDefinition } from '../../../interfaces/stepFormData.interface'; +import { buildCcdCaseForPossessionClaimResponse } from '../../utils/populateResponseToClaimPayloadmap'; import { flowConfig } from '../flow.config'; import { createFormStep } from '@modules/steps'; @@ -8,6 +15,96 @@ export const step: StepDefinition = createFormStep({ journeyFolder: 'respondToClaim', stepDir: __dirname, flowConfig, - fields: [], customTemplate: `${__dirname}/anyOtherDependants.njk`, + translationKeys: { + pageTitle: 'pageTitle', + heading: 'heading', + caption: 'caption', + }, + beforeRedirect: async req => { + const otherDependants: string = req.body?.otherDependants; + + if (!otherDependants) { + return; + } + + const enumMapping: Record = { + yes: 'Yes', + no: 'No', + }; + + const otherDependantsCcd = enumMapping[otherDependants]; + if (!otherDependantsCcd) { + return; + } + + const otherDependantDetails: string | undefined = + otherDependantsCcd === 'Yes' ? req.body?.['otherDependants.otherDependantDetails'] : undefined; + + const possessionClaimResponse: PossessionClaimResponse = { + defendantResponses: { + householdCircumstances: { + otherDependants: otherDependantsCcd, + otherDependantDetails: otherDependantDetails ?? '', + }, + }, + }; + await buildCcdCaseForPossessionClaimResponse(req, possessionClaimResponse); + }, + getInitialFormData: req => { + const caseData: CaseData | undefined = req.res?.locals?.validatedCase?.data; + const householdCircumstances: HouseholdCircumstances | undefined = + caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; + const otherDependantsCcd: YesNoCapitalised | undefined = householdCircumstances?.otherDependants; + + if (!otherDependantsCcd) { + return {}; + } + + if (otherDependantsCcd === 'Yes') { + const otherDependantDetails: string | undefined = householdCircumstances?.otherDependantDetails; + return { + otherDependants: 'yes', + 'otherDependants.otherDependantDetails': otherDependantDetails ?? '', + }; + } + + return { otherDependants: 'no' }; + }, + fields: [ + { + name: 'otherDependants', + type: 'radio', + required: true, + legendClasses: 'govuk-visually-hidden', + translationKey: { + label: 'heading', + hint: 'otherDependantsHint', + }, + errorMessage: 'errors.otherDependants', + options: [ + { + value: 'yes', + translationKey: 'options.yes', + subFields: { + otherDependantDetails: { + name: 'otherDependantDetails', + type: 'character-count', + required: true, + maxLength: 500, + translationKey: { + label: 'otherDependantDetailsLabel', + hint: 'otherDependantDetailsHint', + }, + attributes: { + rows: 5, + }, + errorMessage: 'errors.otherDependantDetails', + }, + }, + }, + { value: 'no', translationKey: 'options.no' }, + ], + }, + ], }); From e118cf6bd3cc55bac448c7195ccd03278100ac72 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Tue, 24 Mar 2026 15:21:39 +0000 Subject: [PATCH 09/16] fixing linting issue.. --- .../locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json index ee296de9e..42317b2ed 100644 --- a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json @@ -13,4 +13,4 @@ "otherDependants": "cySelect if you have any other dependants.", "otherDependantDetails": "cyGive details about your other dependants." } -} \ No newline at end of file +} From ae7fcb59c47cf9d3e6241bef3067afa17bc765ed Mon Sep 17 00:00:00 2001 From: alexbzea Date: Tue, 24 Mar 2026 16:10:51 +0000 Subject: [PATCH 10/16] changing caption font size to 24px from 27px --- .../any-other-dependants/anyOtherDependants.njk | 2 +- .../respond-to-claim/dependant-children/dependantChildren.njk | 2 +- .../situation-interstitial/situationInterstitial.njk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk index dd1c24342..9231c3744 100644 --- a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk +++ b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk @@ -13,7 +13,7 @@ {{ govukErrorSummary(errorSummary) }} {% endif %} {% if caption %} - {{ caption }} + {{ caption }} {% endif %} {% if heading %}

{{ heading }}

diff --git a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk index dd1c24342..9231c3744 100644 --- a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk +++ b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk @@ -13,7 +13,7 @@ {{ govukErrorSummary(errorSummary) }} {% endif %} {% if caption %} - {{ caption }} + {{ caption }} {% endif %} {% if heading %}

{{ heading }}

diff --git a/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk b/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk index 0cb0a73c1..633febb89 100644 --- a/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk +++ b/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk @@ -7,7 +7,7 @@ {% endblock %} {% block mainContent %} {% if caption %} - {{ caption }} + {{ caption }} {% endif %} {% if heading %}

{{ heading }}

From c61d35993c1cfd5c0ee56b04fcd588cd22851574 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Wed, 25 Mar 2026 16:47:41 +0000 Subject: [PATCH 11/16] added radio buttons selections and routing to repaymentsAgreed placeholder page for routing to situation-interstitial --- .../en/respondToClaim/repaymentsAgreed.json | 10 +++++++-- .../steps/respond-to-claim/flow.config.ts | 21 ++++++++++++++++-- .../repayments-agreed/index.ts | 16 +++++++++++++- .../repayments-agreed/repaymentsAgreed.njk | 22 ++++++++++++------- 4 files changed, 56 insertions(+), 13 deletions(-) diff --git a/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json b/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json index afce185c2..f97fc1045 100644 --- a/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json +++ b/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json @@ -1,4 +1,10 @@ { - "pageTitle": "Repayments agreed", - "caption": "Respond to a property possession claim" + "pageTitle": "Repayments agreed (placeholder)", + "caption": "Respond to a property possession claim", + "options": { + "yes": "Yes", + "no": "No", + "or": "or", + "imNotSure": "I'm not sure" + } } diff --git a/src/main/steps/respond-to-claim/flow.config.ts b/src/main/steps/respond-to-claim/flow.config.ts index 1963b83fb..a32b91f1f 100644 --- a/src/main/steps/respond-to-claim/flow.config.ts +++ b/src/main/steps/respond-to-claim/flow.config.ts @@ -326,10 +326,27 @@ export const flowConfig: JourneyFlowConfig = { }, 'repayments-agreed': { previousStep: 'repayments-made', - defaultNext: 'your-household-and-circumstances', + routes: [ + { + condition: async ( + _req: Request, + _formData: Record, + currentStepData: Record + ) => currentStepData?.repaymentsAgreed === 'yes' || currentStepData?.repaymentsAgreed === 'imNotSure', + nextStep: 'your-household-and-circumstances', + }, + { + condition: async ( + _req: Request, + _formData: Record, + currentStepData: Record + ) => currentStepData?.repaymentsAgreed === 'no', + nextStep: 'repayments-agreed', + }, + ], }, 'your-household-and-circumstances': { - previousStep: 'repayments', + previousStep: 'repayments-agreed', defaultNext: 'do-you-have-any-dependant-children', }, 'do-you-have-any-dependant-children': { diff --git a/src/main/steps/respond-to-claim/repayments-agreed/index.ts b/src/main/steps/respond-to-claim/repayments-agreed/index.ts index 72798695e..e99c3d6b9 100644 --- a/src/main/steps/respond-to-claim/repayments-agreed/index.ts +++ b/src/main/steps/respond-to-claim/repayments-agreed/index.ts @@ -13,5 +13,19 @@ export const step: StepDefinition = createFormStep({ pageTitle: 'pageTitle', caption: 'caption', }, - fields: [], + fields: [ + { + name: 'repaymentsAgreed', + type: 'radio', + required: true, + translationKey: { label: 'pageTitle' }, + legendClasses: 'govuk-fieldset__legend--m', + options: [ + { value: 'yes', translationKey: 'options.yes' }, + { value: 'no', translationKey: 'options.no' }, + { divider: 'options.or' }, + { value: 'imNotSure', translationKey: 'options.imNotSure' }, + ], + }, + ], }); diff --git a/src/main/steps/respond-to-claim/repayments-agreed/repaymentsAgreed.njk b/src/main/steps/respond-to-claim/repayments-agreed/repaymentsAgreed.njk index a044b6395..72b10c6dc 100644 --- a/src/main/steps/respond-to-claim/repayments-agreed/repaymentsAgreed.njk +++ b/src/main/steps/respond-to-claim/repayments-agreed/repaymentsAgreed.njk @@ -1,10 +1,10 @@ {% extends "stepsTemplate.njk" %} {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} +{% from "govuk/components/radios/macro.njk" import govukRadios %} {% from "govuk/components/button/macro.njk" import govukButton %} {% from "macros/csrf.njk" import csrfProtection %} -{# GOV.UK pattern: [Browser title] - HM Courts & Tribunals Service – GOV.UK #} -{% block pageTitle %}Repayments agreed - HM Courts & Tribunals Service – GOV.UK{% endblock %} +{% block pageTitle %}{{ pageTitle }} – HM Courts & Tribunals Service – GOV.UK{% endblock %} {% block mainContent %} {% if errorSummary %} @@ -15,15 +15,21 @@ {{ caption }} {% endif %} -

Repayments agreed (Placeholder)

-

dummy page

- -
+

{{ pageTitle }}

+ + + {% for field in fields %} + {% if field.componentType == 'radios' %} + {{ govukRadios(field.component) }} + {% endif %} + {% endfor %} + +
{{ govukButton({ - text: t('continue', { ns: 'common' }), + text: saveAndContinue, attributes: { type: 'submit', name: 'action', value: 'continue' } }) }} -
+
{{ csrfProtection(csrfToken) }} {% endblock %} \ No newline at end of file From 0272c6cb2d47436237ab6a2ecf83c8cbac8b5130 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Thu, 26 Mar 2026 09:46:50 +0000 Subject: [PATCH 12/16] renaming translation file to correct camelcasing as was working previously locally even though incorrect casing but not on preview --- ...ldAndCircumstances.json => yourHouseholdAndCircumstances.json} | 0 ...ldAndCircumstances.json => yourHouseholdAndCircumstances.json} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/main/assets/locales/cy/respondToClaim/{yourHouseHoldAndCircumstances.json => yourHouseholdAndCircumstances.json} (100%) rename src/main/assets/locales/en/respondToClaim/{yourHouseHoldAndCircumstances.json => yourHouseholdAndCircumstances.json} (100%) diff --git a/src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json b/src/main/assets/locales/cy/respondToClaim/yourHouseholdAndCircumstances.json similarity index 100% rename from src/main/assets/locales/cy/respondToClaim/yourHouseHoldAndCircumstances.json rename to src/main/assets/locales/cy/respondToClaim/yourHouseholdAndCircumstances.json diff --git a/src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json b/src/main/assets/locales/en/respondToClaim/yourHouseholdAndCircumstances.json similarity index 100% rename from src/main/assets/locales/en/respondToClaim/yourHouseHoldAndCircumstances.json rename to src/main/assets/locales/en/respondToClaim/yourHouseholdAndCircumstances.json From 992bcdc368f56601d3b70bd3761c71f3f4b30671 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Thu, 26 Mar 2026 11:56:08 +0000 Subject: [PATCH 13/16] Yes/No/NotSure type options to the common translations and changing title to use html entities --- src/main/assets/locales/cy/common.json | 6 ++++++ .../cy/respondToClaim/doYouHaveAnyDependantChildren.json | 4 ---- .../cy/respondToClaim/doYouHaveAnyOtherDependants.json | 4 ---- src/main/assets/locales/en/common.json | 6 ++++++ .../en/respondToClaim/doYouHaveAnyDependantChildren.json | 4 ---- .../en/respondToClaim/doYouHaveAnyOtherDependants.json | 4 ---- .../locales/en/respondToClaim/repaymentsAgreed.json | 8 +------- .../any-other-dependants/anyOtherDependants.njk | 4 +--- .../dependant-children/dependantChildren.njk | 4 +--- .../situation-interstitial/situationInterstitial.njk | 4 +--- 10 files changed, 16 insertions(+), 32 deletions(-) diff --git a/src/main/assets/locales/cy/common.json b/src/main/assets/locales/cy/common.json index f8a8f60eb..5abf0f142 100644 --- a/src/main/assets/locales/cy/common.json +++ b/src/main/assets/locales/cy/common.json @@ -27,6 +27,12 @@ "start": "cyStart", "submit": "cySubmit" }, + "options": { + "yes": "cyYes", + "no": "cyNo", + "or": "cyor", + "imNotSure": "cyI'm not sure" + }, "change": "cyChange", "chooseOption": "cyChoose an option", "back": "cyBack", diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json index 830f5ed83..97a3e8199 100644 --- a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json @@ -3,10 +3,6 @@ "caption": "cyRespond to a property possession claim", "heading": "cyDo you have any dependant children?", "dependantChildrenHint": "cyDependant children are children you look after financially.", - "options": { - "yes": "cyYes", - "no": "cyNo" - }, "dependantChildrenDetailsLabel": "cyGive details about your dependant children", "dependantChildrenDetailsHint": "cyYou should include details about how many dependant children you have and how old they are", "errors": { diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json index 42317b2ed..92a01efb0 100644 --- a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json @@ -3,10 +3,6 @@ "caption": "cyRespond to a property possession claim", "heading": "cyDo you have any other dependants?", "otherDependantsHint": "cyDependants are people you look after financially, like elderly relatives.", - "options": { - "yes": "cyYes", - "no": "cyNo" - }, "otherDependantDetailsLabel": "cyGive details about your other dependants", "otherDependantDetailsHint": "cyYou should include details about how many other dependants you have, how old they are and anything else you think the court should know about them", "errors": { diff --git a/src/main/assets/locales/en/common.json b/src/main/assets/locales/en/common.json index a5a412aa2..324b27f1d 100644 --- a/src/main/assets/locales/en/common.json +++ b/src/main/assets/locales/en/common.json @@ -27,6 +27,12 @@ "start": "Start", "submit": "Submit" }, + "options": { + "yes": "Yes", + "no": "No", + "or": "or", + "imNotSure": "I'm not sure" + }, "change": "Change", "back": "Back", "date": { diff --git a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json index ef52807f3..492a935bf 100644 --- a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json @@ -3,10 +3,6 @@ "caption": "Respond to a property possession claim", "heading": "Do you have any dependant children?", "dependantChildrenHint": "Dependant children are children you look after financially.", - "options": { - "yes": "Yes", - "no": "No" - }, "dependantChildrenDetailsLabel": "Give details about your dependant children", "dependantChildrenDetailsHint": "You should include details about how many dependant children you have and how old they are", "errors": { diff --git a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json index 8294b07a5..e990a8d2e 100644 --- a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json @@ -3,10 +3,6 @@ "caption": "Respond to a property possession claim", "heading": "Do you have any other dependants?", "otherDependantsHint": "Dependants are people you look after financially, like elderly relatives.", - "options": { - "yes": "Yes", - "no": "No" - }, "otherDependantDetailsLabel": "Give details about your other dependants", "otherDependantDetailsHint": "You should include details about how many other dependants you have, how old they are and anything else you think the court should know about them", "errors": { diff --git a/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json b/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json index f97fc1045..975fa7605 100644 --- a/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json +++ b/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json @@ -1,10 +1,4 @@ { "pageTitle": "Repayments agreed (placeholder)", - "caption": "Respond to a property possession claim", - "options": { - "yes": "Yes", - "no": "No", - "or": "or", - "imNotSure": "I'm not sure" - } + "caption": "Respond to a property possession claim" } diff --git a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk index 9231c3744..456f1c85e 100644 --- a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk +++ b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk @@ -4,9 +4,7 @@ {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "macros/csrf.njk" import csrfProtection %} -{% block pageTitle %} - {{ pageTitle }} - HM Courts & Tribunals Service – GOV.UK -{% endblock %} +{% block pageTitle %}{{ pageTitle }} – HM Courts & Tribunals Service – GOV.UK{% endblock %} {% block mainContent %} {% if errorSummary %} diff --git a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk index 9231c3744..456f1c85e 100644 --- a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk +++ b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk @@ -4,9 +4,7 @@ {% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} {% from "macros/csrf.njk" import csrfProtection %} -{% block pageTitle %} - {{ pageTitle }} - HM Courts & Tribunals Service – GOV.UK -{% endblock %} +{% block pageTitle %}{{ pageTitle }} – HM Courts & Tribunals Service – GOV.UK{% endblock %} {% block mainContent %} {% if errorSummary %} diff --git a/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk b/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk index 633febb89..e93cc443c 100644 --- a/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk +++ b/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk @@ -2,9 +2,7 @@ {% from "govuk/components/button/macro.njk" import govukButton %} {% from "macros/csrf.njk" import csrfProtection %} -{% block pageTitle %} - {{ pageTitle }} - HM Courts & Tribunals Service – GOV.UK -{% endblock %} +{% block pageTitle %}{{ pageTitle }} – HM Courts & Tribunals Service – GOV.UK{% endblock %} {% block mainContent %} {% if caption %} {{ caption }} From c8500c42723385c8e713414f728a2e4b42b795dc Mon Sep 17 00:00:00 2001 From: alexbzea Date: Thu, 26 Mar 2026 15:32:34 +0000 Subject: [PATCH 14/16] changing translation label from hint to paragraph and making the section label bold as per design --- .../cy/respondToClaim/doYouHaveAnyDependantChildren.json | 2 +- .../cy/respondToClaim/doYouHaveAnyOtherDependants.json | 2 +- .../en/respondToClaim/doYouHaveAnyDependantChildren.json | 2 +- .../en/respondToClaim/doYouHaveAnyOtherDependants.json | 2 +- .../any-other-dependants/anyOtherDependants.njk | 3 +++ .../steps/respond-to-claim/any-other-dependants/index.ts | 6 ++---- .../dependant-children/dependantChildren.njk | 3 +++ src/main/steps/respond-to-claim/dependant-children/index.ts | 6 ++---- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json index 97a3e8199..38b01d71e 100644 --- a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json @@ -2,7 +2,7 @@ "pageTitle": "cyDependant children", "caption": "cyRespond to a property possession claim", "heading": "cyDo you have any dependant children?", - "dependantChildrenHint": "cyDependant children are children you look after financially.", + "dependantChildrenParagraph": "cyDependant children are children you look after financially.", "dependantChildrenDetailsLabel": "cyGive details about your dependant children", "dependantChildrenDetailsHint": "cyYou should include details about how many dependant children you have and how old they are", "errors": { diff --git a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json index 92a01efb0..8b8fc5189 100644 --- a/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json @@ -2,7 +2,7 @@ "pageTitle": "cyOther dependants", "caption": "cyRespond to a property possession claim", "heading": "cyDo you have any other dependants?", - "otherDependantsHint": "cyDependants are people you look after financially, like elderly relatives.", + "otherDependantsParagraph": "cyDependants are people you look after financially, like elderly relatives.", "otherDependantDetailsLabel": "cyGive details about your other dependants", "otherDependantDetailsHint": "cyYou should include details about how many other dependants you have, how old they are and anything else you think the court should know about them", "errors": { diff --git a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json index 492a935bf..be7f42823 100644 --- a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json @@ -2,7 +2,7 @@ "pageTitle": "Dependant children", "caption": "Respond to a property possession claim", "heading": "Do you have any dependant children?", - "dependantChildrenHint": "Dependant children are children you look after financially.", + "dependantChildrenParagraph": "Dependant children are children you look after financially.", "dependantChildrenDetailsLabel": "Give details about your dependant children", "dependantChildrenDetailsHint": "You should include details about how many dependant children you have and how old they are", "errors": { diff --git a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json index e990a8d2e..bd903df54 100644 --- a/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json @@ -2,7 +2,7 @@ "pageTitle": "Other dependants", "caption": "Respond to a property possession claim", "heading": "Do you have any other dependants?", - "otherDependantsHint": "Dependants are people you look after financially, like elderly relatives.", + "otherDependantsParagraph": "Dependants are people you look after financially, like elderly relatives.", "otherDependantDetailsLabel": "Give details about your other dependants", "otherDependantDetailsHint": "You should include details about how many other dependants you have, how old they are and anything else you think the court should know about them", "errors": { diff --git a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk index f6f201bd4..1932ff2b2 100644 --- a/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk +++ b/src/main/steps/respond-to-claim/any-other-dependants/anyOtherDependants.njk @@ -16,6 +16,9 @@ {% if heading %}

{{ heading }}

{% endif %} + {% if paragraph %} +

{{ paragraph }}

+ {% endif %}
{% for field in fields %} diff --git a/src/main/steps/respond-to-claim/any-other-dependants/index.ts b/src/main/steps/respond-to-claim/any-other-dependants/index.ts index 93bcfa0ca..c1f729611 100644 --- a/src/main/steps/respond-to-claim/any-other-dependants/index.ts +++ b/src/main/steps/respond-to-claim/any-other-dependants/index.ts @@ -20,6 +20,7 @@ export const step: StepDefinition = createFormStep({ pageTitle: 'pageTitle', heading: 'heading', caption: 'caption', + paragraph: 'otherDependantsParagraph', }, beforeRedirect: async req => { const otherDependants: string = req.body?.otherDependants; @@ -79,7 +80,6 @@ export const step: StepDefinition = createFormStep({ legendClasses: 'govuk-visually-hidden', translationKey: { label: 'heading', - hint: 'otherDependantsHint', }, errorMessage: 'errors.otherDependants', options: [ @@ -96,9 +96,7 @@ export const step: StepDefinition = createFormStep({ label: 'otherDependantDetailsLabel', hint: 'otherDependantDetailsHint', }, - attributes: { - rows: 5, - }, + labelClasses: 'govuk-label--s', errorMessage: 'errors.otherDependantDetails', }, }, diff --git a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk index f6f201bd4..1932ff2b2 100644 --- a/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk +++ b/src/main/steps/respond-to-claim/dependant-children/dependantChildren.njk @@ -16,6 +16,9 @@ {% if heading %}

{{ heading }}

{% endif %} + {% if paragraph %} +

{{ paragraph }}

+ {% endif %} {% for field in fields %} diff --git a/src/main/steps/respond-to-claim/dependant-children/index.ts b/src/main/steps/respond-to-claim/dependant-children/index.ts index ee1636e2e..888c36097 100644 --- a/src/main/steps/respond-to-claim/dependant-children/index.ts +++ b/src/main/steps/respond-to-claim/dependant-children/index.ts @@ -20,6 +20,7 @@ export const step: StepDefinition = createFormStep({ pageTitle: 'pageTitle', heading: 'heading', caption: 'caption', + paragraph: 'dependantChildrenParagraph', }, beforeRedirect: async req => { const dependantChildren: string = req.body?.dependantChildren; @@ -79,7 +80,6 @@ export const step: StepDefinition = createFormStep({ legendClasses: 'govuk-visually-hidden', translationKey: { label: 'heading', - hint: 'dependantChildrenHint', }, errorMessage: 'errors.dependantChildren', options: [ @@ -96,9 +96,7 @@ export const step: StepDefinition = createFormStep({ label: 'dependantChildrenDetailsLabel', hint: 'dependantChildrenDetailsHint', }, - attributes: { - rows: 5, - }, + labelClasses: 'govuk-label--s', errorMessage: 'errors.dependantChildrenDetails', }, }, From 9a246e8d2ec8be79f1ff2131a5f71ab75c17aca5 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Thu, 26 Mar 2026 16:09:04 +0000 Subject: [PATCH 15/16] matching types with ccd ones --- src/main/interfaces/ccdCase.interface.ts | 14 +++++++------- .../respond-to-claim/any-other-dependants/index.ts | 6 +++--- .../respond-to-claim/dependant-children/index.ts | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/interfaces/ccdCase.interface.ts b/src/main/interfaces/ccdCase.interface.ts index 1225c795b..a7ccac37c 100644 --- a/src/main/interfaces/ccdCase.interface.ts +++ b/src/main/interfaces/ccdCase.interface.ts @@ -3,17 +3,17 @@ export enum CaseState { SUBMITTED = 'Submitted', } -export type YesNoValue = 'YES' | 'NO' | null; -export type YesNoCapitalised = 'Yes' | 'No'; +export type VerticalYesNoValue = 'YES' | 'NO' | null; +export type YesNoValue = 'Yes' | 'No'; export type YesNoNotSureValue = 'YES' | 'NO' | 'NOT_SURE'; export type ContactPreference = 'EMAIL' | 'POST' | null; export interface HouseholdCircumstances { - dependantChildren?: YesNoCapitalised; + dependantChildren?: YesNoValue; dependantChildrenDetails?: string; - otherDependants?: YesNoCapitalised; + otherDependants?: YesNoValue; otherDependantDetails?: string; } @@ -55,7 +55,7 @@ export interface PossessionClaimResponse { firstName?: string; lastName?: string; address?: Address; - phoneNumberProvided?: YesNoValue; + phoneNumberProvided?: VerticalYesNoValue; phoneNumber?: string; emailAddress?: string; }; @@ -63,8 +63,8 @@ export interface PossessionClaimResponse { defendantResponses?: { tenancyStartDateCorrect?: string; tenancyStartDate?: string; - contactByPhone?: YesNoValue; - contactByText?: YesNoValue; + contactByPhone?: VerticalYesNoValue; + contactByText?: VerticalYesNoValue; preferenceType?: ContactPreference; freeLegalAdvice?: string; defendantNameConfirmation?: string; diff --git a/src/main/steps/respond-to-claim/any-other-dependants/index.ts b/src/main/steps/respond-to-claim/any-other-dependants/index.ts index c1f729611..03747e6cc 100644 --- a/src/main/steps/respond-to-claim/any-other-dependants/index.ts +++ b/src/main/steps/respond-to-claim/any-other-dependants/index.ts @@ -2,7 +2,7 @@ import type { CaseData, HouseholdCircumstances, PossessionClaimResponse, - YesNoCapitalised, + YesNoValue, } from '../../../interfaces/ccdCase.interface'; import type { StepDefinition } from '../../../interfaces/stepFormData.interface'; import { buildCcdCaseForPossessionClaimResponse } from '../../utils/populateResponseToClaimPayloadmap'; @@ -29,7 +29,7 @@ export const step: StepDefinition = createFormStep({ return; } - const enumMapping: Record = { + const enumMapping: Record = { yes: 'Yes', no: 'No', }; @@ -56,7 +56,7 @@ export const step: StepDefinition = createFormStep({ const caseData: CaseData | undefined = req.res?.locals?.validatedCase?.data; const householdCircumstances: HouseholdCircumstances | undefined = caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; - const otherDependantsCcd: YesNoCapitalised | undefined = householdCircumstances?.otherDependants; + const otherDependantsCcd: YesNoValue | undefined = householdCircumstances?.otherDependants; if (!otherDependantsCcd) { return {}; diff --git a/src/main/steps/respond-to-claim/dependant-children/index.ts b/src/main/steps/respond-to-claim/dependant-children/index.ts index 888c36097..a00467773 100644 --- a/src/main/steps/respond-to-claim/dependant-children/index.ts +++ b/src/main/steps/respond-to-claim/dependant-children/index.ts @@ -2,7 +2,7 @@ import type { CaseData, HouseholdCircumstances, PossessionClaimResponse, - YesNoCapitalised, + YesNoValue, } from '../../../interfaces/ccdCase.interface'; import type { StepDefinition } from '../../../interfaces/stepFormData.interface'; import { buildCcdCaseForPossessionClaimResponse } from '../../utils/populateResponseToClaimPayloadmap'; @@ -29,7 +29,7 @@ export const step: StepDefinition = createFormStep({ return; } - const enumMapping: Record = { + const enumMapping: Record = { yes: 'Yes', no: 'No', }; @@ -56,7 +56,7 @@ export const step: StepDefinition = createFormStep({ const caseData: CaseData | undefined = req.res?.locals?.validatedCase?.data; const householdCircumstances: HouseholdCircumstances | undefined = caseData?.possessionClaimResponse?.defendantResponses?.householdCircumstances; - const dependantChildrenCcd: YesNoCapitalised | undefined = householdCircumstances?.dependantChildren; + const dependantChildrenCcd: YesNoValue | undefined = householdCircumstances?.dependantChildren; if (!dependantChildrenCcd) { return {}; From 76bddc0276a766d0b32a724c832301a94bd69e17 Mon Sep 17 00:00:00 2001 From: alexbzea Date: Fri, 27 Mar 2026 11:59:04 +0000 Subject: [PATCH 16/16] small refactor to remove types on unused parameters --- src/main/steps/respond-to-claim/flow.config.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/steps/respond-to-claim/flow.config.ts b/src/main/steps/respond-to-claim/flow.config.ts index 99d827acc..cb616285f 100644 --- a/src/main/steps/respond-to-claim/flow.config.ts +++ b/src/main/steps/respond-to-claim/flow.config.ts @@ -326,19 +326,13 @@ export const flowConfig: JourneyFlowConfig = { previousStep: 'repayments-made', routes: [ { - condition: async ( - _req: Request, - _formData: Record, - currentStepData: Record - ) => currentStepData?.repaymentsAgreed === 'yes' || currentStepData?.repaymentsAgreed === 'imNotSure', + condition: async (_req, _formData, currentStepData: Record) => + currentStepData?.repaymentsAgreed === 'yes' || currentStepData?.repaymentsAgreed === 'imNotSure', nextStep: 'your-household-and-circumstances', }, { - condition: async ( - _req: Request, - _formData: Record, - currentStepData: Record - ) => currentStepData?.repaymentsAgreed === 'no', + condition: async (_req, _formData, currentStepData: Record) => + currentStepData?.repaymentsAgreed === 'no', nextStep: 'repayments-agreed', }, ],