From c0d87d32ad687a98dfb8ffe8a430384c3776570c Mon Sep 17 00:00:00 2001 From: Simon Middleton Date: Thu, 19 Mar 2026 16:22:37 +0000 Subject: [PATCH 1/4] Initial commit 3571 backend --- README.md | 100 +++++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index d87035df80..144471bb26 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# pcs-api +# pcs-api - SDM Comment ## Building and deploying the application @@ -18,12 +18,13 @@ To build the project execute the following command: ```bash ./gradlew bootWithCCD ``` + Above command starts PCS API + CCD & all dependencies This will start several containers: | Container | Port | -|-----------------------------------|------| +| --------------------------------- | ---- | | PCS-API | 3206 | | XUI Manage case (UI Access point) | 3000 | | Elastic search | 9200 | @@ -54,7 +55,7 @@ Then set the following environment variables based on the value below or named s from the PCS AAT key vault: | Environment Variable | Value or Secret Name | -|------------------------------|------------------------------------------------------------------------------| +| ---------------------------- | ---------------------------------------------------------------------------- | | LOCATION_REF_URL | http://rd-location-ref-api-aat.service.core-compute-aat.internal | | DATA_STORE_URL_BASE | https://ccd-data-store-api-pcs-api-pr-{CHANGE_ID}.preview.platform.hmcts.net | | PCS_API_S2S_SECRET | secret: pcs-api-s2s-secret | @@ -66,7 +67,6 @@ from the PCS AAT key vault: | IDAM_PCS_USER_PASSWORD | secret: idam-pcs-user-password | | PCS_SOLICITOR_AUTOMATION_UID | secret: pcs-solicitor-automation-uid | - Finally, run the service with the `bootWithCCD` task as above. In order to test if the API is healthy, you can call its health endpoint: @@ -93,6 +93,7 @@ To access the swagger documentation for the API, go to http://localhost:3206/swa The Functional tests use [Rest Assured](https://rest-assured.io) and [Serenity](https://serenity-bdd.github.io) for reporting, and are located in the `/src/functionalTest` directory. The following environment variables are needed to run the tests: + - PCS_API_S2S_SECRET - TEST_URL - IDAM_S2S_AUTH_URL @@ -104,14 +105,16 @@ The following environment variables are needed to run the tests: - S2S_EXPIRED_TOKEN To run the tests, use: + ```bash ./gradlew functional -```` +``` To run tests based on tags, use the following command (replace `tagName` with the desired tag): + ```bash ./gradlew functional -Dtags="tagName" -```` +``` Additionally, you can configure the tags to run in the pipeline by editing the functional task in the `build.gradle`, line: @@ -127,13 +130,14 @@ This is done with: ```bash cd src/e2eTest -```` +``` Before running any tests, please install all required packages: ```bash yarn install -```` +``` + Running the tests: The e2e tests use playwright, and are located in the /src/e2eTest directory. @@ -149,9 +153,11 @@ The following environment variables are needed to run the tests: The e2e suite can be run with the following command: To run the critical tests/PR tagged tests, use: + ```bash yarn test:pr -```` +``` + There are also several custom test scripts available: - `yarn test:regression` - runs regression tagged tests @@ -163,6 +169,7 @@ To open generated Allure report ```bash yarn test:openAllureReport ``` + Permanent IDAM Users: All permanent users needs to be added to ./data/permanent-users.data Temporary IDAM Users: @@ -184,47 +191,48 @@ response for the possession claim fee: **Headers**: Content-Type:application/json **Body**: + ```json { - "request": { - "method": "GET", - "urlPath": "/fees-register/fees/lookup", - "queryParameters": { - "service": { - "equalTo": "possession claim" - }, - "jurisdiction1": { - "equalTo": "civil" - }, - "jurisdiction2": { - "equalTo": "county court" - }, - "channel": { - "equalTo": "default" - }, - "event": { - "equalTo": "issue" - }, - "amount_or_volume": { - "equalTo": "1" - }, - "keyword": { - "equalTo": "PossessionCC" - } - } + "request": { + "method": "GET", + "urlPath": "/fees-register/fees/lookup", + "queryParameters": { + "service": { + "equalTo": "possession claim" + }, + "jurisdiction1": { + "equalTo": "civil" + }, + "jurisdiction2": { + "equalTo": "county court" + }, + "channel": { + "equalTo": "default" + }, + "event": { + "equalTo": "issue" + }, + "amount_or_volume": { + "equalTo": "1" + }, + "keyword": { + "equalTo": "PossessionCC" + } + } + }, + "response": { + "status": 200, + "jsonBody": { + "code": "FEE0412", + "description": "Recovery of Land - County Court (Test)", + "version": 1, + "fee_amount": 1234.56 }, - "response": { - "status": 200, - "jsonBody": { - "code": "FEE0412", - "description": "Recovery of Land - County Court (Test)", - "version": 1, - "fee_amount": 1234.56 - }, - "headers": { - "Content-Type": "application/json" - } + "headers": { + "Content-Type": "application/json" } + } } ``` From e5c0f1a16509ed40cea7e6a616bd19326e94f6da Mon Sep 17 00:00:00 2001 From: Simon Middleton Date: Mon, 23 Mar 2026 17:54:55 +0000 Subject: [PATCH 2/4] initial setup for household circumstances data persistence --- .../respondpossessionclaim/HouseholdCircumstances.java | 6 ++++++ .../HouseholdCircumstancesService.java | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java index 63b5b90d92..5e122a53fe 100644 --- a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java +++ b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java @@ -17,4 +17,10 @@ public class HouseholdCircumstances { @CCD private YesOrNo dependantChildren; + @CCD + private YesOrNo shareAdditionalCircumstances; + + @CCD + private String additionalCircumstancesDetails; + } diff --git a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java index 2c4ec07507..4949e6ef1e 100644 --- a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java +++ b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java @@ -15,6 +15,8 @@ public HouseholdCircumstancesEntity createHouseholdCircumstancesEntity(Household HouseholdCircumstancesEntity householdCircumstancesEntity = HouseholdCircumstancesEntity.builder() .dependantChildren(circumstances.getDependantChildren()) + .shareAdditionalCircumstances(circumstances.getShareAdditionalCircumstances()) + .additionalCircumstancesDetails(circumstances.getAdditionalCircumstancesDetails()) .build(); return householdCircumstancesEntity; From 51dfb53488332dc2aa5487259cd1f112c00e09f9 Mon Sep 17 00:00:00 2001 From: Simon Middleton Date: Tue, 24 Mar 2026 14:28:40 +0000 Subject: [PATCH 3/4] exceptional hardship db persistence --- .../respondpossessionclaim/HouseholdCircumstances.java | 6 ++++++ .../HouseholdCircumstancesService.java | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java index 5e122a53fe..aa19af1891 100644 --- a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java +++ b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java @@ -23,4 +23,10 @@ public class HouseholdCircumstances { @CCD private String additionalCircumstancesDetails; + @CCD + private YesOrNo exceptionalHardship; + + @CCD + private String exceptionalHardshipDetails; + } diff --git a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java index 4949e6ef1e..729a0d2930 100644 --- a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java +++ b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/service/respondpossessionclaim/HouseholdCircumstancesService.java @@ -17,6 +17,8 @@ public HouseholdCircumstancesEntity createHouseholdCircumstancesEntity(Household .dependantChildren(circumstances.getDependantChildren()) .shareAdditionalCircumstances(circumstances.getShareAdditionalCircumstances()) .additionalCircumstancesDetails(circumstances.getAdditionalCircumstancesDetails()) + .exceptionalHardship(circumstances.getExceptionalHardship()) + .exceptionalHardshipDetails(circumstances.getExceptionalHardshipDetails()) .build(); return householdCircumstancesEntity; From 08ba92b78edb1a7a145ed213311ca8b5135027c1 Mon Sep 17 00:00:00 2001 From: Simon Middleton Date: Wed, 25 Mar 2026 09:48:01 +0000 Subject: [PATCH 4/4] removing readme comment and setting max character on household string responses --- README.md | 2 +- .../domain/respondpossessionclaim/HouseholdCircumstances.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 144471bb26..53ebefd17e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# pcs-api - SDM Comment +# pcs-api ## Building and deploying the application diff --git a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java index aa19af1891..8ef7fc99fa 100644 --- a/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java +++ b/src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/respondpossessionclaim/HouseholdCircumstances.java @@ -20,13 +20,13 @@ public class HouseholdCircumstances { @CCD private YesOrNo shareAdditionalCircumstances; - @CCD + @CCD(max = 500) private String additionalCircumstancesDetails; @CCD private YesOrNo exceptionalHardship; - @CCD + @CCD(max = 500) private String exceptionalHardshipDetails; }