Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e96647c
HDPI-2036: Statement Of Truth
arun-hmcts Nov 10, 2025
a4ce4bf
HDPI-2036: Add StatementOfTruthServiceTest with essential test cases
arun-hmcts Nov 10, 2025
4bfee3e
HDPI-2036: Remove unused import from StatementOfTruthServiceTest
arun-hmcts Nov 10, 2025
ec4894a
HDPI-2036: Encapsulate Statement of Truth fields in complex type
arun-hmcts Nov 11, 2025
58438b0
Merge remote-tracking branch 'origin/master' into HDPI-2036-statement…
arun-hmcts Nov 11, 2025
7dec21b
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
arun-hmcts Nov 11, 2025
8d51f7e
HDPI-2036: Add midEvent tests for StatementOfTruth page
arun-hmcts Nov 11, 2025
e1a91f2
HDPI-2036: Persist enum names instead of labels in StatementOfTruth
arun-hmcts Nov 11, 2025
c29b2a8
HDPI-2036: Combine separator and body labels in StatementOfTruth page
arun-hmcts Nov 11, 2025
0e6d527
Merge remote-tracking branch 'origin/master' into HDPI-2036-statement…
arun-hmcts Nov 11, 2025
7bae38b
HDPI-2036: Change agreement fields from List to String in StatementOf…
arun-hmcts Nov 11, 2025
0989bdf
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
jors95-moj Nov 12, 2025
f798ded
Update plugin au.com.dius.pact to v4.6.18 (#932)
renovate[bot] Nov 12, 2025
f61b813
Update logback monorepo to v1.5.21 (#931)
renovate[bot] Nov 12, 2025
22635c1
Update plugin com.github.hmcts.rse-cft-lib to v0.19.1922 (#933)
renovate[bot] Nov 12, 2025
fe39aff
Hdpi 2191 assured tenancy gfp money judgment (#880)
arun-hmcts Nov 12, 2025
643c158
Update plugin hmcts.ccd.sdk to v6.5.2 (#934)
renovate[bot] Nov 12, 2025
fbe8d53
Cleanup payment dummy event code from HDPI-1277 (#923)
adusumillipraveen Nov 12, 2025
ddff7b7
Merge remote-tracking branch 'origin/master' into HDPI-2036-statement…
arun-hmcts Nov 12, 2025
a6dc697
Refactor StatementOfTruth to use enum types instead of Strings
arun-hmcts Nov 12, 2025
af071c8
HDPI-2036: Remove StatementOfTruthTest - tests for removed midEvent h…
arun-hmcts Nov 12, 2025
95c5454
HDPI-2036: Update StatementOfTruthCompletedBy label to include CPR 2.…
arun-hmcts Nov 12, 2025
932fa10
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
madhavi1203 Nov 13, 2025
ffe8bc3
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
arun-hmcts Nov 14, 2025
3482340
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
madhavi1203 Nov 14, 2025
88f9b38
Merge remote-tracking branch 'origin/master' into HDPI-2036-statement…
arun-hmcts Nov 17, 2025
44e2670
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
madhavi1203 Nov 17, 2025
d82742b
HDPI-2036-QA (#924)
madhavi1203 Nov 17, 2025
9e3ef5f
Merge origin/master into HDPI-2036-statement-of-truth-screen-english-…
arun-hmcts Nov 18, 2025
c40513d
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
arun-hmcts Nov 18, 2025
5078132
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
madhavi1203 Nov 18, 2025
c268220
HDPI-2036: Rename statement of truth migration to V037 to resolve con…
arun-hmcts Nov 18, 2025
9f4511b
HDPI-2036: Remove debug log statements from RentArrearsGroundForPosse…
arun-hmcts Nov 18, 2025
66f9733
Merge branch 'master' into HDPI-2036-statement-of-truth-screen-englis…
MoLala1 Nov 18, 2025
087901e
merge conflict
madhavi1203 Nov 18, 2025
b8255ed
HDPI-2036: Merge origin/master and resolve conflict in RentArrearsGro…
arun-hmcts Nov 18, 2025
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
32 changes: 31 additions & 1 deletion src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/PCSCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class PCSCase {
// Field label constants - shared between domain annotations and validation
public static final String NOTICE_EMAIL_EXPLANATION_LABEL = "Explain how it was served by email";
public static final String NOTICE_OTHER_EXPLANATION_LABEL = "Explain what the other means were";
public static final String DETAILS_OF_OTHER_TYPE_OF_TENANCY_LICENCE_LABEL =
public static final String DETAILS_OF_OTHER_TYPE_OF_TENANCY_LICENCE_LABEL =
"Give details of the type of tenancy or licence agreement that's in place";

@CCD(
Expand Down Expand Up @@ -734,4 +734,34 @@ public class PCSCase {
)
private WaysToPay waysToPay;

@CCD(label = "Completed by")
private StatementOfTruthCompletedBy statementOfTruthCompletedBy;

@CCD(
typeOverride = FieldType.MultiSelectList,
typeParameterOverride = "StatementOfTruthAgreementClaimant"
)
private List<StatementOfTruthAgreementClaimant> statementOfTruthAgreementClaimant;

@CCD(label = "Full name")
private String statementOfTruthFullNameClaimant;

@CCD(label = "Position or office held")
private String statementOfTruthPositionClaimant;

@CCD(
typeOverride = FieldType.MultiSelectList,
typeParameterOverride = "StatementOfTruthAgreementLegalRep"
)
private List<StatementOfTruthAgreementLegalRep> statementOfTruthAgreementLegalRep;

@CCD(label = "Full name")
private String statementOfTruthFullNameLegalRep;

@CCD(label = "Name of firm")
private String statementOfTruthFirmNameLegalRep;

@CCD(label = "Position or office held")
private String statementOfTruthPositionLegalRep;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package uk.gov.hmcts.reform.pcs.ccd.domain;

import uk.gov.hmcts.ccd.sdk.api.CCD;
import uk.gov.hmcts.ccd.sdk.api.HasLabel;

public enum StatementOfTruthAgreementClaimant implements HasLabel {

@CCD(label = "I believe that the facts stated in this claim form are true.")
BELIEVE_TRUE("I believe that the facts stated in this claim form are true.");

private final String label;

StatementOfTruthAgreementClaimant(String label) {
this.label = label;
}

@Override
public String getLabel() {
return label;
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package uk.gov.hmcts.reform.pcs.ccd.domain;

import uk.gov.hmcts.ccd.sdk.api.CCD;
import uk.gov.hmcts.ccd.sdk.api.HasLabel;

public enum StatementOfTruthAgreementLegalRep implements HasLabel {

@CCD(label = "The claimant believes that the facts stated in this claim form are true. "
+ "I am authorised by the claimant to sign this statement.")
AGREED("The claimant believes that the facts stated in this claim form are true. "
+ "I am authorised by the claimant to sign this statement.");

private final String label;

StatementOfTruthAgreementLegalRep(String label) {
this.label = label;
}

@Override
public String getLabel() {
return label;
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package uk.gov.hmcts.reform.pcs.ccd.domain;

import uk.gov.hmcts.ccd.sdk.api.CCD;

public enum StatementOfTruthCompletedBy {

@CCD(label = "Claimant") CLAIMANT,

@CCD(label = "Claimant's legal representative (as defined by CPR 2.3 (1))")
LEGAL_REPRESENTATIVE

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import uk.gov.hmcts.reform.pcs.ccd.model.Defendant;
import uk.gov.hmcts.reform.pcs.ccd.model.PartyDocumentDto;
import uk.gov.hmcts.reform.pcs.ccd.model.PossessionGrounds;
import uk.gov.hmcts.reform.pcs.ccd.model.StatementOfTruth;
import uk.gov.hmcts.reform.pcs.postcodecourt.model.LegislativeCountry;

import java.util.HashSet;
Expand Down Expand Up @@ -94,6 +95,10 @@ public class PcsCaseEntity {
@JdbcTypeCode(SqlTypes.JSON)
private List<PartyDocumentDto> partyDocuments;

@Column(name = "statement_of_truth")
@JdbcTypeCode(SqlTypes.JSON)
private StatementOfTruth statementOfTruth;

public void addClaim(ClaimEntity claim) {
claims.add(claim);
claim.setPcsCase(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public void configureDecentralised(DecentralisedConfigBuilder<PCSCase, State, Us
.add(new CompletingYourClaim())
.add(new StatementOfTruth());


}

private PCSCase start(EventPayload<PCSCase, State> eventPayload) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package uk.gov.hmcts.reform.pcs.ccd.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class StatementOfTruth {

private String completedBy;

private List<String> agreementClaimant;

private String fullNameClaimant;

private String positionClaimant;

private List<String> agreementLegalRep;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


private String fullNameLegalRep;

private String firmNameLegalRep;

private String positionLegalRep;

}

Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,42 @@

import uk.gov.hmcts.reform.pcs.ccd.common.CcdPageConfiguration;
import uk.gov.hmcts.reform.pcs.ccd.common.PageBuilder;
import uk.gov.hmcts.reform.pcs.ccd.domain.PCSCase;

public class StatementOfTruth implements CcdPageConfiguration {

@Override
public void addTo(PageBuilder pageBuilder) {
pageBuilder
.page("statementOfTruth")
pageBuilder.page("statementOfTruth")
.pageLabel("Statement of truth")
.showCondition("completionNextStep=\"SUBMIT_AND_PAY_NOW\"")

// ---------- Horizontal separator ----------
.label("statementOfTruth-separator", "---")
.label(
"statementOfTruth-content",
.label("statementOfTruth-hr", "---")
.label("statementOfTruth-body",
"""
<h2 class="govuk-heading-l">Statement of truth</h2>
<p class="govuk-body govuk-!-font-size-19">
This is a placeholder page for the statement of truth functionality.
<p class="govuk-body">
I understand that proceedings for contempt of court may be brought against
anyone who makes, or causes to be made, a false statement in a document
verified by a statement of truth without an honest belief in its truth.
</p>
"""
);
)
.mandatory(PCSCase::getStatementOfTruthCompletedBy)
.mandatory(PCSCase::getStatementOfTruthAgreementClaimant,
"statementOfTruthCompletedBy=\"CLAIMANT\"")
.mandatory(PCSCase::getStatementOfTruthFullNameClaimant,
"statementOfTruthCompletedBy=\"CLAIMANT\"")
.mandatory(PCSCase::getStatementOfTruthPositionClaimant,
"statementOfTruthCompletedBy=\"CLAIMANT\"")
.mandatory(PCSCase::getStatementOfTruthAgreementLegalRep,
"statementOfTruthCompletedBy=\"LEGAL_REPRESENTATIVE\"")
.mandatory(PCSCase::getStatementOfTruthFullNameLegalRep,
"statementOfTruthCompletedBy=\"LEGAL_REPRESENTATIVE\"")
.mandatory(PCSCase::getStatementOfTruthFirmNameLegalRep,
"statementOfTruthCompletedBy=\"LEGAL_REPRESENTATIVE\"")
.mandatory(PCSCase::getStatementOfTruthPositionLegalRep,
"statementOfTruthCompletedBy=\"LEGAL_REPRESENTATIVE\"");

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class PcsCaseMergeService {
private final ModelMapper modelMapper;
private final TenancyLicenceService tenancyLicenceService;
private final DefendantMapper defendantMapper;
private final StatementOfTruthService statementOfTruthService;

public void mergeCaseData(PcsCaseEntity pcsCaseEntity, PCSCase pcsCase) {

Expand Down Expand Up @@ -59,6 +60,7 @@ public void mergeCaseData(PcsCaseEntity pcsCaseEntity, PCSCase pcsCase) {
pcsCaseEntity.setTenancyLicence(tenancyLicenceService.buildTenancyLicence(pcsCase));
pcsCaseEntity.setPossessionGrounds(buildPossessionGrounds(pcsCase));
pcsCaseEntity.setDefendants(defendantMapper.mapFromDefendantDetails(pcsCase.getDefendants()));
pcsCaseEntity.setStatementOfTruth(statementOfTruthService.buildStatementOfTruth(pcsCase));
}

private void setPcqIdForCurrentUser(UUID pcqId, PcsCaseEntity pcsCaseEntity) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package uk.gov.hmcts.reform.pcs.ccd.service;

import org.springframework.stereotype.Service;
import uk.gov.hmcts.ccd.sdk.api.HasLabel;
import uk.gov.hmcts.reform.pcs.ccd.domain.PCSCase;
import uk.gov.hmcts.reform.pcs.ccd.domain.StatementOfTruthCompletedBy;
import uk.gov.hmcts.reform.pcs.ccd.model.StatementOfTruth;

import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

@Service
public class StatementOfTruthService {

public StatementOfTruth buildStatementOfTruth(PCSCase pcsCase) {
if (pcsCase.getStatementOfTruthCompletedBy() == null) {
return null;
}

StatementOfTruth.StatementOfTruthBuilder builder = StatementOfTruth.builder()
.completedBy(pcsCase.getStatementOfTruthCompletedBy() != null
? pcsCase.getStatementOfTruthCompletedBy().name() : null);

if (pcsCase.getStatementOfTruthCompletedBy() == StatementOfTruthCompletedBy.CLAIMANT) {
builder.agreementClaimant(mapToLabels(pcsCase.getStatementOfTruthAgreementClaimant()))
.fullNameClaimant(pcsCase.getStatementOfTruthFullNameClaimant())
.positionClaimant(pcsCase.getStatementOfTruthPositionClaimant());
} else if (pcsCase.getStatementOfTruthCompletedBy() == StatementOfTruthCompletedBy.LEGAL_REPRESENTATIVE) {
builder.agreementLegalRep(mapToLabels(pcsCase.getStatementOfTruthAgreementLegalRep()))
.fullNameLegalRep(pcsCase.getStatementOfTruthFullNameLegalRep())
.firmNameLegalRep(pcsCase.getStatementOfTruthFirmNameLegalRep())
.positionLegalRep(pcsCase.getStatementOfTruthPositionLegalRep());
}

return builder.build();
}

private <T extends HasLabel> List<String> mapToLabels(List<T> items) {
return Optional.ofNullable(items)
.orElse(Collections.emptyList())
.stream()
.map(HasLabel::getLabel)
.collect(Collectors.toList());
}

}



Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE pcs_case ADD COLUMN statement_of_truth JSONB;

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class PcsCaseMergeServiceTest {
private TenancyLicenceService tenancyLicenceService;
@Mock
private DefendantMapper defendantMapper;
@Mock
private StatementOfTruthService statementOfTruthService;

private PcsCaseMergeService underTest;

Expand All @@ -55,7 +57,7 @@ void setUp() {
MapperConfig config = new MapperConfig();
modelMapper = spy(config.modelMapper());
underTest = new PcsCaseMergeService(securityContextService, modelMapper, tenancyLicenceService,
defendantMapper);
defendantMapper, statementOfTruthService);
}

@Test
Expand Down
Loading