From d17824f6442dbb56ae87e64b24c83fe8da938c33 Mon Sep 17 00:00:00 2001 From: drummondjm <93932689+drummondjm@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:07:36 +0000 Subject: [PATCH] CIV-11342 categories for DocumentCosts (#3537) * updated categories for DocumentCosts * checkstyle * removed unused categories * reapply 11342 changes --------- Co-authored-by: vasudevganesanhmcts <100689363+vasudevganesanhmcts@users.noreply.github.com> --- .../user/EvidenceUploadHandlerBase.java | 21 +++++++++---------- .../EvidenceUploadApplicantHandlerTest.java | 2 +- .../EvidenceUploadRespondentHandlerTest.java | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadHandlerBase.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadHandlerBase.java index e69ffd03ba7..5277c8351c6 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadHandlerBase.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadHandlerBase.java @@ -118,23 +118,22 @@ abstract class EvidenceUploadHandlerBase extends CallbackHandler { protected static final String RESPONDENT_ONE_PRE_TRIAL_SUMMARY = "RespondentOnePreTrialSummary"; protected static final String RESPONDENT_ONE_TRIAL_SKELETON = "RespondentOneTrialSkeleton"; protected static final String RESPONDENT_ONE_PRECEDENT_H = "RespondentOneUploadedPrecedentH"; - protected static final String RESPONDENT_ONE_ANY_PRECEDENT_H = "respondentOneAnyPrecedentH"; protected static final String RESPONDENT_TWO_DISCLOSURE_LIST = "RespondentTwoDisclosureList"; protected static final String RESPONDENT_TWO_PRE_TRIAL_SUMMARY = "RespondentTwoPreTrialSummary"; protected static final String RESPONDENT_TWO_TRIAL_SKELETON = "RespondentTwoTrialSkeleton"; protected static final String RESPONDENT_TWO_PRECEDENT_H = "RespondentTwoUploadedPrecedentH"; - protected static final String RESPONDENT_TWO_ANY_PRECEDENT_H = "respondentTwoAnyPrecedentH"; + protected static final String RESPONDENT_ONE_SCHEDULE_OF_COSTS = "RespondentSchedulesOfCost"; + protected static final String RESPONDENT_TWO_SCHEDULE_OF_COSTS = "RespondentTwoSchedulesOfCost"; protected static final String APPLICANT_DISCLOSURE_LIST = "ApplicantDisclosureList"; protected static final String APPLICANT_PRE_TRIAL_SUMMARY = "ApplicantPreTrialSummary"; protected static final String APPLICANT_TRIAL_SKELETON = "ApplicantTrialSkeleton"; protected static final String APPLICANT_PRECEDENT_H = "ApplicantUploadedPrecedentH"; - protected static final String APPLICANT_ANY_PRECEDENT_H = "ApplicantAnyPrecedentH"; protected static final String APPLICANT_TWO_DISCLOSURE_LIST = "ApplicantTwoDisclosureList"; protected static final String APPLICANT_TWO_PRE_TRIAL_SUMMARY = "ApplicantTwoPreTrialSummary"; protected static final String APPLICANT_TWO_TRIAL_SKELETON = "ApplicantTwoTrialSkeleton"; protected static final String APPLICANT_TWO_PRECEDENT_H = "ApplicantTwoUploadedPrecedentH"; - protected static final String APPLICANT_TWO_ANY_PRECEDENT_H = "ApplicantTwoAnyPrecedentH"; - + protected static final String APPLICANT_SCHEDULE_OF_COSTS = "ApplicantSchedulesOfCost"; + protected static final String APPLICANT_TWO_SCHEDULE_OF_COSTS = "ApplicantTwoSchedulesOfCost"; // Notification Strings used for email protected static StringBuilder notificationString = new StringBuilder(); protected static final String DISCLOSURE_LIST_TEXT = "%s - Disclosure list"; @@ -635,7 +634,7 @@ CallbackResponse documentUploadTime(CallbackParams callbackParams) { TRIAL_SKELETON_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); setCategoryIdAndRenameDoc(caseData.getDocumentAuthoritiesRes(), document -> document.getValue().getDocumentUpload(), RESPONDENT_ONE_PRECEDENT_H, TRIAL_AUTHORITIES_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); - setCategoryIdAndRenameDoc(caseData.getDocumentCostsRes(), document -> document.getValue().getDocumentUpload(), RESPONDENT_ONE_ANY_PRECEDENT_H, + setCategoryIdAndRenameDoc(caseData.getDocumentCostsRes(), document -> document.getValue().getDocumentUpload(), RESPONDENT_ONE_SCHEDULE_OF_COSTS, TRIAL_COSTS_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); setCategoryIdAndRenameDoc(caseData.getDocumentEvidenceForTrialRes(), document -> document.getValue().getDocumentUpload(), RESPONDENT_ONE_TRIAL_DOC_CORRESPONDENCE, TRIAL_DOC_CORRESPONDENCE_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); @@ -671,7 +670,7 @@ CallbackResponse documentUploadTime(CallbackParams callbackParams) { TRIAL_SKELETON_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); setCategoryIdAndRenameDoc(caseData.getDocumentAuthoritiesRes2(), document -> document.getValue().getDocumentUpload(), RESPONDENT_TWO_PRECEDENT_H, TRIAL_AUTHORITIES_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); - setCategoryIdAndRenameDoc(caseData.getDocumentCostsRes2(), document -> document.getValue().getDocumentUpload(), RESPONDENT_TWO_ANY_PRECEDENT_H, + setCategoryIdAndRenameDoc(caseData.getDocumentCostsRes2(), document -> document.getValue().getDocumentUpload(), RESPONDENT_TWO_SCHEDULE_OF_COSTS, TRIAL_COSTS_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); setCategoryIdAndRenameDoc(caseData.getDocumentEvidenceForTrialRes2(), document -> document.getValue().getDocumentUpload(), RESPONDENT_TWO_TRIAL_DOC_CORRESPONDENCE, TRIAL_DOC_CORRESPONDENCE_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), defendantString); @@ -708,7 +707,7 @@ CallbackResponse documentUploadTime(CallbackParams callbackParams) { TRIAL_SKELETON_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); setCategoryIdAndRenameDoc(caseData.getDocumentAuthorities(), document -> document.getValue().getDocumentUpload(), APPLICANT_PRECEDENT_H, TRIAL_AUTHORITIES_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); - setCategoryIdAndRenameDoc(caseData.getDocumentCosts(), document -> document.getValue().getDocumentUpload(), APPLICANT_ANY_PRECEDENT_H, + setCategoryIdAndRenameDoc(caseData.getDocumentCosts(), document -> document.getValue().getDocumentUpload(), APPLICANT_SCHEDULE_OF_COSTS, TRIAL_COSTS_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); setCategoryIdAndRenameDoc(caseData.getDocumentEvidenceForTrial(), document -> document.getValue().getDocumentUpload(), APPLICANT_TRIAL_DOC_CORRESPONDENCE, TRIAL_DOC_CORRESPONDENCE_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); @@ -745,7 +744,7 @@ CallbackResponse documentUploadTime(CallbackParams callbackParams) { TRIAL_SKELETON_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); setCategoryIdAndRenameDoc(caseData.getDocumentAuthoritiesApp2(), document -> document.getValue().getDocumentUpload(), APPLICANT_TWO_PRECEDENT_H, TRIAL_AUTHORITIES_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); - setCategoryIdAndRenameDoc(caseData.getDocumentCostsApp2(), document -> document.getValue().getDocumentUpload(), APPLICANT_TWO_ANY_PRECEDENT_H, + setCategoryIdAndRenameDoc(caseData.getDocumentCostsApp2(), document -> document.getValue().getDocumentUpload(), APPLICANT_TWO_SCHEDULE_OF_COSTS, TRIAL_COSTS_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); setCategoryIdAndRenameDoc(caseData.getDocumentEvidenceForTrialApp2(), document -> document.getValue().getDocumentUpload(), APPLICANT_TWO_TRIAL_DOC_CORRESPONDENCE, TRIAL_DOC_CORRESPONDENCE_TEXT, documentDateTime -> documentDateTime.getValue().getCreatedDatetime(), claimantString); @@ -872,7 +871,7 @@ private CaseData copyResp1ChangesToResp2(CaseData caseData, CaseData.CaseDataBui evidenceDocToCopy = compareAndCopy(caseDataBefore.getDocumentCostsRes(), caseData.getDocumentCostsRes(), caseData.getDocumentCostsRes2()); - evidenceDocToAdd = deepCopyUploadEvidenceDocumentType(evidenceDocToCopy, RESPONDENT_TWO_ANY_PRECEDENT_H); + evidenceDocToAdd = deepCopyUploadEvidenceDocumentType(evidenceDocToCopy, RESPONDENT_TWO_SCHEDULE_OF_COSTS); builder.documentCostsRes2(evidenceDocToAdd); evidenceDocToCopy = compareAndCopy(caseDataBefore.getDocumentEvidenceForTrialRes(), @@ -984,7 +983,7 @@ private CaseData copyApp1ChangesToApp2(CaseData caseData, CaseData.CaseDataBuild evidenceDocToCopy = compareAndCopy(caseDataBefore.getDocumentCosts(), caseData.getDocumentCosts(), caseData.getDocumentCostsApp2()); - evidenceDocToAdd = deepCopyUploadEvidenceDocumentType(evidenceDocToCopy, APPLICANT_TWO_ANY_PRECEDENT_H); + evidenceDocToAdd = deepCopyUploadEvidenceDocumentType(evidenceDocToCopy, APPLICANT_TWO_SCHEDULE_OF_COSTS); builder.documentCostsApp2(evidenceDocToAdd); evidenceDocToCopy = compareAndCopy(caseDataBefore.getDocumentEvidenceForTrial(), diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadApplicantHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadApplicantHandlerTest.java index cda6fc74fc7..3704297d425 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadApplicantHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadApplicantHandlerTest.java @@ -843,7 +843,7 @@ void should_do_naming_convention(String selected) { assertThat(updatedData.getDocumentCostsApp2().get(0).getValue() .getDocumentUpload().getDocumentFileName()).isEqualTo(TEST_FILE_NAME); assertThat(updatedData.getDocumentCostsApp2().get(0).getValue() - .getDocumentUpload().getCategoryID()).isEqualTo(EvidenceUploadHandlerBase.APPLICANT_TWO_ANY_PRECEDENT_H); + .getDocumentUpload().getCategoryID()).isEqualTo(EvidenceUploadHandlerBase.APPLICANT_TWO_SCHEDULE_OF_COSTS); assertThat(updatedData.getNotificationText()).isEqualTo(NotificationWhenBothClaimant); } } diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadRespondentHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadRespondentHandlerTest.java index 455cd043a2e..d5c32eeac09 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadRespondentHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/EvidenceUploadRespondentHandlerTest.java @@ -1451,7 +1451,7 @@ void should_do_naming_convention_resp1(String selected) { assertThat(updatedData.getDocumentCostsRes2().get(0).getValue() .getDocumentUpload().getDocumentFileName()).isEqualTo(TEST_FILE_NAME); assertThat(updatedData.getDocumentCostsRes2().get(0).getValue() - .getDocumentUpload().getCategoryID()).isEqualTo(EvidenceUploadHandlerBase.RESPONDENT_TWO_ANY_PRECEDENT_H); + .getDocumentUpload().getCategoryID()).isEqualTo(EvidenceUploadHandlerBase.RESPONDENT_TWO_SCHEDULE_OF_COSTS); assertThat(updatedData.getNotificationText()).contains(NotificationWhenBothDefendant); } }