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 new file mode 100644 index 000000000..38b01d71e --- /dev/null +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyDependantChildren.json @@ -0,0 +1,12 @@ +{ + "pageTitle": "cyDependant children", + "caption": "cyRespond to a property possession claim", + "heading": "cyDo you have any dependant children?", + "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": { + "dependantChildren": "cySelect if you have any dependant children.", + "dependantChildrenDetails": "cyGive details about your dependant children." + } +} 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..8b8fc5189 --- /dev/null +++ b/src/main/assets/locales/cy/respondToClaim/doYouHaveAnyOtherDependants.json @@ -0,0 +1,12 @@ +{ + "pageTitle": "cyOther dependants", + "caption": "cyRespond to a property possession claim", + "heading": "cyDo you have any other dependants?", + "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": { + "otherDependants": "cySelect if you have any other dependants.", + "otherDependantDetails": "cyGive details about your other dependants." + } +} 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..9645b07ca --- /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." +} 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 new file mode 100644 index 000000000..be7f42823 --- /dev/null +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyDependantChildren.json @@ -0,0 +1,12 @@ +{ + "pageTitle": "Dependant children", + "caption": "Respond to a property possession claim", + "heading": "Do you have any dependant children?", + "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": { + "dependantChildren": "Select if you have any dependant children.", + "dependantChildrenDetails": "Give details about your dependant children." + } +} 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..bd903df54 --- /dev/null +++ b/src/main/assets/locales/en/respondToClaim/doYouHaveAnyOtherDependants.json @@ -0,0 +1,12 @@ +{ + "pageTitle": "Other dependants", + "caption": "Respond to a property possession claim", + "heading": "Do you have any other dependants?", + "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": { + "otherDependants": "Select if you have any other dependants.", + "otherDependantDetails": "Give details about your other dependants." + } +} diff --git a/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json b/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json index afce185c2..975fa7605 100644 --- a/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json +++ b/src/main/assets/locales/en/respondToClaim/repaymentsAgreed.json @@ -1,4 +1,4 @@ { - "pageTitle": "Repayments agreed", + "pageTitle": "Repayments agreed (placeholder)", "caption": "Respond to a property possession claim" } 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..48fe65de6 --- /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." +} diff --git a/src/main/interfaces/ccdCase.interface.ts b/src/main/interfaces/ccdCase.interface.ts index c7bc4c8ae..a7ccac37c 100644 --- a/src/main/interfaces/ccdCase.interface.ts +++ b/src/main/interfaces/ccdCase.interface.ts @@ -3,11 +3,20 @@ export enum CaseState { SUBMITTED = 'Submitted', } -export type YesNoValue = 'YES' | 'NO' | null; -export type ContactPreference = 'EMAIL' | 'POST' | null; +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?: YesNoValue; + dependantChildrenDetails?: string; + otherDependants?: YesNoValue; + otherDependantDetails?: string; +} + export interface CcdUserCase { id: string; state: CaseState; @@ -36,13 +45,17 @@ export interface Address { Country?: string; } +export interface CaseData { + possessionClaimResponse?: PossessionClaimResponse; +} + export interface PossessionClaimResponse { defendantContactDetails?: { party?: { firstName?: string; lastName?: string; address?: Address; - phoneNumberProvided?: YesNoValue; + phoneNumberProvided?: VerticalYesNoValue; phoneNumber?: string; emailAddress?: string; }; @@ -50,14 +63,15 @@ export interface PossessionClaimResponse { defendantResponses?: { tenancyStartDateCorrect?: string; tenancyStartDate?: string; - contactByPhone?: YesNoValue; - contactByText?: YesNoValue; + contactByPhone?: VerticalYesNoValue; + contactByText?: VerticalYesNoValue; preferenceType?: ContactPreference; freeLegalAdvice?: string; defendantNameConfirmation?: string; dateOfBirth?: string; landlordRegistered?: YesNoNotSureValue; landlordLicensed?: YesNoNotSureValue; + householdCircumstances?: HouseholdCircumstances; }; } 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 805a2271f..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 @@ -1,14 +1,34 @@ {% extends "stepsTemplate.njk" %} +{% from "govuk/components/radios/macro.njk" import govukRadios %} {% from "macros/stepButtons.njk" import stepButtons %} {% 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 %} -
This is a placeholder for Do You Have Any Other Dependants step.
+ {% if caption %} + {{ caption }} + {% endif %} + {% if heading %} +{{ paragraph }}
+ {% endif %} + 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..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 @@ -1,4 +1,11 @@ +import type { + CaseData, + HouseholdCircumstances, + PossessionClaimResponse, + YesNoValue, +} 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,94 @@ export const step: StepDefinition = createFormStep({ journeyFolder: 'respondToClaim', stepDir: __dirname, flowConfig, - fields: [], customTemplate: `${__dirname}/anyOtherDependants.njk`, + translationKeys: { + pageTitle: 'pageTitle', + heading: 'heading', + caption: 'caption', + paragraph: 'otherDependantsParagraph', + }, + beforeRedirect: async req => { + const otherDependants: string = req.body?.otherDependants; + + if (!otherDependants) { + return; + } + + const enumMapping: RecordThis is a placeholder for Do You Have Any Dependant Children step.
+ {% if caption %} + {{ caption }} + {% endif %} + {% if heading %} +{{ paragraph }}
+ {% endif %} + 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..a00467773 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,11 @@ +import type { + CaseData, + HouseholdCircumstances, + PossessionClaimResponse, + YesNoValue, +} 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,94 @@ export const step: StepDefinition = createFormStep({ journeyFolder: 'respondToClaim', stepDir: __dirname, flowConfig, - fields: [], customTemplate: `${__dirname}/dependantChildren.njk`, + translationKeys: { + pageTitle: 'pageTitle', + heading: 'heading', + caption: 'caption', + paragraph: 'dependantChildrenParagraph', + }, + beforeRedirect: async req => { + const dependantChildren: string = req.body?.dependantChildren; + + if (!dependantChildren) { + return; + } + + const enumMapping: Recorddummy page
- {% endblock %} \ 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 a31a42510..e93cc443c 100644 --- a/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk +++ b/src/main/steps/respond-to-claim/situation-interstitial/situationInterstitial.njk @@ -1,15 +1,35 @@ {% extends "stepsTemplate.njk" %} -{% from "macros/stepButtons.njk" import stepButtons %} -{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %} +{% 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 mainContent %} - {% if errorSummary %} - {{ govukErrorSummary(errorSummary) }} + {% if caption %} + {{ caption }} {% endif %} -This is a placeholder for the Your Household And Circumstances step.
+ {% if heading %} +{{ paragraph1 }}
+{{ paragraph2 }}
+{{ paragraph3 }}
{% endblock %}