Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"pageTitle": "Have you applied for Universal Credit?",
"caption": "Respond to a property possession claim",
"question": "Have you applied for Universal Credit?",
"dateLabel": "When did you apply?",
"dateHint": "For example, 27 9 2022",
"options": {
"yes": "Yes",
"no": "No"
},
"errors": {
"haveAppliedForUniversalCredit": "Select if you’ve applied for Universal Credit",
"date": {
"required": "Enter the date you applied for Universal Credit",
"missingOne": "The date you applied for Universal Credit must include a {{missingField}}",
"missingTwo": "The date you applied for Universal Credit must include a {{first}} and {{second}}",
"notRealDate": "The date you applied for Universal Credit must be a real date",
"futureDate": "The date you applied for Universal Credit must must either be today’s date or in the past"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"pageTitle": "Priority debt details",
"caption": "Respond to a property possession claim",
"totalQuestion": "What is the total amount you owe for all your priority debts?",
"contributionQuestion": "How much do you pay towards your priority debts each week or month?",
"frequencyQuestion": "Paid every:",
"amountHint": "Enter total amount in pounds and pence, for example £148.00 or £148.50",
"frequency": {
"week": "Week",
"month": "Month"
},
"errors": {
"priorityDebtTotal": "Enter the total amount you owe for all your priority debts",
"priorityDebtTotalMin": "The total amount you owe for all your priority debts must be £0.00 or above",
"priorityDebtTotalMax": "The total amount you owe for all your priority debts must be less than £1 billion",
"priorityDebtContribution": "Enter the amount you pay towards your priority debts each week or month",
"priorityDebtContributionMin": "The amount you pay towards your priority debts each week or month must be £0.00 or above",
"priorityDebtContributionMax": "The amount you pay towards your priority debts each week or month must be less than £1 billion",
"priorityDebtContributionFrequency": "Select how frequently you pay the amount you entered above",
"amount": {
"invalidFormat": "Enter an amount in the correct format, for example £148.00 or £148.50"
}
}
}
24 changes: 24 additions & 0 deletions src/main/assets/locales/cy/respondToClaim/priorityDebts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"pageTitle": "Priority debts",
"caption": "Respond to a property possession claim",
"paragraph1": "Priority debts are debts which could lead to serious consequences if you do not pay them.",
"paragraph2": "Excluding rent or mortgage arrears, priority debts are:",
"bullet1": "council tax arrears",
"bullet2": "gas or electricity arrears",
"bullet3": "phone or internet arrears",
"bullet4": "TV licence arrears",
"bullet5": "court fines",
"bullet6": "overpaid tax credits",
"bullet7": "payments for goods bought on hire purchase or conditional sale",
"bullet8": "unpaid income tax, National Insurance or VAT",
"bullet9": "unpaid child maintenance",
"guidanceLinkText": "Read guidance from Citizens Advice on what counts as a priority debt (opens in new tab)",
"question": "Do you have any priority debts?",
"options": {
"yes": "Yes",
"no": "No"
},
"errors": {
"havePriorityDebts": "Select if you have any priority debts"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"pageTitle": "Have you applied for Universal Credit?",
"caption": "Respond to a property possession claim",
"question": "Have you applied for Universal Credit?",
"dateLabel": "When did you apply?",
"dateHint": "For example, 27 9 2022",
"options": {
"yes": "Yes",
"no": "No"
},
"errors": {
"haveAppliedForUniversalCredit": "Select if you’ve applied for Universal Credit",
"date": {
"required": "Enter the date you applied for Universal Credit",
"missingOne": "The date you applied for Universal Credit must include a {{missingField}}",
"missingTwo": "The date you applied for Universal Credit must include a {{first}} and {{second}}",
"notRealDate": "The date you applied for Universal Credit must be a real date",
"futureDate": "The date you applied for Universal Credit must must either be today’s date or in the past"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"pageTitle": "Priority debt details",
"caption": "Respond to a property possession claim",
"totalQuestion": "What is the total amount you owe for all your priority debts?",
"contributionQuestion": "How much do you pay towards your priority debts each week or month?",
"frequencyQuestion": "Paid every:",
"amountHint": "Enter total amount in pounds and pence, for example £148.00 or £148.50",
"frequency": {
"week": "Week",
"month": "Month"
},
"errors": {
"priorityDebtTotal": "Enter the total amount you owe for all your priority debts",
"priorityDebtTotalMin": "The total amount you owe for all your priority debts must be £0.00 or above",
"priorityDebtTotalMax": "The total amount you owe for all your priority debts must be less than £1 billion",
"priorityDebtContribution": "Enter the amount you pay towards your priority debts each week or month",
"priorityDebtContributionMin": "The amount you pay towards your priority debts each week or month must be £0.00 or above",
"priorityDebtContributionMax": "The amount you pay towards your priority debts each week or month must be less than £1 billion",
"priorityDebtContributionFrequency": "Select how frequently you pay the amount you entered above",
"amount": {
"invalidFormat": "Enter an amount in the correct format, for example £148.00 or £148.50"
}
}
}
24 changes: 24 additions & 0 deletions src/main/assets/locales/en/respondToClaim/priorityDebts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"pageTitle": "Priority debts",
"caption": "Respond to a property possession claim",
"paragraph1": "Priority debts are debts which could lead to serious consequences if you do not pay them.",
"paragraph2": "Excluding rent or mortgage arrears, priority debts are:",
"bullet1": "council tax arrears",
"bullet2": "gas or electricity arrears",
"bullet3": "phone or internet arrears",
"bullet4": "TV licence arrears",
"bullet5": "court fines",
"bullet6": "overpaid tax credits",
"bullet7": "payments for goods bought on hire purchase or conditional sale",
"bullet8": "unpaid income tax, National Insurance or VAT",
"bullet9": "unpaid child maintenance",
"guidanceLinkText": "Read guidance from Citizens Advice on what counts as a priority debt (opens in new tab)",
"question": "Do you have any priority debts?",
"options": {
"yes": "Yes",
"no": "No"
},
"errors": {
"havePriorityDebts": "Select if you have any priority debts"
}
}
10 changes: 10 additions & 0 deletions src/main/assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
font-weight: 300;
}

// Priority debt details: "Paid every:" week/month radios (15px gap; GOV.UK default is 10px)
.priority-debt-details-paid-every-radios .govuk-radios__item {
margin-bottom: govuk-spacing(3);
}

.priority-debt-details-paid-every-radios .govuk-radios__item:last-child,
.priority-debt-details-paid-every-radios .govuk-radios__item:last-of-type {
margin-bottom: 0;
}

.correspondence-address-form {
.pcs-address-component {
.govuk-details__text {
Expand Down
8 changes: 8 additions & 0 deletions src/main/interfaces/ccdCase.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ export interface PossessionClaimResponse {
writtenTerms?: YesNoNotSureValue;
disputeClaim?: YesNoValue;
disputeClaimDetails?: string;
householdCircumstances?: {
universalCredit?: YesNoValue;
ucApplicationDate?: string;
priorityDebts?: YesNoValue;
debtTotal?: string;
debtContribution?: string;
debtContributionFrequency?: string;
};
paymentAgreement?: {
repaymentPlanAgreed?: YesNoNotSureValue;
repaymentAgreedDetails?: string;
Expand Down
2 changes: 2 additions & 0 deletions src/main/interfaces/formFieldConfig.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export interface FormFieldConfig {
errorMessage?: string;
label?: string | ((translations: Record<string, string>) => string);
labelClasses?: string;
formGroupClasses?: string;
hintClasses?: string;
hint?: string;
translationKey?: {
label?: string;
Expand Down
13 changes: 12 additions & 1 deletion src/main/modules/steps/formBuilder/componentBuilders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ export function buildComponentConfig({
id: field.name,
name: field.name,
label: { text: label, classes: field.labelClasses },
hint: hint ? { text: hint } : null,
hint: hint
? {
text: hint,
...(field.hintClasses ? { classes: field.hintClasses } : {}),
}
: null,
errorMessage: hasError && errorText ? { text: errorText } : null,
classes: field.classes || (field.type === 'text' ? 'govuk-!-width-three-quarters' : undefined),
attributes: field.attributes || {},
Expand All @@ -70,6 +75,12 @@ export function buildComponentConfig({
if (field.prefix) {
component.prefix = field.prefix;
}
if (field.formGroupClasses) {
component.formGroup = {
classes: field.formGroupClasses,
attributes: {},
};
}
componentType = 'input';
break;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/modules/steps/formBuilder/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export const FormFieldConfigSchema: z.ZodType<FormFieldConfig> = z.lazy(() =>
// Label can be string or function
label: LabelFunctionSchema.optional(),
labelClasses: z.string().optional(),
formGroupClasses: z.string().optional(),
hintClasses: z.string().optional(),
hint: z.string().optional(),
translationKey: z
.object({
Expand Down
59 changes: 56 additions & 3 deletions src/main/steps/respond-to-claim/flow.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { type Request } from 'express';

import type { JourneyFlowConfig } from '../../interfaces/stepFlow.interface';
import {
getPreviousStepForWhatOtherRegularExpenses,
getPreviousStepForYourHouseholdAndCircumstances,
getStepBeforeDisputePages,
hasAnyRentArrearsGround,
hasOnlyRentArrearsGrounds,
hasSelectedUniversalCredit,
isDefendantNameKnown,
isNoticeDateProvided,
isNoticeServed,
Expand Down Expand Up @@ -419,22 +421,73 @@ export const flowConfig: JourneyFlowConfig = {
},
'what-regular-income-do-you-receive': {
previousStep: 'income-and-expenditure',
routes: [
{
condition: async (
_req: Request,
_formData: Record<string, unknown>,
currentStepData: Record<string, unknown>
): Promise<boolean> => {
const selected = currentStepData.regularIncome;
if (Array.isArray(selected)) {
return selected.includes('universalCredit');
}
return selected === 'universalCredit';
},
nextStep: 'priority-debts',
},
{
condition: async (
_req: Request,
_formData: Record<string, unknown>,
currentStepData: Record<string, unknown>
): Promise<boolean> => {
const selected = currentStepData.regularIncome;
if (Array.isArray(selected)) {
return !selected.includes('universalCredit');
}
return selected !== 'universalCredit';
},
nextStep: 'have-you-applied-for-universal-credit',
},
],
defaultNext: 'have-you-applied-for-universal-credit',
},
'have-you-applied-for-universal-credit': {
previousStep: 'what-regular-income-do-you-receive',
defaultNext: 'priority-debts',
},
'priority-debts': {
previousStep: 'have-you-applied-for-universal-credit',
defaultNext: 'priority-debt-details',
previousStep: async (req: Request): Promise<string> => {
const selectedUniversalCredit = await hasSelectedUniversalCredit(req);
return selectedUniversalCredit ? 'what-regular-income-do-you-receive' : 'have-you-applied-for-universal-credit';
},
routes: [
{
condition: async (
_req: Request,
_formData: Record<string, unknown>,
currentStepData: Record<string, unknown>
): Promise<boolean> => currentStepData.havePriorityDebts === 'yes',
nextStep: 'priority-debt-details',
},
{
condition: async (
_req: Request,
_formData: Record<string, unknown>,
currentStepData: Record<string, unknown>
): Promise<boolean> => currentStepData.havePriorityDebts === 'no',
nextStep: 'what-other-regular-expenses-do-you-have',
},
],
defaultNext: 'what-other-regular-expenses-do-you-have',
},
'priority-debt-details': {
previousStep: 'priority-debts',
defaultNext: 'what-other-regular-expenses-do-you-have',
},
'what-other-regular-expenses-do-you-have': {
previousStep: 'priority-debt-details',
previousStep: getPreviousStepForWhatOtherRegularExpenses,
defaultNext: 'end-now',
},
},
Expand Down
Loading