Skip to content

Commit

Permalink
Merge branch 'master' into feat/CIV-14300
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmendrak authored Jul 25, 2024
2 parents 048db96 + 8cce6b3 commit 21224b2
Show file tree
Hide file tree
Showing 107 changed files with 2,179 additions and 1,730 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ plugins {
id 'org.springframework.boot' version '2.7.18'
id 'org.owasp.dependencycheck' version '9.2.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.sonarqube' version '5.0.0.4638'
id 'org.sonarqube' version '5.1.0.4882'
id 'au.com.dius.pact' version '4.2.14'
id "io.freefair.lombok" version "8.6"
id 'com.github.hmcts.rse-cft-lib' version '0.19.1328'
id "org.flywaydb.flyway" version "10.15.2"
id 'com.github.hmcts.rse-cft-lib' version '0.19.1330'
id "org.flywaydb.flyway" version "10.16.0"
}

group = 'uk.gov.hmcts.reform'
Expand All @@ -27,7 +27,7 @@ def versions = [
springSecurity : '5.8.13',
camunda : '7.20.0',
jackson : '2.17.2',
testcontainers : '1.19.8'
testcontainers : '1.20.0'
]

allprojects {
Expand Down Expand Up @@ -121,7 +121,7 @@ allprojects {
// Solves CVE-2022-31159, happens only on local builds when running dependencyCheck gradle task
dependencySet(
group: 'com.amazonaws',
version: '1.12.763'
version: '1.12.764'
) {
entry 'aws-java-sdk-core'
entry 'aws-java-sdk-kms'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.claimant.TrialArrangementsClaimantNotificationHandler;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder;
import uk.gov.hmcts.reform.dashboard.data.TaskStatus;

import java.time.LocalDate;

Expand Down Expand Up @@ -43,7 +44,7 @@ void shouldCreateAddTrialArrangementsForClaimant() throws Exception {
.claimsTrack(ClaimsTrack.fastTrack)
.orderType(OrderType.DECIDE_DAMAGES)
.ccdCaseReference(Long.valueOf(caseId))
.hearingDate(LocalDate.of(2024, 03, 25))
.hearingDate(LocalDate.of(2024, 04, 1))
.build();

handler.handle(callbackParams(caseData));
Expand All @@ -62,6 +63,20 @@ void shouldCreateAddTrialArrangementsForClaimant() throws Exception {
jsonPath("$[0].descriptionCy").value(
"<p class=\"govuk-body\">Rhaid i chi <a href=\"{ADD_TRIAL_ARRANGEMENTS}\" class=\"govuk-link\">gadarnhau eich trefniadau treial</a> erbyn 4 Mawrth 2024. Mae hyn yn golygu y bydd angen i chi gadarnhau a yw'r achos yn barod ar gyfer treial ai peidio. Bydd angen i chi hefyd gadarnhau a yw'r amgylchiadau wedi newid ers i chi gwblhau'r holiadur cyfarwyddiadau. Cyfeiriwch at yr <a href=\"{VIEW_CLAIMANT_HEARING_REQS}\" rel=\"noopener noreferrer\" class=\"govuk-link\" target=\"_blank\">holiadur a gyflwynwyd gennych</a> os nad ydych yn siŵr beth ddywedoch chi o'r blaen.</p>")
);

doGet(BEARER_TOKEN, GET_TASKS_ITEMS_URL, caseId, "CLAIMANT")
.andExpectAll(
status().is(HttpStatus.OK.value()),
jsonPath("$[0].reference").value(caseId.toString()),
jsonPath("$[0].taskNameEn").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Add the trial arrangements</a>"),
jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()),
jsonPath("$[0].taskNameCy").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Ychwanegu trefniadau'r treial</a>"),
jsonPath("$[0].currentStatusCy").value(TaskStatus.ACTION_NEEDED.getWelshName()),
jsonPath("$[0].hintTextEn").value("Deadline is 12am on 4 March 2024"),
jsonPath("$[0].hintTextCy").value("Deadline is 12am on 4 Mawrth 2024")
);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.defendant.TrialArrangementsDefendantNotificationHandler;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder;
import uk.gov.hmcts.reform.dashboard.data.TaskStatus;

import java.time.LocalDate;

Expand All @@ -35,7 +36,7 @@ void shouldCreateAddTrialArrangementsForDefendant() throws Exception {
.drawDirectionsOrderSmallClaims(NO)
.claimsTrack(ClaimsTrack.fastTrack)
.orderType(OrderType.DECIDE_DAMAGES)
.hearingDate(LocalDate.of(2024, 03, 25))
.hearingDate(LocalDate.of(2024, 04, 1))
.build();

handler.handle(callbackParams(caseData));
Expand All @@ -54,5 +55,19 @@ void shouldCreateAddTrialArrangementsForDefendant() throws Exception {
jsonPath("$[0].descriptionCy").value(
"<p class=\"govuk-body\">Rhaid i chi <a href=\"{ADD_TRIAL_ARRANGEMENTS}\" class=\"govuk-link\">gadarnhau eich trefniadau treial</a> erbyn 4 Mawrth 2024. Mae hyn yn golygu y bydd angen i chi gadarnhau a yw'r achos yn barod ar gyfer treial ai peidio. Bydd angen i chi hefyd gadarnhau a yw'r amgylchiadau wedi newid ers i chi gwblhau'r holiadur cyfarwyddiadau. Cyfeiriwch at yr <a href=\"{VIEW_DEFENDANT_HEARING_REQS}\" rel=\"noopener noreferrer\" class=\"govuk-link\" target=\"_blank\">holiadur a gyflwynwyd gennych</a> os nad ydych yn siŵr beth ddywedoch chi o'r blaen.</p>")
);

doGet(BEARER_TOKEN, GET_TASKS_ITEMS_URL, caseId, "DEFENDANT")
.andExpectAll(
status().is(HttpStatus.OK.value()),
jsonPath("$[0].reference").value(caseId.toString()),
jsonPath("$[0].taskNameEn").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Add the trial arrangements</a>"),
jsonPath("$[0].currentStatusEn").value(TaskStatus.ACTION_NEEDED.getName()),
jsonPath("$[0].taskNameCy").value(
"<a href={ADD_TRIAL_ARRANGEMENTS} class=\"govuk-link\">Ychwanegu trefniadau'r treial</a>"),
jsonPath("$[0].currentStatusCy").value(TaskStatus.ACTION_NEEDED.getWelshName()),
jsonPath("$[0].hintTextEn").value("Deadline is 12am on 4 March 2024"),
jsonPath("$[0].hintTextCy").value("Deadline is 12am on 4 Mawrth 2024")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import uk.gov.hmcts.reform.civil.enums.CaseRole;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.DashboardScenarios.SCENARIO_AAA6_CLAIMANT_INTENT_SETTLEMENT_AGREEMENT_CLAIMANT_REJECTS_COURT_AGREES_WITH_CLAIMANT_DEFENDANT;
import static uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.DashboardScenarios.SCENARIO_AAA6_CLAIMANT_REJECTED_NOT_PAID_DEFENDANT;
import static uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.DashboardScenarios.SCENARIO_AAA6_CLAIMANT_INTENT_REQUEST_CCJ_CLAIMANT_REJECTS_DEF_PLAN_CLAIMANT_DISAGREES_COURT_PLAN_DEFENDANT;
import static uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.DashboardScenarios.SCENARIO_AAA6_CLAIMANT_INTENT_REQUESTED_CCJ_CLAIMANT_ACCEPTED_DEFENDANT_PLAN_DEFENDANT;
import static uk.gov.hmcts.reform.civil.handler.callback.camunda.dashboardnotifications.DashboardScenarios.SCENARIO_AAA6_CLAIMANT_INTENT_REJECT_REPAYMENT_ORG_LTD_CO_DEFENDANT;

@Service
Expand Down Expand Up @@ -90,6 +91,8 @@ public String getScenario(CaseData caseData) {
}
} else if (isClaimantRejectRepaymentPlan(caseData)) {
return SCENARIO_AAA6_CLAIMANT_INTENT_REJECT_REPAYMENT_ORG_LTD_CO_DEFENDANT.getScenario();
} else if (isLrvLipPartFullAdmitAndPayByPlan(caseData)) {
return SCENARIO_AAA6_CLAIMANT_INTENT_REQUESTED_CCJ_CLAIMANT_ACCEPTED_DEFENDANT_PLAN_DEFENDANT.getScenario();
}
return null;
}
Expand Down Expand Up @@ -185,4 +188,11 @@ private boolean isClaimantRejectRepaymentPlan(CaseData caseData) {
private boolean isCarmApplicableForMediation(CaseData caseData) {
return getFeatureToggleService().isCarmEnabledForCase(caseData);
}

private boolean isLrvLipPartFullAdmitAndPayByPlan(CaseData caseData) {
return !featureToggleService.isJudgmentOnlineLive()
&& !caseData.isApplicantLiP()
&& caseData.hasApplicantAcceptedRepaymentPlan()
&& caseData.isCcjRequestJudgmentByAdmission();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public class GenerateClaimFormCallbackHandler extends CallbackHandler {
@Value("${stitching.enabled}")
private boolean stitchEnabled;

public void setStitchEnabled(boolean stitchEnabled) {
this.stitchEnabled = stitchEnabled;
}

@Override
public String camundaActivityId(CallbackParams callbackParams) {
return TASK_ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static uk.gov.hmcts.reform.civil.callback.CallbackType.ABOUT_TO_SUBMIT;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_DISCONTINUANCE_DEFENDANT1;
import static uk.gov.hmcts.reform.civil.utils.NotificationUtils.getRespondentLegalOrganizationName;
import static uk.gov.hmcts.reform.civil.utils.PartyUtils.getAllPartyNames;

@Service
@RequiredArgsConstructor
Expand Down Expand Up @@ -62,6 +63,13 @@ private CallbackResponse notifyDefendantClaimDiscontinued(CallbackParams callbac
addProperties(caseData),
getReferenceTemplate(caseData)
);
} else {
notificationService.sendMail(
caseData.getRespondent1().getPartyEmail(),
getLIPTemplate(),
addPropertiesLip(caseData),
getReferenceTemplate(caseData)
);
}

return AboutToStartOrSubmitCallbackResponse.builder().build();
Expand All @@ -71,6 +79,10 @@ private String getLRTemplate() {
return notificationsProperties.getNotifyClaimDiscontinuedLRTemplate();
}

private String getLIPTemplate() {
return notificationsProperties.getNotifyLipUpdateTemplate();
}

private String getReferenceTemplate(CaseData caseData) {
return String.format(REFERENCE_TEMPLATE, caseData.getLegacyCaseReference());
}
Expand All @@ -84,4 +96,12 @@ public Map<String, String> addProperties(CaseData caseData) {
getRespondentLegalOrganizationName(caseData.getRespondent1OrganisationPolicy(), organisationService)
);
}

public Map<String, String> addPropertiesLip(CaseData caseData) {
return Map.of(
CLAIMANT_V_DEFENDANT, getAllPartyNames(caseData),
CLAIM_REFERENCE_NUMBER, caseData.getLegacyCaseReference(),
PARTY_NAME, caseData.getRespondent1().getPartyName()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import uk.gov.hmcts.reform.civil.enums.YesOrNo;

@Builder(toBuilder = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ContactDetailsUpdatedEvent {

private final String description;
private final String summary;
private final YesOrNo submittedByCaseworker;
private String description;
private String summary;
private YesOrNo submittedByCaseworker;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import uk.gov.hmcts.reform.civil.model.caseflags.Flags;

@Data
@lombok.NoArgsConstructor
@lombok.AllArgsConstructor
@Builder(toBuilder = true)
public class PartyFlagStructure {

private final String partyID;
private final String firstName;
private final String lastName;
private final String email;
private final String phone;
private final Flags flags;
private String partyID;
private String firstName;
private String lastName;
private String email;
private String phone;
private Flags flags;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import static java.util.Optional.ofNullable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ServedDocumentFiles {

private List<Element<DocumentWithRegex>> other;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,8 @@ public boolean isNocForDefendant() {
&& (caseData.getBusinessProcess() != null
&& CaseEvent.APPLY_NOC_DECISION_DEFENDANT_LIP.name().equals(caseData.getBusinessProcess().getCamundaEvent()));
}

public boolean isDefaultJudgementIssued() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import uk.gov.hmcts.reform.civil.enums.RespondentResponseTypeSpec;
import uk.gov.hmcts.reform.civil.enums.YesOrNo;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.model.judgmentonline.JudgmentState;
import uk.gov.hmcts.reform.civil.model.sdo.FastTrackHearingTime;
import uk.gov.hmcts.reform.civil.model.sdo.SmallClaimsHearing;
import uk.gov.hmcts.reform.civil.service.FeatureToggleService;
Expand All @@ -17,6 +18,7 @@

import static java.util.Objects.nonNull;
import static uk.gov.hmcts.reform.civil.enums.YesOrNo.YES;
import static uk.gov.hmcts.reform.civil.model.judgmentonline.JudgmentType.DEFAULT_JUDGMENT;

@Slf4j
public class CcdDashboardDefendantClaimMatcher extends CcdDashboardClaimMatcher implements Claim {
Expand Down Expand Up @@ -89,7 +91,7 @@ public boolean defendantRespondedWithFullAdmitAndPayByInstallments() {
public boolean isEligibleForCCJ() {
return caseData.getRespondent1ResponseDeadline() != null
&& caseData.getRespondent1ResponseDeadline().isBefore(LocalDate.now().atTime(FOUR_PM))
&& caseData.getPaymentTypeSelection() == null;
&& caseData.getPaymentTypeSelection() == null && null == caseData.getActiveJudgment();
}

@Override
Expand Down Expand Up @@ -412,7 +414,10 @@ public boolean defendantRespondedWithPreferredLanguageWelsh() {
}

public boolean isWaitingForClaimantIntentDocUpload() {
return false;
return caseData.isRespondentResponseFullDefence()
&& caseData.getApplicant1ResponseDate() != null
&& caseData.getCcdState() == CaseState.AWAITING_APPLICANT_INTENTION
&& caseData.isClaimantBilingual();
}

@Override
Expand All @@ -429,4 +434,12 @@ public boolean isClaimSubmittedWaitingTranslatedDocuments() {
public boolean isNocForDefendant() {
return false;
}

@Override
public boolean isDefaultJudgementIssued() {
return nonNull(caseData.getActiveJudgment())
&& DEFAULT_JUDGMENT.equals(caseData.getActiveJudgment().getType())
&& JudgmentState.ISSUED.equals(caseData.getActiveJudgment().getState());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public interface Claim {
boolean isClaimSubmittedWaitingTranslatedDocuments();

boolean isNocForDefendant();

boolean isCaseStruckOut();

boolean isDefaultJudgementIssued();
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class DashboardClaimInfo {
@JsonFormat(shape = JsonFormat.Shape.STRING)
@JsonSerialize(using = LocalDateTimeSerializer.class)
private LocalDateTime createdDate;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DATE_FORMAT)
@JsonSerialize(using = LocalDateSerializer.class)
private LocalDate defaultJudgementIssuedDate;
private DashboardClaimStatus status;
private BigDecimal respondToAdmittedClaimOwingAmountPounds;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public enum DashboardClaimStatus {
RESPONSE_BY_POST(
Claim::isPaperResponse
),
DEFAULT_JUDGEMENT_ISSUED(Claim::isDefaultJudgementIssued),
NO_STATUS(c -> false);

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import uk.gov.hmcts.reform.civil.enums.YesOrNo;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DisclosureOfNonElectronicDocuments {

private YesOrNo directionsForDisclosureProposed;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/uk/gov/hmcts/reform/civil/model/dq/Experts.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import java.util.List;

@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@Builder(toBuilder = true)
public class Experts {

private YesOrNo expertRequired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class FileDirectionsQuestionnaire {

private List<String> explainedToClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import uk.gov.hmcts.reform.civil.enums.YesOrNo;

@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@Builder(toBuilder = true)
public class FurtherInformation {

private YesOrNo futureApplications;
Expand Down
Loading

0 comments on commit 21224b2

Please sign in to comment.