Skip to content

Commit

Permalink
CIV-16547 changes (#6107)
Browse files Browse the repository at this point in the history
Co-authored-by: krishnanuthalapati <32389208+krishnanuthalapati@users.noreply.github.com>
Co-authored-by: Azam <106387766+Azam-Hmcts@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 18, 2025
1 parent 85d1305 commit 8730d82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import uk.gov.hmcts.reform.civil.documentmanagement.model.DocumentType;
import uk.gov.hmcts.reform.civil.documentmanagement.model.PDF;
import uk.gov.hmcts.reform.civil.model.CaseData;
import uk.gov.hmcts.reform.civil.model.common.Element;
import uk.gov.hmcts.reform.civil.model.docmosis.DocmosisDocument;
import uk.gov.hmcts.reform.civil.model.docmosis.judgmentonline.SetAsideJudgmentInErrorLiPDefendantLetter;
import uk.gov.hmcts.reform.civil.model.judgmentonline.JudgmentDetails;
import uk.gov.hmcts.reform.civil.service.BulkPrintService;
import uk.gov.hmcts.reform.civil.service.docmosis.DocumentGeneratorService;
import uk.gov.hmcts.reform.civil.service.documentmanagement.DocumentDownloadService;
Expand Down Expand Up @@ -78,7 +80,16 @@ public SetAsideJudgmentInErrorLiPDefendantLetter getTemplateData(CaseData caseDa
.claimantName(caseData.getApplicant1().getPartyName())
.defendant(caseData.getRespondent1())
.letterIssueDate(LocalDate.now())
.issueDate(caseData.getJoIssuedDate())
.issueDate(getJudgmentIssueDate(caseData))
.build();
}

private LocalDate getJudgmentIssueDate(CaseData caseData) {
if (!caseData.getHistoricJudgment().isEmpty()) {
List<Element<JudgmentDetails>> judgmentList = caseData.getHistoricJudgment();
JudgmentDetails judgmentDetails = judgmentList.get(judgmentList.size() - 1).getValue();
return judgmentDetails.getIssueDate();
}
return LocalDate.now();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import uk.gov.hmcts.reform.civil.model.Party;
import uk.gov.hmcts.reform.civil.model.common.MappableObject;
import uk.gov.hmcts.reform.civil.model.docmosis.DocmosisDocument;
import uk.gov.hmcts.reform.civil.model.judgmentonline.JudgmentDetails;
import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder;
import uk.gov.hmcts.reform.civil.sampledata.CaseDocumentBuilder;
import uk.gov.hmcts.reform.civil.sampledata.PartyBuilder;
Expand All @@ -32,6 +33,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static uk.gov.hmcts.reform.civil.service.docmosis.DocmosisTemplates.SET_ASIDE_JUDGMENT_IN_ERROR_LIP_DEFENDANT_LETTER;
import static uk.gov.hmcts.reform.civil.utils.ElementUtils.wrapElements;

@ExtendWith(MockitoExtension.class)
class SetAsideJudgmentInErrorLiPLetterGeneratorTest {
Expand Down Expand Up @@ -66,7 +68,7 @@ void shouldDownloadDocumentAndPrintLetterSuccessfully() {
.applicant1(applicant)
.respondent1(defendant)
.buildJudmentOnlineCaseDataWithPaymentByInstalment();

caseData.setHistoricJudgment(wrapElements(JudgmentDetails.builder().issueDate(LocalDate.now()).build()));
caseData.setJoIssuedDate(LocalDate.now());
caseData.setJoSetAsideJudgmentErrorText("Some text");

Expand Down

0 comments on commit 8730d82

Please sign in to comment.