From 69b1bc966664682a4783d3199e148177ca22c39d Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 <114995593+kalachandrasekar1@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:22:41 +0000 Subject: [PATCH] CIV-11161 - Docmosis: Manual Determination -"Claimant's Response" (#3656) * CIV-11571 Fix court location if no specific court (#3569) * CIV-11571: Add null checking * CIV-11571: Add unit test --------- Co-authored-by: jarekPierchala <118526007+jarekPierchala@users.noreply.github.com> * CIV-8241 Manual Determination - Lip Notifications (#3529) * added changes for claimant response cui event. * CIV-8291 : Functional code - Need to refactor * CIV-8291 : Refactor duplicated methods to a common service * CIV-8291 : Handler Test * CIV-8291 : Fix checkStyle * CIV-8291 : Fix checkStyle * CIV-8291 : Adding mocks * CIV-8291 : Adding mocks * CIV-8291 : Adding mocks * CIV-8291 : Change final state to PROCEEDS_IN_HERITAGE_SYSTEM * CIV-8291 : Dev comments * CIV-8291 : Dev comments * CIV-8291 : Dev comments * CIV-8291 : Dev comments * CIV-8241: Set Up Notification * CIV-8241: Set Up Notification * CIV-8241: Set Up Notification * CIV-8241: Set Up Notification * CIV-8241: Set Up Notification * CIV-8241: Set Up Notification Test * CIV-8241: Set Up Notification Test * CIV-8241: Roll back one line * CIV-8241: Change method name * Update build.gradle * Update build.gradle --------- Co-authored-by: neeta-hmcts Co-authored-by: sankhajuria Co-authored-by: hmcts-version1-pablo <107927784+hmcts-version1-pablo@users.noreply.github.com> Co-authored-by: Pablo Ortiz Co-authored-by: Raja Mani Co-authored-by: jarekPierchala <118526007+jarekPierchala@users.noreply.github.com> * CIV-10727 Assisted order uplift (#3550) * CIV-11158 Save hearing location in case data * Added setting assisted order courtLocation to hearingLocation or caseManagementLocation is hearingLocation is not defined * Fixed not filtering courtLocations by caseTypeId --------- Co-authored-by: sankaviv1 Co-authored-by: sankaviv1 <95748224+sankaviv1@users.noreply.github.com> Co-authored-by: GarethLancaster <31533575+Gareth40342@users.noreply.github.com> Co-authored-by: douglasrice * CIV-11695 - Update ClaimantResponseCuiCallbackHandler.java (#3616) * Update ClaimantResponseCuiCallbackHandler.java * fix for judicial referral * fixed claim state issue and unit tests. --------- Co-authored-by: neeta-hmcts <115545612+neeta-hmcts@users.noreply.github.com> Co-authored-by: neeta-hmcts Co-authored-by: Pablo Ortiz Co-authored-by: annika-moorthy <85934693+annika-moorthy@users.noreply.github.com> * CIV-8905 Claimant Dashboard Status "Mediation E2E, Manual Determination (org), ITP failed" (#3564) * CIV-8905 Added functionality for dashboard status * CIV-8905 Added functionality for dashboard status * CIV-8905 Fixed AC 4 * CIV-11363 add trigger event (#3633) * CIV-11363 add trigger event * CIV-8905 Merged with bulk_tasks --------- Co-authored-by: Pablo Ortiz Co-authored-by: MMNycz <94067802+MMNycz@users.noreply.github.com> * CIV-8454 Trigger service request after CCD case creation (#3597) * CIV-8454 Trigger service request after CCD case creation * CIV-8454 Move Service Request creation to Camunda * CIV-8454 Undo flow state change - not required * CIV-8454 Remove empty lines * CIV-8454 Add test for service request handler CUI * CIV-8454 Only create service request when no help with fees * CIV-8454 Change event name * CIV-11144 updated witness summary to add date (#3623) * updated witness summary to add date * Update Jenkinsfile_CNP point at CCD * Update Jenkinsfile_CNP * CIV-11363 add caseId to caseIdForRetrigger.txt (#3646) * CIV-11363 add caseId to caseIdForRetrigger.txt * adding not suitable for sdo too * update caseIdForRetriger --------- Co-authored-by: Astha Malviya * testing master build (#3650) Co-authored-by: sankhajuria --------- Co-authored-by: Raja Mani Co-authored-by: drummondjm <93932689+drummondjm@users.noreply.github.com> Co-authored-by: MMNycz <94067802+MMNycz@users.noreply.github.com> Co-authored-by: Astha Malviya Co-authored-by: asthamalviya <104994907+asthamalviya@users.noreply.github.com> Co-authored-by: sankhajuria Co-authored-by: jarekPierchala <118526007+jarekPierchala@users.noreply.github.com> * CIV-11161 docmosis form generate * CIV-11161 build issue fixed * CIV-11161 checkstyle issue fix * CIV-11161 test code updated * CIV-11161 test case updated * CIV-11161 - testcase updated * CIV-11161 review comments fixed * CIV-11161 common jar version updated * CIV-11161 common jar version updated * CIV-11161 common jar version updated * CIV-11161 common jar version updated * CIV-11161 rebase issue fixed --------- Co-authored-by: jarekPierchala Co-authored-by: kenneth-hmcts <91327278+kenneth-hmcts@users.noreply.github.com> Co-authored-by: jarekPierchala <118526007+jarekPierchala@users.noreply.github.com> Co-authored-by: neeta-hmcts Co-authored-by: sankhajuria Co-authored-by: hmcts-version1-pablo <107927784+hmcts-version1-pablo@users.noreply.github.com> Co-authored-by: Pablo Ortiz Co-authored-by: Raja Mani Co-authored-by: Gareth Lancaster <90632240+Gareth40343@users.noreply.github.com> Co-authored-by: sankaviv1 Co-authored-by: sankaviv1 <95748224+sankaviv1@users.noreply.github.com> Co-authored-by: GarethLancaster <31533575+Gareth40342@users.noreply.github.com> Co-authored-by: douglasrice Co-authored-by: jeswanth-hmcts <134285996+jeswanth-hmcts@users.noreply.github.com> Co-authored-by: neeta-hmcts <115545612+neeta-hmcts@users.noreply.github.com> Co-authored-by: annika-moorthy <85934693+annika-moorthy@users.noreply.github.com> Co-authored-by: marianadpereira Co-authored-by: Manish Garg Co-authored-by: MMNycz <94067802+MMNycz@users.noreply.github.com> Co-authored-by: Paul Pearson <46532983+paul-pearson@users.noreply.github.com> Co-authored-by: drummondjm <93932689+drummondjm@users.noreply.github.com> Co-authored-by: Astha Malviya Co-authored-by: asthamalviya <104994907+asthamalviya@users.noreply.github.com> Co-authored-by: Harry H <33700332+HarryH96@users.noreply.github.com> Co-authored-by: marianadpereira <71711509+marianadpereira@users.noreply.github.com> --- build.gradle | 2 +- .../CV-SPC-CLM-ENG-00001-LIP-MD.docx | Bin 0 -> 24390 bytes .../reform/civil/callback/CaseEvent.java | 4 +- ...LipManualDeterminationCallBackHandler.java | 67 ++++++++++ .../ClaimantLipManualDeterminationForm.java | 49 ++++++++ .../service/docmosis/DocmosisTemplates.java | 3 +- ...ntLipManualDeterminationFormGenerator.java | 77 ++++++++++++ .../docmosis/utils/ClaimantResponseUtils.java | 52 ++++++++ ...anualDeterminationCallBackHandlerTest.java | 110 ++++++++++++++++ .../civil/sampledata/CaseDataBuilder.java | 39 +++++- ...pManualDeterminationFormGeneratorTest.java | 119 ++++++++++++++++++ .../utils/ClaimantResponseUtilsTest.java | 59 +++++++++ 12 files changed, 576 insertions(+), 5 deletions(-) create mode 100644 docker/docmosis/templates/CV-SPC-CLM-ENG-00001-LIP-MD.docx create mode 100644 src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandler.java create mode 100644 src/main/java/uk/gov/hmcts/reform/civil/model/docmosis/manualdetermination/ClaimantLipManualDeterminationForm.java create mode 100644 src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGenerator.java create mode 100644 src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtils.java create mode 100644 src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandlerTest.java create mode 100644 src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGeneratorTest.java create mode 100644 src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtilsTest.java diff --git a/build.gradle b/build.gradle index e07c4be0cf4..840e13198ac 100644 --- a/build.gradle +++ b/build.gradle @@ -361,7 +361,7 @@ configurations.all { } dependencies { - implementation 'com.github.hmcts:civil-commons:1.0.42' + implementation 'com.github.hmcts:civil-commons:V1.0.41-9040-1412' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop' diff --git a/docker/docmosis/templates/CV-SPC-CLM-ENG-00001-LIP-MD.docx b/docker/docmosis/templates/CV-SPC-CLM-ENG-00001-LIP-MD.docx new file mode 100644 index 0000000000000000000000000000000000000000..b762584ccbb0d8f73985249eb81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/CaseEvent.java index 17a4a6a7b91..fd5da3adc98 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/callback/CaseEvent.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/callback/CaseEvent.java @@ -316,9 +316,9 @@ public enum CaseEvent { SEND_HEARING_TO_LIP_CLAIMANT(CAMUNDA), SEND_FINAL_ORDER_TO_LIP_DEFENDANT(CAMUNDA), SEND_FINAL_ORDER_TO_LIP_CLAIMANT(CAMUNDA), + RETRIGGER_CASES(CAMUNDA), + GENERATE_LIP_CLAIMANT_MANUAL_DETERMINATION(CAMUNDA); - - RETRIGGER_CASES(CAMUNDA); private final UserType userType; public boolean isCamundaEvent() { diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandler.java new file mode 100644 index 00000000000..f26dcc1d1f3 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandler.java @@ -0,0 +1,67 @@ +package uk.gov.hmcts.reform.civil.handler.callback.camunda.docmosis; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import uk.gov.hmcts.reform.ccd.client.model.AboutToStartOrSubmitCallbackResponse; +import uk.gov.hmcts.reform.ccd.client.model.CallbackResponse; +import uk.gov.hmcts.reform.civil.callback.CaseEvent; +import uk.gov.hmcts.reform.civil.callback.CallbackHandler; +import uk.gov.hmcts.reform.civil.callback.CallbackParams; +import uk.gov.hmcts.reform.civil.callback.Callback; +import uk.gov.hmcts.reform.civil.callback.CallbackType; +import uk.gov.hmcts.reform.civil.documentmanagement.model.CaseDocument; +import uk.gov.hmcts.reform.civil.model.CaseData; +import uk.gov.hmcts.reform.civil.service.SystemGeneratedDocumentService; +import uk.gov.hmcts.reform.civil.service.docmosis.manualdetermination.ClaimantLipManualDeterminationFormGenerator; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static uk.gov.hmcts.reform.civil.callback.CallbackParams.Params.BEARER_TOKEN; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.GENERATE_LIP_CLAIMANT_MANUAL_DETERMINATION; + +@Service +@RequiredArgsConstructor +public class GenerateClaimantLipManualDeterminationCallBackHandler extends CallbackHandler { + + private static final List EVENTS = Collections.singletonList(GENERATE_LIP_CLAIMANT_MANUAL_DETERMINATION); + private static final String TASK_ID = "Generate_LIP_Claimant_MD"; + private final ObjectMapper objectMapper; + private final ClaimantLipManualDeterminationFormGenerator claimantLipManualDeterminationFormGenerator; + private final SystemGeneratedDocumentService systemGeneratedDocumentService; + private final Map callbackMap = Map.of(callbackKey(CallbackType.ABOUT_TO_SUBMIT), + this::prepareClaimantLipManualDetermination); + + @Override + public String camundaActivityId(CallbackParams callbackParams) { + return TASK_ID; + } + + @Override + protected Map callbacks() { + return callbackMap; + } + + @Override + public List handledEvents() { + return EVENTS; + } + + private CallbackResponse prepareClaimantLipManualDetermination(CallbackParams callbackParams) { + CaseData caseData = callbackParams.getCaseData(); + + if (!caseData.getRespondent1().isCompanyOROrganisation()) { + return AboutToStartOrSubmitCallbackResponse.builder().build(); + } + + CaseData.CaseDataBuilder caseDataBuilder = caseData.toBuilder(); + CaseDocument claimantResponseForm = claimantLipManualDeterminationFormGenerator.generate(callbackParams.getCaseData(), + callbackParams.getParams().get(BEARER_TOKEN).toString()); + caseDataBuilder.systemGeneratedCaseDocuments(systemGeneratedDocumentService + .getSystemGeneratedDocumentsWithAddedDocument(claimantResponseForm, caseData)); + return AboutToStartOrSubmitCallbackResponse.builder().data(caseDataBuilder.build().toMap(objectMapper)).build(); + } + +} diff --git a/src/main/java/uk/gov/hmcts/reform/civil/model/docmosis/manualdetermination/ClaimantLipManualDeterminationForm.java b/src/main/java/uk/gov/hmcts/reform/civil/model/docmosis/manualdetermination/ClaimantLipManualDeterminationForm.java new file mode 100644 index 00000000000..9ace28e0e92 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/civil/model/docmosis/manualdetermination/ClaimantLipManualDeterminationForm.java @@ -0,0 +1,49 @@ +package uk.gov.hmcts.reform.civil.model.docmosis.manualdetermination; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import uk.gov.hmcts.reform.civil.enums.PaymentType; +import uk.gov.hmcts.reform.civil.enums.RespondentResponseTypeSpec; +import uk.gov.hmcts.reform.civil.model.common.MappableObject; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Getter +@Builder +@AllArgsConstructor +@EqualsAndHashCode +public class ClaimantLipManualDeterminationForm implements MappableObject { + + private final String referenceNumber; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") + @JsonSerialize(using = LocalDateSerializer.class) + private final LocalDate claimIssueDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd MMMM yyyy 'at' HH:mm a") + @JsonSerialize(using = LocalDateTimeSerializer.class) + private final LocalDateTime claimantResponseSubmitDate; + @JsonFormat(shape = JsonFormat.Shape.STRING) + private final BigDecimal defendantAdmittedAmount; + private final PaymentType repaymentType; + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal regularPaymentAmount; + private String repaymentFrequency; + private final String claimantRequestRepaymentBy; + private final RespondentResponseTypeSpec claimResponseType; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") + @JsonSerialize(using = LocalDateSerializer.class) + private final LocalDate firstRepaymentDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") + @JsonSerialize(using = LocalDateSerializer.class) + private final LocalDate lastRepaymentDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") + @JsonSerialize(using = LocalDateSerializer.class) + private final LocalDate paymentSetDateForDefendant; +} diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/DocmosisTemplates.java b/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/DocmosisTemplates.java index 84875806e64..0197559d98c 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/DocmosisTemplates.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/DocmosisTemplates.java @@ -61,7 +61,8 @@ public enum DocmosisTemplates { // judge final Order FREE_FORM_ORDER_PDF("CV-UNS-DEC-ENG-01099.docx", "Order_%s.pdf"), - ASSISTED_ORDER_PDF("CV-UNS-DEC-ENG-01283.docx", "Order_%s.pdf"); + ASSISTED_ORDER_PDF("CV-UNS-DEC-ENG-01283.docx", "Order_%s.pdf"), + CLAIMANT_LIP_MANUAL_DETERMINATION_PDF("CV-SPC-CLM-ENG-00001-LIP-MD.docx", "%s_request-org-repayment-amount.pdf"); private final String template; private final String documentTitle; diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGenerator.java b/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGenerator.java new file mode 100644 index 00000000000..06864bac884 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGenerator.java @@ -0,0 +1,77 @@ +package uk.gov.hmcts.reform.civil.service.docmosis.manualdetermination; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import uk.gov.hmcts.reform.civil.documentmanagement.DocumentManagementService; +import uk.gov.hmcts.reform.civil.documentmanagement.model.CaseDocument; +import uk.gov.hmcts.reform.civil.documentmanagement.model.DocumentType; +import uk.gov.hmcts.reform.civil.documentmanagement.model.PDF; +import uk.gov.hmcts.reform.civil.enums.PaymentFrequencyClaimantResponseLRspec; +import uk.gov.hmcts.reform.civil.model.CaseData; +import uk.gov.hmcts.reform.civil.model.PaymentBySetDate; +import uk.gov.hmcts.reform.civil.model.docmosis.DocmosisDocument; +import uk.gov.hmcts.reform.civil.model.docmosis.manualdetermination.ClaimantLipManualDeterminationForm; +import uk.gov.hmcts.reform.civil.service.docmosis.DocmosisTemplates; +import uk.gov.hmcts.reform.civil.service.docmosis.DocumentGeneratorService; +import uk.gov.hmcts.reform.civil.service.docmosis.TemplateDataGenerator; +import uk.gov.hmcts.reform.civil.service.docmosis.utils.ClaimantResponseUtils; + +import java.time.LocalDate; + +import static java.util.Objects.nonNull; +import static uk.gov.hmcts.reform.civil.service.docmosis.DocmosisTemplates.CLAIMANT_LIP_MANUAL_DETERMINATION_PDF; + +@Service +@Getter +@RequiredArgsConstructor +public class ClaimantLipManualDeterminationFormGenerator implements TemplateDataGenerator { + + private final DocumentManagementService documentManagementService; + private final DocumentGeneratorService documentGeneratorService; + + public CaseDocument generate(CaseData caseData, String authorisation) { + ClaimantLipManualDeterminationForm templateData = getTemplateData(caseData); + DocmosisTemplates template = getDocmosisTemplate(); + DocmosisDocument docmosisDocument = documentGeneratorService.generateDocmosisDocument(templateData, template); + PDF lipManualDeterminationPdf = new PDF(getFileName(template, caseData), docmosisDocument.getBytes(), DocumentType.LIP_MANUAL_DETERMINATION); + return documentManagementService.uploadDocument( + authorisation, + lipManualDeterminationPdf); + } + + private String getFileName(DocmosisTemplates template, CaseData caseData) { + return String.format(template.getDocumentTitle(), caseData.getLegacyCaseReference()); + } + + @Override + public ClaimantLipManualDeterminationForm getTemplateData(CaseData caseData) { + ClaimantLipManualDeterminationForm.ClaimantLipManualDeterminationFormBuilder + manualDeterminationForm = ClaimantLipManualDeterminationForm.builder() + .referenceNumber(caseData.getLegacyCaseReference()) + .claimIssueDate(caseData.getIssueDate()) + .claimantResponseSubmitDate(caseData.getApplicant1ResponseDate()) + .defendantAdmittedAmount(caseData.getRespondToAdmittedClaimOwingAmountPounds()) + .claimantRequestRepaymentBy(ClaimantResponseUtils.getClaimantRepaymentType(caseData)) + .claimResponseType(caseData.getRespondent1ClaimResponseTypeForSpec()) + .regularPaymentAmount(caseData.getApplicant1SuggestInstalmentsPaymentAmountForDefendantSpec()) + .repaymentFrequency(getRepaymentFrequency(caseData.getApplicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec())) + .repaymentType(caseData.getApplicant1RepaymentOptionForDefendantSpec()) + .firstRepaymentDate(caseData.getApplicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec()) + .lastRepaymentDate(ClaimantResponseUtils.getClaimantFinalRepaymentDate(caseData)) + .paymentSetDateForDefendant(getRepaymentSetByDate(caseData.getApplicant1RequestedPaymentDateForDefendantSpec())); + return manualDeterminationForm.build(); + } + + private DocmosisTemplates getDocmosisTemplate() { + return CLAIMANT_LIP_MANUAL_DETERMINATION_PDF; + } + + private String getRepaymentFrequency(PaymentFrequencyClaimantResponseLRspec claimantSuggestedRepaymentFrequency) { + return (nonNull(claimantSuggestedRepaymentFrequency)) ? claimantSuggestedRepaymentFrequency.getLabel() : null; + } + + private LocalDate getRepaymentSetByDate(PaymentBySetDate paymentBySetDate) { + return (nonNull(paymentBySetDate)) ? paymentBySetDate.getPaymentSetDate() : null; + } +} \ No newline at end of file diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtils.java b/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtils.java new file mode 100644 index 00000000000..2ad44e53651 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtils.java @@ -0,0 +1,52 @@ +package uk.gov.hmcts.reform.civil.service.docmosis.utils; + +import uk.gov.hmcts.reform.civil.enums.PaymentFrequencyClaimantResponseLRspec; +import uk.gov.hmcts.reform.civil.enums.PaymentType; +import uk.gov.hmcts.reform.civil.model.CaseData; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDate; + +import static java.util.Objects.isNull; + +public class ClaimantResponseUtils { + + private ClaimantResponseUtils() { + //NO-OP + } + + public static String getClaimantRepaymentType(CaseData caseData) { + PaymentType claimantRepaymentOption = caseData.getApplicant1RepaymentOptionForDefendantSpec(); + if (claimantRepaymentOption == null) { + return "No payment type selected"; + } + if (claimantRepaymentOption == PaymentType.REPAYMENT_PLAN) { + return "By installments"; + } else { + return claimantRepaymentOption.getDisplayedValue(); + } + } + + public static LocalDate getClaimantFinalRepaymentDate(CaseData caseData) { + BigDecimal paymentAmount = caseData.getApplicant1SuggestInstalmentsPaymentAmountForDefendantSpec(); + LocalDate firstRepaymentDate = caseData.getApplicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec(); + PaymentFrequencyClaimantResponseLRspec repaymentFrequency = caseData.getApplicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec(); + + BigDecimal claimantTotalAmount = caseData.getTotalClaimAmount(); + if (isNull(firstRepaymentDate) || isNull(paymentAmount) || isNull(repaymentFrequency)) { + return null; + } + long numberOfInstallmentsAfterFirst = getNumberOfInstallmentsAfterFirst(claimantTotalAmount, paymentAmount); + + return switch (repaymentFrequency) { + case ONCE_ONE_WEEK -> firstRepaymentDate.plusWeeks(numberOfInstallmentsAfterFirst); + case ONCE_TWO_WEEKS -> firstRepaymentDate.plusWeeks(2 * numberOfInstallmentsAfterFirst); + default -> firstRepaymentDate.plusMonths(numberOfInstallmentsAfterFirst); + }; + } + + private static long getNumberOfInstallmentsAfterFirst(BigDecimal totalAmount, BigDecimal paymentAmount) { + return totalAmount.divide(paymentAmount, 0, RoundingMode.CEILING).longValue() - 1; + } +} diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandlerTest.java new file mode 100644 index 00000000000..69eafc950af --- /dev/null +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/camunda/docmosis/GenerateClaimantLipManualDeterminationCallBackHandlerTest.java @@ -0,0 +1,110 @@ +package uk.gov.hmcts.reform.civil.handler.callback.camunda.docmosis; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import uk.gov.hmcts.reform.civil.callback.CallbackParams; +import uk.gov.hmcts.reform.civil.documentmanagement.model.CaseDocument; +import uk.gov.hmcts.reform.civil.documentmanagement.model.Document; +import uk.gov.hmcts.reform.civil.handler.callback.BaseCallbackHandlerTest; +import uk.gov.hmcts.reform.civil.model.CaseData; +import uk.gov.hmcts.reform.civil.model.Party; +import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder; +import uk.gov.hmcts.reform.civil.sampledata.PartyBuilder; +import uk.gov.hmcts.reform.civil.service.SystemGeneratedDocumentService; +import uk.gov.hmcts.reform.civil.service.docmosis.manualdetermination.ClaimantLipManualDeterminationFormGenerator; + +import java.time.LocalDateTime; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static uk.gov.hmcts.reform.civil.callback.CallbackType.ABOUT_TO_SUBMIT; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.GENERATE_LIP_CLAIMANT_MANUAL_DETERMINATION; +import static uk.gov.hmcts.reform.civil.documentmanagement.model.DocumentType.LIP_MANUAL_DETERMINATION; + +@ExtendWith(SpringExtension.class) +@SpringBootTest(classes = { + GenerateClaimantLipManualDeterminationCallBackHandler.class, + JacksonAutoConfiguration.class +}) +class GenerateClaimantLipManualDeterminationCallBackHandlerTest extends BaseCallbackHandlerTest { + + private static final String BEARER_TOKEN = "BEARER_TOKEN"; + private static final CaseDocument FORM = CaseDocument.builder() + .createdBy("John") + .documentName("document name") + .documentSize(0L) + .documentType(LIP_MANUAL_DETERMINATION) + .createdDatetime(LocalDateTime.now()) + .documentLink(Document.builder() + .documentUrl("fake-url") + .documentFileName("file-name") + .documentBinaryUrl("binary-url") + .build()) + .build(); + @Autowired + private final ObjectMapper mapper = new ObjectMapper(); + @Autowired + private GenerateClaimantLipManualDeterminationCallBackHandler handler; + @MockBean + private ClaimantLipManualDeterminationFormGenerator lipManualDeterminationHandlerFormGenerator; + @MockBean + private SystemGeneratedDocumentService systemGeneratedDocumentService; + + @Test + void shouldGenerateForm_whenAboutToSubmitCalled() { + given(lipManualDeterminationHandlerFormGenerator.generate(any(CaseData.class), anyString())).willReturn(FORM); + + CaseData caseData = CaseDataBuilder.builder() + .respondent1(PartyBuilder.builder() + .soleTrader().build().toBuilder() + .type(Party.Type.COMPANY) + .build()) + .build(); + + handler.handle(callbackParamsOf(caseData, ABOUT_TO_SUBMIT)); + verify(lipManualDeterminationHandlerFormGenerator).generate(caseData, BEARER_TOKEN); + } + + @Test + void shouldNotGenerateForm_whenPartyTypeIsNotCompanyORNotOrganisation() { + given(lipManualDeterminationHandlerFormGenerator.generate(any(CaseData.class), anyString())).willReturn(FORM); + + CaseData caseData = CaseDataBuilder.builder() + .respondent1(PartyBuilder.builder() + .soleTrader().build().toBuilder() + .type(Party.Type.SOLE_TRADER) + .build()) + .build(); + + CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_SUBMIT); + params.getRequest().setEventId(GENERATE_LIP_CLAIMANT_MANUAL_DETERMINATION.name()); + + handler.handle(params); + verify(lipManualDeterminationHandlerFormGenerator, never()).generate(any(CaseData.class), anyString()); + verify(systemGeneratedDocumentService, never()).getSystemGeneratedDocumentsWithAddedDocument(any(CaseDocument.class), any(CaseData.class)); + } + + @Test + void shouldReturnCorrectActivityId_whenRequestedMDForm() { + CaseData caseData = CaseDataBuilder.builder().atStatePendingClaimIssued().build(); + + CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_SUBMIT); + + assertThat(handler.camundaActivityId(params)).isEqualTo("Generate_LIP_Claimant_MD"); + } + + @Test + void testHandledEvents() { + assertThat(handler.handledEvents()).contains(GENERATE_LIP_CLAIMANT_MANUAL_DETERMINATION); + } +} diff --git a/src/test/java/uk/gov/hmcts/reform/civil/sampledata/CaseDataBuilder.java b/src/test/java/uk/gov/hmcts/reform/civil/sampledata/CaseDataBuilder.java index 136bc1c95cf..455f1f577da 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/sampledata/CaseDataBuilder.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/sampledata/CaseDataBuilder.java @@ -154,6 +154,9 @@ import uk.gov.hmcts.reform.civil.model.transferonlinecase.TocTransferCaseReason; import uk.gov.hmcts.reform.civil.referencedata.model.LocationRefData; import uk.gov.hmcts.reform.civil.service.flowstate.FlowState; +import uk.gov.hmcts.reform.civil.enums.PaymentType; +import uk.gov.hmcts.reform.civil.model.PaymentBySetDate; +import uk.gov.hmcts.reform.civil.enums.PaymentFrequencyClaimantResponseLRspec; import java.math.BigDecimal; import java.time.LocalDate; @@ -289,6 +292,11 @@ public class CaseDataBuilder { protected ResponseDocument applicant1DefenceResponseDocument; protected ResponseDocument applicant2DefenceResponseDocument; protected BusinessProcess businessProcess; + protected PaymentType applicant1RepaymentOptionForDefendantSpec; + protected PaymentBySetDate applicant1RequestedPaymentDateForDefendantSpec; + protected BigDecimal applicant1SuggestInstalmentsPaymentAmountForDefendantSpec; + protected PaymentFrequencyClaimantResponseLRspec applicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec; + protected LocalDate applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec; //Case proceeds in caseman protected ClaimProceedsInCaseman claimProceedsInCaseman; @@ -6441,6 +6449,31 @@ public CaseDataBuilder addRespondent2OrgIndividual(String firstName, String last return this; } + public CaseDataBuilder applicant1RepaymentOptionForDefendantSpec(PaymentType repaymentOption) { + this.applicant1RepaymentOptionForDefendantSpec = repaymentOption; + return this; + } + + public CaseDataBuilder applicant1RequestedPaymentDateForDefendantSpec(PaymentBySetDate repaymentBySetDate) { + this.applicant1RequestedPaymentDateForDefendantSpec = repaymentBySetDate; + return this; + } + + public CaseDataBuilder applicant1SuggestInstalmentsPaymentAmountForDefendantSpec(BigDecimal suggestedInstallmentPayment) { + this.applicant1SuggestInstalmentsPaymentAmountForDefendantSpec = suggestedInstallmentPayment; + return this; + } + + public CaseDataBuilder applicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec(PaymentFrequencyClaimantResponseLRspec repaymentFrequency) { + this.applicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec = repaymentFrequency; + return this; + } + + public CaseDataBuilder applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec(LocalDate firstRepaymentDate) { + this.applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec = firstRepaymentDate; + return this; + } + public CaseDataBuilder uploadMediationDocumentsChooseOptions(String partyChosen, List documentTypes) { List> mediationNonAttendanceStatement; List> documentsReferred; @@ -6562,7 +6595,11 @@ public CaseData build() { .applicant1DefenceResponseDocument(applicant1DefenceResponseDocument) .claimantDefenceResDocToDefendant2(applicant2DefenceResponseDocument) .defendantDetails(defendantDetails) - + .applicant1RepaymentOptionForDefendantSpec(applicant1RepaymentOptionForDefendantSpec) + .applicant1RequestedPaymentDateForDefendantSpec(applicant1RequestedPaymentDateForDefendantSpec) + .applicant1SuggestInstalmentsPaymentAmountForDefendantSpec(applicant1SuggestInstalmentsPaymentAmountForDefendantSpec) + .applicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec(applicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec) + .applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec(applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec) //Case procceds in Caseman .claimProceedsInCaseman(claimProceedsInCaseman) .claimProceedsInCasemanLR(claimProceedsInCasemanLR) diff --git a/src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGeneratorTest.java b/src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGeneratorTest.java new file mode 100644 index 00000000000..488fb7b97ab --- /dev/null +++ b/src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/manualdetermination/ClaimantLipManualDeterminationFormGeneratorTest.java @@ -0,0 +1,119 @@ +package uk.gov.hmcts.reform.civil.service.docmosis.manualdetermination; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import uk.gov.hmcts.reform.civil.documentmanagement.DocumentManagementService; +import uk.gov.hmcts.reform.civil.documentmanagement.model.CaseDocument; +import uk.gov.hmcts.reform.civil.documentmanagement.model.PDF; +import uk.gov.hmcts.reform.civil.enums.PaymentFrequencyClaimantResponseLRspec; +import uk.gov.hmcts.reform.civil.enums.PaymentType; +import uk.gov.hmcts.reform.civil.model.CaseData; +import uk.gov.hmcts.reform.civil.model.PaymentBySetDate; +import uk.gov.hmcts.reform.civil.model.common.MappableObject; +import uk.gov.hmcts.reform.civil.model.docmosis.DocmosisDocument; +import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder; +import uk.gov.hmcts.reform.civil.sampledata.CaseDocumentBuilder; +import uk.gov.hmcts.reform.civil.service.docmosis.DocumentGeneratorService; + +import java.math.BigDecimal; +import java.time.LocalDate; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static uk.gov.hmcts.reform.civil.documentmanagement.model.DocumentType.LIP_MANUAL_DETERMINATION; +import static uk.gov.hmcts.reform.civil.service.docmosis.DocmosisTemplates.CLAIMANT_LIP_MANUAL_DETERMINATION_PDF; + +@ExtendWith(SpringExtension.class) +@ContextConfiguration(classes = { + ClaimantLipManualDeterminationFormGenerator.class, + JacksonAutoConfiguration.class +}) +class ClaimantLipManualDeterminationFormGeneratorTest { + + private static final String BEARER_TOKEN = "Bearer Token"; + private static final byte[] bytes = {1, 2, 3, 4, 5, 6}; + private static final String REFERENCE_NUMBER = "000MC014"; + private static final String fileName_application = String.format( + CLAIMANT_LIP_MANUAL_DETERMINATION_PDF.getDocumentTitle(), REFERENCE_NUMBER); + private static final CaseDocument CASE_DOCUMENT = CaseDocumentBuilder.builder() + .documentName(fileName_application) + .documentType(LIP_MANUAL_DETERMINATION) + .build(); + @MockBean + private DocumentGeneratorService documentGeneratorService; + @MockBean + private DocumentManagementService documentManagementService; + @Autowired + private ClaimantLipManualDeterminationFormGenerator generator; + + @BeforeEach + void setup() { + when(documentGeneratorService.generateDocmosisDocument(any(MappableObject.class), eq(CLAIMANT_LIP_MANUAL_DETERMINATION_PDF))) + .thenReturn(new DocmosisDocument(CLAIMANT_LIP_MANUAL_DETERMINATION_PDF.getDocumentTitle(), bytes)); + when(documentManagementService + .uploadDocument(BEARER_TOKEN, new PDF(fileName_application, bytes, LIP_MANUAL_DETERMINATION))) + .thenReturn(CASE_DOCUMENT); + } + + @Test + void shouldGenerateClaimantManualDeterminationDoc_whenValidDataIsProvided() { + CaseData caseData = CaseDataBuilder.builder() + .legacyCaseReference(REFERENCE_NUMBER) + .issueDate(LocalDate.now()) + .applicant1RepaymentOptionForDefendantSpec(PaymentType.IMMEDIATELY) + .build(); + + CaseDocument caseDocument = generator.generate(caseData, BEARER_TOKEN); + + assertThat(caseDocument).isNotNull(); + + verify(documentManagementService) + .uploadDocument(BEARER_TOKEN, new PDF(fileName_application, bytes, LIP_MANUAL_DETERMINATION)); + } + + @Test + void shouldGenerateClaimantManualDeterminationDoc_whenPayBySetDate() { + CaseData caseData = CaseDataBuilder.builder() + .legacyCaseReference(REFERENCE_NUMBER) + .issueDate(LocalDate.now()) + .applicant1RepaymentOptionForDefendantSpec(PaymentType.SET_DATE) + .applicant1RequestedPaymentDateForDefendantSpec(PaymentBySetDate.builder().paymentSetDate(LocalDate.now()).build()) + .build(); + + CaseDocument caseDocument = generator.generate(caseData, BEARER_TOKEN); + + assertThat(caseDocument).isNotNull(); + + verify(documentManagementService) + .uploadDocument(BEARER_TOKEN, new PDF(fileName_application, bytes, LIP_MANUAL_DETERMINATION)); + } + + @Test + void shouldGenerateClaimantManualDeterminationDoc_whenPayByInstallment() { + CaseData caseData = CaseDataBuilder.builder() + .legacyCaseReference(REFERENCE_NUMBER) + .issueDate(LocalDate.now()) + .applicant1RepaymentOptionForDefendantSpec(PaymentType.REPAYMENT_PLAN) + .applicant1SuggestInstalmentsPaymentAmountForDefendantSpec(BigDecimal.valueOf(100)) + .totalClaimAmount(BigDecimal.valueOf(1000)) + .applicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec(PaymentFrequencyClaimantResponseLRspec.ONCE_ONE_MONTH) + .applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec(LocalDate.now()) + .build(); + + CaseDocument caseDocument = generator.generate(caseData, BEARER_TOKEN); + + assertThat(caseDocument).isNotNull(); + + verify(documentManagementService) + .uploadDocument(BEARER_TOKEN, new PDF(fileName_application, bytes, LIP_MANUAL_DETERMINATION)); + } +} diff --git a/src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtilsTest.java b/src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtilsTest.java new file mode 100644 index 00000000000..a5091c1f542 --- /dev/null +++ b/src/test/java/uk/gov/hmcts/reform/civil/service/docmosis/utils/ClaimantResponseUtilsTest.java @@ -0,0 +1,59 @@ +package uk.gov.hmcts.reform.civil.service.docmosis.utils; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.provider.CsvSource; +import uk.gov.hmcts.reform.civil.enums.PaymentFrequencyClaimantResponseLRspec; +import uk.gov.hmcts.reform.civil.enums.PaymentType; +import uk.gov.hmcts.reform.civil.model.CaseData; +import uk.gov.hmcts.reform.civil.sampledata.CaseDataBuilder; + +import java.math.BigDecimal; +import java.time.LocalDate; +import org.junit.jupiter.params.ParameterizedTest; +import static org.assertj.core.api.Assertions.assertThat; +import static uk.gov.hmcts.reform.civil.service.docmosis.utils.ClaimantResponseUtils.getClaimantFinalRepaymentDate; +import static uk.gov.hmcts.reform.civil.service.docmosis.utils.ClaimantResponseUtils.getClaimantRepaymentType; + +public class ClaimantResponseUtilsTest { + + @Test + void shouldReturnFinalPaymentDateForDefendant() { + CaseData caseData = CaseDataBuilder.builder() + .applicant1SuggestInstalmentsPaymentAmountForDefendantSpec(BigDecimal.valueOf(100)) + .issueDate(LocalDate.now()) + .applicant1RepaymentOptionForDefendantSpec(PaymentType.REPAYMENT_PLAN) + .applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec(LocalDate.now()) + .applicant1SuggestInstalmentsRepaymentFrequencyForDefendantSpec(PaymentFrequencyClaimantResponseLRspec.ONCE_TWO_WEEKS) + .totalClaimAmount(BigDecimal.valueOf(1000)) + .build(); + + LocalDate finalDate = getClaimantFinalRepaymentDate(caseData); + assertThat(finalDate).isNotNull(); + } + + @ParameterizedTest + @CsvSource({"IMMEDIATELY,Immediately", "SET_DATE,By a set date", "REPAYMENT_PLAN,By installments"}) + void shouldReturnClaimantRepaymentOption(PaymentType input, String expectedOutput) { + CaseData caseData = CaseData.builder() + .applicant1RepaymentOptionForDefendantSpec(input) + .build(); + + String actualOutput = getClaimantRepaymentType(caseData); + Assertions.assertEquals(expectedOutput, actualOutput); + } + + @Test + void shouldNotReturnFinalPaymentDateForDefendant_WhenInstallmentIsNull() { + CaseData caseData = CaseDataBuilder.builder() + .applicant1SuggestInstalmentsPaymentAmountForDefendantSpec(null) + .issueDate(LocalDate.now()) + .applicant1RepaymentOptionForDefendantSpec(PaymentType.SET_DATE) + .applicant1SuggestInstalmentsFirstRepaymentDateForDefendantSpec(LocalDate.now()) + .totalClaimAmount(BigDecimal.valueOf(1000)) + .build(); + + LocalDate finalDate = getClaimantFinalRepaymentDate(caseData); + assertThat(finalDate).isNull(); + } +}