From 1bbf8e995e55677a67d6b6df8bba7b5b1ac2aec6 Mon Sep 17 00:00:00 2001 From: Iswarya Pepakayala Date: Thu, 9 Jan 2025 10:29:35 +0000 Subject: [PATCH] DTSPB-4293 Added Ad Colligenda Bona case type changes (#2882) * DTSPB-4293 Added Ad Colligenda Bona case type changes * DTSPB-4293 Added validation for Ad Colligenda case type selection * DTSPB-4293 Fix checkstyle * DTSPB-4293 Fix error message * Revert "DTSPB-4293 Fix error message" This reverts commit 3df1c68e6f05a7c1f83b7b1819f2608dd310b0d2. * DTSPB-4293 Added logs * DTSPB-4293 changed path * DTSPB-4293 Fix FT * DTSPB-4293 Fix FT * DTSPB-4293 Fix Sonar issue * DTSPB-4293 Fix FT * DTSPB-4293 Fix FT * DTSPB-4293 Fix FT * DTSPB-4293 Removed logs * DTSPB-4293 Addressing review comments * DTSPB-4293 Revert local commit * DTSPB-4293 Fix Checkstyle and test * DTSPB-4293 Fix FT * DTSPB-4293 Merge error * DTSPB-4293 Merge error * DTSPB-4293 Merge error * DTSPB-4293 Merge error * DTSPB-4293 Remove draft documents when generating Grant documents * DTSPB-4293 Check style * DTSPB-4293 Commons version * DTSPB-4293 chnaged the label * DTSPB-4293 Fixed Functional test --- build.gradle | 2 +- .../CCD_Probate_Backoffice/FixedLists.json | 9 + src/contractTest/resources/application.yml | 38 +- .../documents/GrantGenerationTests.java | 59 +++ .../documents/WelshGrantGenerationTests.java | 6 + .../adColligenda/personal/adColligenda.json | 136 +++++++ .../personal/adColligendaReissue.json | 336 ++++++++++++++++++ .../adColligenda/solicitor/adColligenda.json | 162 +++++++++ .../solicitor/adColligendaReissue.json | 306 ++++++++++++++++ ...expectedDocumentGrantAdColligendaWelsh.txt | 1 + .../expectedDocumentReissueAdmonWillWelsh.txt | 2 +- ...personalPayloadGrantAdColligendaWelsh.json | 134 +++++++ ...rPayloadNotificationsAdColligendaBona.json | 122 +++++++ .../controller/DocumentControllerIT.java | 47 +++ .../docmosis/DocumentTemplateServiceIT.java | 64 +++- src/integrationTest/resources/application.yml | 8 + .../BusinessValidationController.java | 3 + .../hmcts/probate/model/DocumentCaseType.java | 4 +- .../gov/hmcts/probate/model/DocumentType.java | 26 +- .../probate/service/BulkPrintService.java | 33 +- .../service/DocumentGeneratorService.java | 12 +- .../SmeeAndFordPersonalisationService.java | 5 +- .../template/pdf/PDFDecoratorService.java | 4 + .../template/pdf/PDFManagementService.java | 5 + .../decorator/RemovePenceDecorator.java | 5 +- .../probate/service/zip/ZipFileService.java | 11 +- .../CallbackResponseTransformer.java | 24 +- .../transformer/DocumentTransformer.java | 134 ++++--- .../transformer/ReprintTransformer.java | 59 ++- ...dColligendaBonaCaseTypeValidationRule.java | 29 ++ .../resources/ValidationMessages.properties | 3 +- src/main/resources/application.yml | 56 ++- .../templates/pdf/adColligendaBonaGrant.html | 329 +++++++++++++++++ .../pdf/adColligendaBonaGrantDraft.html | 334 +++++++++++++++++ .../BusinessValidationUnitTest.java | 5 + .../probate/service/BulkPrintServiceTest.java | 15 + .../service/ReprintTransformerTest.java | 8 + .../template/pdf/PDFDecoratorServiceTest.java | 5 +- .../pdf/PDFManagementServiceTest.java | 6 + .../decorator/RemovePenceDecoratorTest.java | 5 +- .../CallbackResponseTransformerTest.java | 85 +++++ .../transformer/DocumentTransformerTest.java | 84 ++++- ...ligendaBonaCaseTypeValidationRuleTest.java | 62 ++++ ...rPayloadNotificationsAdColligendaBona.json | 122 +++++++ 44 files changed, 2748 insertions(+), 157 deletions(-) create mode 100644 src/functionalTest/resources/json/default/adColligenda/personal/adColligenda.json create mode 100644 src/functionalTest/resources/json/default/adColligenda/personal/adColligendaReissue.json create mode 100644 src/functionalTest/resources/json/default/adColligenda/solicitor/adColligenda.json create mode 100644 src/functionalTest/resources/json/default/adColligenda/solicitor/adColligendaReissue.json create mode 100644 src/functionalTest/resources/json/expectedDocumentGrantAdColligendaWelsh.txt create mode 100644 src/functionalTest/resources/json/personalPayloadGrantAdColligendaWelsh.json create mode 100644 src/functionalTest/resources/json/solicitorPayloadNotificationsAdColligendaBona.json create mode 100644 src/main/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRule.java create mode 100644 src/main/resources/templates/pdf/adColligendaBonaGrant.html create mode 100644 src/main/resources/templates/pdf/adColligendaBonaGrantDraft.html create mode 100644 src/test/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRuleTest.java create mode 100644 src/test/resources/solicitorPayloadNotificationsAdColligendaBona.json diff --git a/build.gradle b/build.gradle index 5ebf56bee0..58691897a2 100644 --- a/build.gradle +++ b/build.gradle @@ -170,7 +170,7 @@ def versions = [ lombok : '1.18.36', mapStruct : '1.2.0.Final', pact_version : '4.1.34', - probateCommonsVersion : '2.0.31', + probateCommonsVersion : '2.0.33', probatePactCommonsVersion : '1.0.2', restAssured : '5.5.0', serenity : '4.2.9', diff --git a/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json b/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json index ada8b3365b..f8de823bfe 100644 --- a/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json +++ b/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json @@ -112,6 +112,8 @@ {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "intestacyGrantDraft", "ListElement": "Intestacy Grant Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "admonWillGrant", "ListElement": "Admon Will Grant"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "admonWillGrantDraft", "ListElement": "Admon Will Grant Draft"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "adColligendaBonaGrant", "ListElement": "Ad Colligenda Bona Grant"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "adColligendaBonaGrantDraft", "ListElement": "Ad Colligenda Bona Grant Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "caveatStopped", "ListElement": "caveat Stopped"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "grantCoversheet", "ListElement": "Cover Sheet"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "grantCover", "ListElement": "Grant Cover Sheet"}, @@ -119,21 +121,27 @@ {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "digitalGrantReissueDraft", "ListElement": "Digital Grant Reissue Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "intestacyGrantReissueDraft", "ListElement": "Intestacy Grant Reissue Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "admonWillGrantReissueDraft", "ListElement": "Admon Will Grant Reissue Draft"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "adColligendaBonaGrantReissueDraft", "ListElement": "Ad Colligenda Bona Grant Reissue Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "digitalGrantReissue", "ListElement": "Digital Grant Reissue"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "intestacyGrantReissue", "ListElement": "Intestacy Grant Reissue"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "admonWillGrantReissue", "ListElement": "Admon Will Grant Reissue"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "adColligendaBonaGrantReissue", "ListElement": "Ad Colligenda Bona Grant Reissue"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshDigitalGrant", "ListElement": "Welsh Digital Grant"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshDigitalGrantDraft", "ListElement": "Welsh Digital Grant Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshIntestacyGrant", "ListElement": "Welsh Intestacy Grant"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshIntestacyGrantDraft", "ListElement": "Welsh Intestacy Grant Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdmonWillGrant", "ListElement": "Welsh Admon Will Grant"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdmonWillGrantDraft", "ListElement": "Welsh Admon Will Grant Draft"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdColligendaBonaGrant", "ListElement": "Welsh Ad Colligenda Bona Grant"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdColligendaBonaGrantDraft", "ListElement": "Welsh Ad Colligenda Bona Grant Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshDigitalGrantReissueDraft", "ListElement": "Welsh Digital Grant Reissue Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshIntestacyGrantReissueDraft", "ListElement": "Welsh Intestacy Grant Reissue Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdmonWillGrantReissueDraft", "ListElement": "Welsh Admon Will Grant Reissue Draft"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdColligendaBonaGrantReissueDraft", "ListElement": "Welsh Ad Colligenda Bona Grant Reissue Draft"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshDigitalGrantReissue", "ListElement": "Welsh Digital Grant Reissue"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshIntestacyGrantReissue", "ListElement": "Welsh Intestacy Grant Reissue"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdmonWillGrantReissue", "ListElement": "Welsh Admon Will Grant Reissue"}, + {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshAdColligendaBonaGrantReissue", "ListElement": "Welsh Ad Colligenda Bona Grant Reissue"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "sotInformationRequest", "ListElement": "Legal Statement Information Request"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "statementOfTruth", "ListElement": "Legal Statement"}, {"LiveFrom": "01/01/2017", "ID": "probateDocumentTypeEnum", "ListElementCode": "welshStatementOfTruth", "ListElement": "Legal Statement"}, @@ -204,6 +212,7 @@ {"LiveFrom": "06/01/2017", "ID": "caseTypeFixedList", "ListElementCode": "intestacy", "ListElement": "Intestacy"}, {"LiveFrom": "06/01/2017", "ID": "caseTypeFixedList", "ListElementCode": "admonWill", "ListElement": "Admon Will"}, {"LiveFrom": "06/01/2017", "ID": "caseTypeFixedList", "ListElementCode": "edgeCase", "ListElement": "Edge Case"}, + {"LiveFrom": "06/01/2017", "ID": "caseTypeFixedList", "ListElementCode": "adColligendaBona", "ListElement": "Ad Colligenda Bona"}, {"LiveFrom": "06/01/2017", "ID": "paperPaymentMethodFixedList", "ListElementCode": "debitOrCredit", "ListElement": "Debit or Credit card"}, {"LiveFrom": "06/01/2017", "ID": "paperPaymentMethodFixedList", "ListElementCode": "cheque", "ListElement": "Cheque or Postal order"}, {"LiveFrom": "06/01/2017", "ID": "paperPaymentMethodFixedList", "ListElementCode": "cash", "ListElement": "Cash"}, diff --git a/src/contractTest/resources/application.yml b/src/contractTest/resources/application.yml index 28a9f0f840..f8d40e6601 100644 --- a/src/contractTest/resources/application.yml +++ b/src/contractTest/resources/application.yml @@ -66,17 +66,21 @@ docmosis: grantCoversheet: templateName: FL-PRB-GNO-ENG-00024.docx digitalGrantReissueDraft: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc intestacyGrantReissueDraft: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc admonWillGrantReissueDraft: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc + adColligendaBonaGrantReissueDraft: + templateName: FL-PRB-GRP-ENG-01295.doc digitalGrantReissue: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc intestacyGrantReissue: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc admonWillGrantReissue: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc + adColligendaBonaGrantReissue: + templateName: FL-PRB-GRP-ENG-01295.doc sotInformationRequest: templateName: FL-PRB-GNO-ENG-00085.doc sentEmail: @@ -88,17 +92,21 @@ docmosis: assembledLetter: templateName: FL-PRB-GNO-ENG-00133.docx welshDigitalGrant: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshIntestacyGrant: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshAdmonWillGrant: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc + welshAdColligendaBonaGrant: + templateName: FL-PRB-GRP-WEL-00236.doc welshDigitalGrantDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshIntestacyGrantDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshAdmonWillGrantDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc + welshAdColligendaBonaGrantDraft: + templateName: FL-PRB-GRP-WEL-00236.doc fee.api: url: http://localhost:4411 @@ -314,30 +322,36 @@ documents: intestacy: INTESTACY_GRANT_REISSUE admonWill: ADMON_WILL_GRANT_REISSUE gop: DIGITAL_GRANT_REISSUE + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_REISSUE grant: intestacy: INTESTACY_GRANT admonWill: ADMON_WILL_GRANT gop: DIGITAL_GRANT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT preview: reissue: intestacy: INTESTACY_GRANT_REISSUE_DRAFT admonWill: ADMON_WILL_GRANT_REISSUE_DRAFT gop: DIGITAL_GRANT_REISSUE_DRAFT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT grant: intestacy: INTESTACY_GRANT_DRAFT admonWill: ADMON_WILL_GRANT_DRAFT gop: DIGITAL_GRANT_DRAFT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_DRAFT welsh: final: grant: intestacy: WELSH_INTESTACY_GRANT admonWill: WELSH_ADMON_WILL_GRANT gop: WELSH_DIGITAL_GRANT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT preview: grant: intestacy: WELSH_INTESTACY_GRANT_DRAFT admonWill: WELSH_ADMON_WILL_GRANT_DRAFT gop: WELSH_DIGITAL_GRANT_DRAFT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT registry: registries: diff --git a/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/GrantGenerationTests.java b/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/GrantGenerationTests.java index a9d13daa52..70daba91f4 100644 --- a/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/GrantGenerationTests.java +++ b/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/GrantGenerationTests.java @@ -85,6 +85,8 @@ public class GrantGenerationTests extends DocumentGenerationTestBase { public static final String ADMON_WILL_REISSUE_JSON = "admonWillReissue.json"; public static final String INTESTACY_JSON = "intestacy.json"; public static final String INTESTACY_REISSUE_JSON = "intestacyReissue.json"; + public static final String AD_COLLIGENDA_JSON = "adColligenda.json"; + public static final String AD_COLLIGENDA_REISSUE_JSON = "adColligendaReissue.json"; public static final String NOVEMBER_2020 = "18th November 2020"; public static final String PROBATE_PRACTITIONER_123_LONDON_LONDON = "Probate Practitioner 123 London London"; public static final String MORE_PARTNERS_HOLDING_POWER_RESERVED_NO = "\"morePartnersHoldingPowerReserved\": \"No\""; @@ -138,10 +140,15 @@ public class GrantGenerationTests extends DocumentGenerationTestBase { "solicitorPayloadTrustCorpsNotNamedPowerReserved.json"; private static final String PARTNERS_FIRM_POWER_RESERVED_PAYLOAD = "solicitorPayloadTrustCorpsPartnersInFirmPowerReserved.json"; + private static final String AD_COLLIGENDA_PAYLOAD = + "solicitorPayloadNotificationsAdColligendaBona.json"; private static final String FRAGMENT_WITH_NO_MULTIPLE_ANDS = "ExecutorsSmithof MyTc 19 Curtis Street Charlton Kings Swindon Glos Sn2 2JU United Kingdom of and " + "Fred FlintstoneApplying 7 Ashley Avenue Burnham-on-Sea Somerset SN15JU United Kingdom" + "The application has stated that the gross value"; + private static final String AD_COLLIGENDA_GRANT_TEXT = "This is an Ad Colligenda Bona grant and is limited for the " + + "purposes only of collecting getting in and receiving the estate and doing such acts as may be necessary " + + "for the preservation of the same in particular, to deal with issues and if necessary to sell"; @Test void verifySolicitorGenerateGrantShouldReturnOkResponseCode() throws IOException { @@ -163,6 +170,15 @@ void verifySolicitorGenerateIntestacyGrantDraftShouldReturnOkResponseCode() thro validatePostSuccess("solicitorPayloadNotificationsIntestacy.json", GENERATE_GRANT_DRAFT); } + @Test + void verifySolicitorGenerateAdColligendaBonaGrantShouldReturnOkResponseCode() throws IOException { + validatePostSuccess(AD_COLLIGENDA_PAYLOAD, GENERATE_GRANT); + } + + @Test + void verifySolicitorGenerateAdColligendaBonaGrantDraftShouldReturnOkResponseCode() throws IOException { + validatePostSuccess(AD_COLLIGENDA_PAYLOAD, GENERATE_GRANT_DRAFT); + } @Test void verifySolicitorGenerateAdmonWillGrantShouldReturnOkResponseCode() throws IOException { @@ -438,6 +454,49 @@ void verifyGenerateAllEnglishIntestacySolicitorGrantTypesWhenDeceasedDomiciledNo assertTrue(response.contains(expectedText)); } + @Test + void verifyGenerateAllEnglishAdColligendaPersonalGrantTypeDraft() throws IOException { + String adColligendaPayload = "/default/adColligenda/personal/"; + String response = generateGrantDocument(adColligendaPayload + AD_COLLIGENDA_JSON, + GENERATE_GRANT_DRAFT); + assertTrue("Draft grant document does not contain expected text.", + response.contains(AD_COLLIGENDA_GRANT_TEXT)); + } + + @Test + void verifyGenerateAllEnglishAdColligendaPersonalGrantType() throws IOException { + String adColligendaPayload = "/default/adColligenda/personal/"; + String response = generateGrantDocument(adColligendaPayload + AD_COLLIGENDA_JSON, GENERATE_GRANT); + assertTrue("Grant document does not contain expected text.", + response.contains(AD_COLLIGENDA_GRANT_TEXT)); + } + + @Test + void verifyGenerateAllEnglishAdColligendaPersonalGrantTypeReissue() throws IOException { + String adColligendaPayload = "/default/adColligenda/personal/"; + String response = generateGrantDocument(adColligendaPayload + AD_COLLIGENDA_REISSUE_JSON, + GENERATE_GRANT_REISSUE); + assertTrue("Reissue grant document does not contain expected text.", + response.contains(AD_COLLIGENDA_GRANT_TEXT)); + } + + @Test + void verifyGenerateAllEnglishAdColligendaSolicitorGrantTypes() + throws IOException { + String adColligendaPayload = "/default/adColligenda/solicitor/"; + + String response = generateGrantDocument(adColligendaPayload + AD_COLLIGENDA_JSON, + GENERATE_GRANT_DRAFT); + assertTrue(response.contains(AD_COLLIGENDA_GRANT_TEXT)); + + response = generateGrantDocument(adColligendaPayload + AD_COLLIGENDA_JSON, GENERATE_GRANT); + assertTrue(response.contains(AD_COLLIGENDA_GRANT_TEXT)); + + response = generateGrantDocument(adColligendaPayload + AD_COLLIGENDA_REISSUE_JSON, + GENERATE_GRANT_REISSUE); + assertTrue(response.contains(AD_COLLIGENDA_GRANT_TEXT)); + } + @Test void verifyTrustCorpsShouldReturnOkResponseCode() throws IOException { validatePostSuccess(TRUST_CORPS_GOP_PAYLOAD, GENERATE_GRANT); diff --git a/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/WelshGrantGenerationTests.java b/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/WelshGrantGenerationTests.java index 828fa14ecf..3c18e450f4 100644 --- a/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/WelshGrantGenerationTests.java +++ b/src/functionalTest/java/uk/gov/hmcts/probate/functional/documents/WelshGrantGenerationTests.java @@ -52,6 +52,12 @@ void verifyPersonalGenerateWelshGrantIntestacy() throws IOException { "expectedDocumentGrantIntestacyWelsh.txt"); } + @Test + void verifyPersonalGenerateWelshGrantAdColligenda() throws IOException { + verifyPersonalWelshGrantText("personalPayloadGrantAdColligendaWelsh.json", + "expectedDocumentGrantAdColligendaWelsh.txt"); + } + private void verifyPersonalWelshGrantText(String payload, String expectedFile) throws IOException { final String response = getFirstProbateDocumentsText(payload, GENERATE_GRANT); diff --git a/src/functionalTest/resources/json/default/adColligenda/personal/adColligenda.json b/src/functionalTest/resources/json/default/adColligenda/personal/adColligenda.json new file mode 100644 index 0000000000..a837f6db7e --- /dev/null +++ b/src/functionalTest/resources/json/default/adColligenda/personal/adColligenda.json @@ -0,0 +1,136 @@ +{ + "case_details": { + "id": 1528365719153338, + "jurisdiction": "PROBATE", + "state": "CaseCreated", + "case_type_id": "GrantOfRepresentation", + "created_date": [ + 2018, + 6, + 7, + 10, + 1, + 59, + 151000000 + ], + "last_modified": [ + 2018, + 6, + 7, + 10, + 8, + 8, + 695000000 + ], + "case_data": { + "caseType": "adColligendaBona", + "payments": [ + { + "id": "ba372bd2-cee9-4402-b209-0e8f95e71522", + "value": { + "amount": "21500", + "method": "online", + "siteId": "P223", + "status": "Success", + "reference": "RC-1634-9026-5882-3025", + "transactionId": "d22d7e8h5qlbt1njm816vctl77" + } + } + ], + "taskList": "", + "ihtFormId": "IHT207", + "paperForm": "No", + "willExists": "No", + "bulkPrintId": [], + "caseMatches": [], + "declaration": {}, + "ihtNetValue": "800000", + "ihtGrossValue": "1000000", + "legalStatement": { + "executorsApplying": [], + "executorsNotApplying": [] + }, + "applicationType": "Personal", + "dateOfDeathType": "diedOn", + "deceasedAddress": { + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Dusted Design Partners Ltd", + "AddressLine2": "65-68 Leadenhall Street" + }, + "deceasedSurname": "Eased", + "registryAddress": "Line 1 Ox\nLine 2 Ox\nLine 3 Ox\nPostCode Ox\n", + "paragraphDetails": [], + "registryLocation": "ctsc", + "boSendToBulkPrint": "Yes", + "bulkScanEnvelopes": [], + "deceasedForenames": "Dec", + "extraCopiesOfGrant": 0, + "ihtReferenceNumber": "Not applicable", + "boDocumentsUploaded": [], + "deceasedDateOfBirth": "1900-01-01", + "deceasedDateOfDeath": "2020-01-01", + "declarationCheckbox": "Yes", + "otherExecutorExists": "No", + "legalDeclarationJson": "{\"declarations\":[{\"headers\":[\"In the High Court of Justice\",\"Family Division\",\"(Intestacy)\"],\"sections\":[{\"headingType\":\"large\",\"title\":\"Legal statement\",\"declarationItems\":[{\"title\":\"I, Appfn Appsn of Frederick Gibberd Partnership 117-121 Curtain Road London SE22 9QD United Kingdom, make the following statement:\"}]},{\"headingType\":\"small\",\"title\":\"The person who died\",\"declarationItems\":[{\"title\":\"That Dec Eased, of Dusted Design Partners Ltd 65-68 Leadenhall Street London EC3A 2AD United Kingdom, was born on 1 January 1900 and died on 1 January 2020 intestate. \"},{\"title\":\"They were married or in a civil partnership and domiciled in England and Wales.\"},{\"title\":\"No children under 18 are entitled to the estate.\"}]},{\"headingType\":\"small\",\"title\":\"The estate of the person who died\",\"declarationItems\":[{\"title\":\"The gross value for the estate amounts to £10000.00 and the net value for the estate amounts to £8000.00.\"},{\"title\":\"To the best of my knowledge, information and belief, there was no land vested in Dec Eased which was settled previously to the death of Dec Eased and which remained settled land notwithstanding such death.\"},{\"title\":\"I am the lawful spouse or civil partner of Dec Eased and the only person now entitled to the estate.\"},{\"title\":\"I am applying for letters of administration. I have provided what I believe to be true and accurate information about Dec Eased.\"}]},{\"headingType\":\"large\",\"title\":\"Declaration\",\"declarationItems\":[{\"title\":\"I confirm that I will administer the estate of Dec Eased, according to law. I will:\",\"values\":[\"collect the whole estate\",\"keep full details (an inventory) of the estate\",\"keep a full account of how the estate has been distributed\"]},{\"title\":\"If the probate registry (court) asks me to do so, I will:\",\"values\":[\"provide the full details of the estate and how it has been distributed\",\"return the letters of administration to the court\"]},{\"title\":\"I understand that:\",\"values\":[\"my application will be rejected if I do not provide information (if asked)\",\"proceedings for contempt of court may be brought against the undersigned if it is found that the evidence provided is deliberately untruthful or dishonest, as well as revocation of the grant\"]}]}]}],\"dateCreated\":\"22/10/2021, 12:36:54\",\"deceased\":\"Dec Eased\"}", + "registryEmailAddress": "ctsc@email.com", + "deceasedAnyOtherNames": "No", + "deceasedMaritalStatus": "marriedCivilPartnership", + "deceasedDomicileInEngWales": "Yes", + "deceasedDiedEngOrWales": "Yes", + "ihtFormCompletedOnline": "No", + "registrySequenceNumber": 3, + "checkAnswersSummaryJson": "{\"sections\":[{\"title\":\"About the person who died\",\"type\":\"govuk-heading-m\",\"questionAndAnswers\":[{\"question\":\"Do you require a bilingual grant in English and Welsh?\",\"answers\":[\"No\"]},{\"question\":\"First name and any middle names\",\"answers\":[\"Dec\"]},{\"question\":\"Last name\",\"answers\":[\"Eased\"]},{\"question\":\"Did Dec Eased have assets in another name?\",\"answers\":[\"No\"]},{\"question\":\"What was their date of birth?\",\"answers\":[\"1 January 1900\"]},{\"question\":\"What was the date that they died?\",\"answers\":[\"1 January 2020\"]},{\"question\":\"What was Dec Eased’s marital status?\",\"answers\":[\"Married or in a civil partnership\"]},{\"question\":\"What was the permanent address at the time of their death?\",\"answers\":[\"Dusted Design Partners Ltd 65-68 Leadenhall Street London EC3A 2AD United Kingdom\"]},{\"question\":\"Did Dec Eased die in England or Wales?\",\"answers\":[\"Yes\"]},{\"question\":\"Do you have a death certificate or an interim death certificate?\",\"answers\":[\"Death certificate\"]}]},{\"title\":\"Inheritance tax\",\"type\":\"govuk-heading-m\",\"questionAndAnswers\":[{\"question\":\"How was the Inheritance Tax (IHT) form submitted?\",\"answers\":[\"By post\"]},{\"question\":\"Which paper form was filled in?\",\"answers\":[\"IHT 207 - there was no inheritance tax to pay and the person who died lived abroad\"]},{\"question\":\"Gross value of the estate in £\",\"answers\":[\"10000.00\"]},{\"question\":\"Net value of the estate in £\",\"answers\":[\"8000.00\"]}]},{\"title\":\"About the people applying\",\"type\":\"govuk-heading-m\",\"questionAndAnswers\":[{\"question\":\"What was your relationship to the person who died?\",\"answers\":[\"Husband, wife or civil partner (this does not include common law partners even if you lived together)\"]}]},{\"title\":\"About you\",\"type\":\"govuk-heading-s\",\"questionAndAnswers\":[{\"question\":\"First name and any middle names\",\"answers\":[\"Appfn\"]},{\"question\":\"Last name\",\"answers\":[\"Appsn\"]},{\"question\":\"Phone number\",\"answers\":[\"123456789\"]},{\"question\":\"What is your address?\",\"answers\":[\"Frederick Gibberd Partnership 117-121 Curtain Road London SE22 9QD United Kingdom\"]}]}],\"mainParagraph\":\"Check the information below carefully. This will form a record of your application for probate. It will also be stored as a public record, and will be able to be viewed online.\",\"pageTitle\":\"Check your answers\"}", + "languagePreferenceWelsh": "No", + "primaryApplicantAddress": { + "Country": "United Kingdom", + "PostCode": "SE22 9QD", + "PostTown": "London", + "AddressLine1": "Frederick Gibberd Partnership", + "AddressLine2": "117-121 Curtain Road" + }, + "primaryApplicantSurname": "Appsn", + "applicationSubmittedDate": "2021-10-22", + "deceasedDeathCertificate": "deathCertificate", + "primaryApplicantHasAlias": "No", + "statementOfTruthDocument": { + "document_url": "http://dm-store:8080/documents/37f5fb01-ba76-4851-ab51-d298b8f4243b", + "document_filename": "SOT.pdf", + "document_binary_url": "http://dm-store:8080/documents/37f5fb01-ba76-4851-ab51-d298b8f4243b/binary" + }, + "primaryApplicantForenames": "Appfn", + "probateDocumentsGenerated": [], + "deceasedHasAssetsOutsideUK": "No", + "primaryApplicantIsApplying": "Yes", + "boCaveatStopSendToBulkPrint": "Yes", + "primaryApplicantPhoneNumber": "123456789", + "boRequestInfoSendToBulkPrint": "Yes", + "primaryApplicantEmailAddress": "testusername@test.com", + "probateSotDocumentsGenerated": [], + "boCaveatStopEmailNotification": "Yes", + "boGrantReissueSendToBulkPrint": "Yes", + "probateNotificationsGenerated": [ + { + "id": "b9702d98-aced-4789-b2da-933a41e6c4ce", + "value": { + "DocumentLink": { + "document_url": "http://dm-store:8080/documents/735f1fbc-42fe-4db1-a1e4-c590df9d5a2e", + "document_filename": "sentEmail.pdf", + "document_binary_url": "http://dm-store:8080/documents/735f1fbc-42fe-4db1-a1e4-c590df9d5a2e/binary" + }, + "DocumentType": "sentEmail", + "DocumentFileName": "dfed04c2-027e-4a03-8329-a6c40577263d.pdf", + "DocumentDateAdded": "2021-10-22" + } + } + ], + "boEmailGrantIssuedNotification": "No", + "boEmailRequestInfoNotification": "No", + "boAssembleLetterSendToBulkPrint": "Yes", + "boEmailDocsReceivedNotification": "No", + "boEmailGrantReissuedNotification": "No", + "primaryApplicantRelationshipToDeceased": "partner" + } + } +} \ No newline at end of file diff --git a/src/functionalTest/resources/json/default/adColligenda/personal/adColligendaReissue.json b/src/functionalTest/resources/json/default/adColligenda/personal/adColligendaReissue.json new file mode 100644 index 0000000000..263b3cf29d --- /dev/null +++ b/src/functionalTest/resources/json/default/adColligenda/personal/adColligendaReissue.json @@ -0,0 +1,336 @@ +{ + "case_details": { + "id": 1528365719153338, + "jurisdiction": "PROBATE", + "state": "CaseCreated", + "case_type_id": "GrantOfRepresentation", + "created_date": [ + 2018, + 6, + 7, + 10, + 1, + 59, + 151000000 + ], + "last_modified": [ + 2018, + 6, + 7, + 10, + 8, + 8, + 695000000 + ], + "case_data": { + "caseType": "adColligendaBona", + "payments": [ + { + "id": "5198bb7b-90df-44ec-ab87-4bc096ce10d1", + "value": { + "date": null, + "amount": "21800", + "method": "online", + "siteId": "P223", + "status": "Success", + "reference": "RC-1635-2572-9117-7258", + "transactionId": "ojk8h6klau8cu0bmv1pbqvjibk" + } + } + ], + "taskList": "
\n

1. Enter application details

\n

These steps are to be completed by the Probate practitioner.

 
\n
\n\n

Add Probate practitioner details

\"COMPLETED\"

\n
\n
\n\n

Add deceased details

\"COMPLETED\"

\n
\n
\n\n

Add application details

\"COMPLETED\"

\n
\n
\n\n
\n

2. Sign legal statement and submit application

\n

These steps are to be completed by the Probate practitioner.

 
\n
\n\n

Review and sign legal statement and submit application

\"COMPLETED\"

\n
\n

Submitted on 26 Oct 2021

 
\n

The legal statement is generated. You can review, change any details, then sign and submit your application.

 
\n
\n\n

Send documents

\n \n \n View the documents needed by HM Courts and Tribunal Service\n \n \n
\n You now need to send us
  • the printed coversheet (accessed in the cover sheet tab) or your reference number 1635257149285592 written on a sheet of paper
  • a photocopy of the signed legal statement and declaration
  • the original will
  • the inheritance tax form IHT207
\n
\n

\"COMPLETED\"

\n
\n
\n\n
\n

3. Review application

\n

These steps are completed by HM Courts and Tribunals Service staff. It can take a few weeks before the review starts.

 
\n
\n\n

Authenticate documents

\"COMPLETED\"

\n
\n

Authenticated on 26 Oct 2021

 
\n

We will authenticate your documents and match them with your application.

 
\n
\n\n

Examine application

\"IN

\n
\n

We review your application for incomplete information or problems and validate it against other cases or caveats. After the review we prepare the grant.

 
\n

Your application will update through any of these case states as it is reviewed by our team:

 
\n
    \n
  • Examining
  • \n
  • Case Matching
  • \n
  • Case selected for Quality Assurance
  • \n
  • Ready to issue
  • \n

\n\n

4. Grant of representation

\n

This step is completed by HM Courts and Tribunals Service staff.

 
\n
\n\n

Issue grant of representation

\n

The grant will be delivered in the post a few days after issuing.

 
\n
\n\n
\n
\n", + "ihtFormId": "IHT207", + "paperForm": "No", + "willExists": "No", + "bulkPrintId": [], + "caseMatches": [ + { + "id": "fbb79d2e-311b-4baa-a0a7-9475361be1f1", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635240157292502" + }, + "doImport": "No", + "fullName": "dec eased", + "postcode": "EC3A 2AD", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "8cb64aa7-67df-4230-b070-fc7eb83b2406", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635253833256239" + }, + "doImport": "No", + "fullName": "Dec Eased", + "postcode": "EC3A 2AD", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "eacedaad-5354-4d57-8626-07a595d96af6", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635237697262540" + }, + "doImport": "No", + "fullName": "dec eased", + "postcode": "dsad", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "56fbb06f-2372-4893-aeea-5147cf990791", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635238257021524" + }, + "doImport": "No", + "fullName": "Dec Eased", + "postcode": "ddsfds", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "5b28fb6a-b11e-499b-affc-698f6cbb5c00", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635252243460860" + }, + "doImport": "No", + "fullName": "Dec Eased", + "postcode": "EC3A 2AD", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "3c1c5f9a-d24c-453c-8c35-f0ad172d4874", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635252725942401" + }, + "doImport": "No", + "fullName": "Dec Eased", + "postcode": "EC3A 2AD", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + } + ], + "casePrinted": "Yes", + "declaration": { + "accept": null, + "confirm": null, + "requests": null, + "understand": null, + "confirmItem1": null, + "confirmItem2": null, + "confirmItem3": null, + "requestsItem1": null, + "requestsItem2": null, + "understandItem1": null, + "understandItem2": null + }, + "ihtNetValue": "800000", + "orderNeeded": "Yes", + "ihtGrossValue": "1000000", + "reissueReason": [ + { + "id": "7223490e-122d-43d9-83da-713e1386c3c7", + "value": { + "reissueReason": "duplicate", + "reissueReasonDetails": "Reason for reissue" + } + } + ], + "legalStatement": { + "intro": null, + "deceased": null, + "applicant": null, + "executorsApplying": [], + "deceasedEstateLand": null, + "deceasedOtherNames": null, + "deceasedEstateValue": null, + "executorsNotApplying": [] + }, + "applicationType": "Personal", + "dateOfDeathType": "diedOn", + "deceasedAddress": { + "County": null, + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Dusted Design Partners Ltd", + "AddressLine2": "65-68 Leadenhall Street", + "AddressLine3": null + }, + "deceasedSurname": "Eased", + "evidenceHandled": "Yes", + "grantIssuedDate": "2021-10-26", + "registryAddress": "Line 1 Ox\nLine 2 Ox\nLine 3 Ox\nPostCode Ox\n", + "bulkPrintPdfSize": "4", + "paragraphDetails": [], + "registryLocation": "ctsc", + "authenticatedDate": "2021-10-26", + "boSendToBulkPrint": "Yes", + "bulkScanEnvelopes": [], + "deceasedForenames": "Dec", + "extraCopiesOfGrant": "2", + "boDocumentsUploaded": [], + "deceasedDateOfBirth": "1900-01-01", + "deceasedDateOfDeath": "2020-01-01", + "declarationCheckbox": "Yes", + "otherExecutorExists": "No", + "legalDeclarationJson": "{\"declarations\":[{\"headers\":[\"In the High Court of Justice\",\"Family Division\",\"(Intestacy)\"],\"sections\":[{\"headingType\":\"large\",\"title\":\"Legal statement\",\"declarationItems\":[{\"title\":\"I, Appfn Appsn of Frederick Gibberd Partnership 117-121 Curtain Road London EC2A 3AD United Kingdom, make the following statement:\"}]},{\"headingType\":\"small\",\"title\":\"The person who died\",\"declarationItems\":[{\"title\":\"That Dec Eased, of Dusted Design Partners Ltd 65-68 Leadenhall Street London EC3A 2AD United Kingdom, was born on 1 January 1900 and died on 1 January 2020 intestate. \"},{\"title\":\"They were married or in a civil partnership and domiciled in England and Wales.\"},{\"title\":\"No children under 18 are entitled to the estate.\"}]},{\"headingType\":\"small\",\"title\":\"The estate of the person who died\",\"declarationItems\":[{\"title\":\"The gross value for the estate amounts to £10000.00 and the net value for the estate amounts to £8000.00.\"},{\"title\":\"To the best of my knowledge, information and belief, there was no land vested in Dec Eased which was settled previously to the death of Dec Eased and which remained settled land notwithstanding such death.\"},{\"title\":\"I am the lawful spouse or civil partner of Dec Eased and the only person now entitled to the estate.\"},{\"title\":\"I am applying for letters of administration. I have provided what I believe to be true and accurate information about Dec Eased.\"}]},{\"headingType\":\"large\",\"title\":\"Declaration\",\"declarationItems\":[{\"title\":\"I confirm that I will administer the estate of Dec Eased, according to law. I will:\",\"values\":[\"collect the whole estate\",\"keep full details (an inventory) of the estate\",\"keep a full account of how the estate has been distributed\"]},{\"title\":\"If the probate registry (court) asks me to do so, I will:\",\"values\":[\"provide the full details of the estate and how it has been distributed\",\"return the letters of administration to the court\"]},{\"title\":\"I understand that:\",\"values\":[\"my application will be rejected if I do not provide information (if asked)\",\"proceedings for contempt of court may be brought against the undersigned if it is found that the evidence provided is deliberately untruthful or dishonest, as well as revocation of the grant\"]}]}]}],\"dateCreated\":\"26/10/2021, 15:07:22\",\"deceased\":\"Dec Eased\"}", + "registryEmailAddress": "ctsc@email.com", + "bulkPrintSendLetterId": "1d3c10f8-f64e-4d86-a786-136b75a2949c", + "deceasedAnyOtherNames": "No", + "deceasedMaritalStatus": "marriedCivilPartnership", + "deceasedDomicileInEngWales": "Yes", + "deceasedDiedEngOrWales": "Yes", + "ihtFormCompletedOnline": "No", + "registrySequenceNumber": "5", + "checkAnswersSummaryJson": "{\"sections\":[{\"title\":\"About the person who died\",\"type\":\"govuk-heading-m\",\"questionAndAnswers\":[{\"question\":\"Do you require a bilingual grant in English and Welsh?\",\"answers\":[\"No\"]},{\"question\":\"First name and any middle names\",\"answers\":[\"Dec\"]},{\"question\":\"Last name\",\"answers\":[\"Eased\"]},{\"question\":\"Did Dec Eased have assets in another name?\",\"answers\":[\"No\"]},{\"question\":\"What was their date of birth?\",\"answers\":[\"1 January 1900\"]},{\"question\":\"What was the date that they died?\",\"answers\":[\"1 January 2020\"]},{\"question\":\"What was Dec Eased’s marital status?\",\"answers\":[\"Married or in a civil partnership\"]},{\"question\":\"What was the permanent address at the time of their death?\",\"answers\":[\"Dusted Design Partners Ltd 65-68 Leadenhall Street London EC3A 2AD United Kingdom\"]},{\"question\":\"Did Dec Eased die in England or Wales?\",\"answers\":[\"Yes\"]},{\"question\":\"Do you have a death certificate or an interim death certificate?\",\"answers\":[\"Death certificate\"]}]},{\"title\":\"Inheritance tax\",\"type\":\"govuk-heading-m\",\"questionAndAnswers\":[{\"question\":\"How was the Inheritance Tax (IHT) form submitted?\",\"answers\":[\"By post\"]},{\"question\":\"Which paper form was filled in?\",\"answers\":[\"IHT 207 - there was no inheritance tax to pay and the person who died lived abroad\"]},{\"question\":\"Gross value of the estate in £\",\"answers\":[\"10000.00\"]},{\"question\":\"Net value of the estate in £\",\"answers\":[\"8000.00\"]}]},{\"title\":\"About the people applying\",\"type\":\"govuk-heading-m\",\"questionAndAnswers\":[{\"question\":\"What was your relationship to the person who died?\",\"answers\":[\"Husband, wife or civil partner (this does not include common law partners even if you lived together)\"]}]},{\"title\":\"About you\",\"type\":\"govuk-heading-s\",\"questionAndAnswers\":[{\"question\":\"First name and any middle names\",\"answers\":[\"Appfn\"]},{\"question\":\"Last name\",\"answers\":[\"Appsn\"]},{\"question\":\"Phone number\",\"answers\":[\"123456789\"]},{\"question\":\"What is your address?\",\"answers\":[\"Frederick Gibberd Partnership 117-121 Curtain Road London EC2A 3AD United Kingdom\"]}]}],\"mainParagraph\":\"Check the information below carefully. This will form a record of your application for probate. It will also be stored as a public record, and will be able to be viewed online.\",\"pageTitle\":\"Check your answers\"}", + "languagePreferenceWelsh": "No", + "primaryApplicantAddress": { + "County": null, + "Country": "United Kingdom", + "PostCode": "EC2A 3AD", + "PostTown": "London", + "AddressLine1": "Frederick Gibberd Partnership", + "AddressLine2": "117-121 Curtain Road", + "AddressLine3": null + }, + "primaryApplicantSurname": "Appsn", + "applicationSubmittedDate": "2021-10-26", + "boExaminationChecklistQ1": "Yes", + "boExaminationChecklistQ2": "Yes", + "deceasedDeathCertificate": "deathCertificate", + "primaryApplicantHasAlias": "No", + "statementOfTruthDocument": { + "document_url": "http://dm-store:8080/documents/b0977f3d-93a5-4dac-9cc2-8adb54b13c28", + "document_filename": "SOT.pdf", + "document_binary_url": "http://dm-store:8080/documents/b0977f3d-93a5-4dac-9cc2-8adb54b13c28/binary" + }, + "primaryApplicantForenames": "Appfn", + "boSendToBulkPrintRequested": "Yes", + "deceasedHasAssetsOutsideUK": "No", + "primaryApplicantIsApplying": "Yes", + "boCaveatStopSendToBulkPrint": "Yes", + "primaryApplicantPhoneNumber": "123456789", + "boRequestInfoSendToBulkPrint": "Yes", + "primaryApplicantEmailAddress": "testusername@test.com", + "probateSotDocumentsGenerated": [], + "boCaveatStopEmailNotification": "Yes", + "boGrantReissueSendToBulkPrint": "Yes", + "probateNotificationsGenerated": [ + { + "id": "257ede45-15ab-40a4-bdce-77b7347692f7", + "value": { + "DocumentLink": { + "document_url": "http://dm-store:8080/documents/56b2da76-717c-40f5-838c-ed3989d67238", + "document_filename": "sentEmail.pdf", + "document_binary_url": "http://dm-store:8080/documents/56b2da76-717c-40f5-838c-ed3989d67238/binary" + }, + "DocumentType": "sentEmail", + "DocumentFileName": "100ef5ba-aee5-435d-9cfa-0fbbbc77792c.pdf", + "DocumentDateAdded": "2021-10-26", + "DocumentGeneratedBy": null + } + }, + { + "id": "823bcc7f-ca8b-4528-a9f6-eaed2a5cb60e", + "value": { + "DocumentLink": { + "document_url": "http://dm-store:8080/documents/b7468e47-5ae7-439a-b09c-fb5604238bcc", + "document_filename": "sentEmail.pdf", + "document_binary_url": "http://dm-store:8080/documents/b7468e47-5ae7-439a-b09c-fb5604238bcc/binary" + }, + "DocumentType": "sentEmail", + "DocumentFileName": "6d6a35ff-fce4-4a5c-9f82-50d1ca503dc4.pdf", + "DocumentDateAdded": "2021-10-26", + "DocumentGeneratedBy": "4566dedc-7de1-42bd-ad21-99ea1f498595" + } + }, + { + "id": "36cd668e-82aa-4c83-8a6b-d65dfbabe555", + "value": { + "DocumentLink": { + "document_url": "http://dm-store:8080/documents/1dc785f7-3066-4b6b-a217-98ca15fa2395", + "document_filename": "sentEmail.pdf", + "document_binary_url": "http://dm-store:8080/documents/1dc785f7-3066-4b6b-a217-98ca15fa2395/binary" + }, + "DocumentType": "sentEmail", + "DocumentFileName": "79052175-3441-4bb1-9824-3dc6ec781d98.pdf", + "DocumentDateAdded": "2021-10-26", + "DocumentGeneratedBy": "4566dedc-7de1-42bd-ad21-99ea1f498595" + } + } + ], + "boEmailGrantIssuedNotification": "No", + "boEmailRequestInfoNotification": "No", + "boAssembleLetterSendToBulkPrint": "Yes", + "boEmailDocsReceivedNotification": "No", + "boExaminationChecklistRequestQA": "No", + "boEmailGrantReissuedNotification": "No", + "primaryApplicantRelationshipToDeceased": "partner", + "boEmailGrantIssuedNotificationRequested": "Yes", + "boEmailDocsReceivedNotificationRequested": "Yes", + "grantAwaitingDocumentationNotificationDate": "2021-11-30" + } + } +} \ No newline at end of file diff --git a/src/functionalTest/resources/json/default/adColligenda/solicitor/adColligenda.json b/src/functionalTest/resources/json/default/adColligenda/solicitor/adColligenda.json new file mode 100644 index 0000000000..5f98938ce7 --- /dev/null +++ b/src/functionalTest/resources/json/default/adColligenda/solicitor/adColligenda.json @@ -0,0 +1,162 @@ +{ + "case_details": { + "id": 1528365719153338, + "jurisdiction": "PROBATE", + "state": "CaseCreated", + "case_type_id": "GrantOfRepresentation", + "created_date": [ + 2018, + 6, + 7, + 10, + 1, + 59, + 151000000 + ], + "last_modified": [ + 2018, + 6, + 7, + 10, + 8, + 8, + 695000000 + ], + "case_data": { + "caseType": "adColligendaBona", + "payments": [ + { + "id": "e2767734-6712-4aa9-a9a8-daa614620a02", + "value": { + "date": null, + "amount": null, + "method": "pba", + "siteId": null, + "status": "Success", + "reference": "RC-1590-6786-1063-9991", + "transactionId": null + } + } + ], + "taskList": "
\n

1. Enter application details

\n

These steps are to be completed by the Probate practitioner.

 
\n
\n\n

Add Probate practitioner details

\"COMPLETED\"

\n
\n
\n\n

Add deceased details

\"COMPLETED\"

\n
\n
\n\n

Add application details

\"COMPLETED\"

\n
\n
\n\n
\n

2. Sign legal statement and submit application

\n

These steps are to be completed by the Probate practitioner.

 
\n
\n\n

Review and sign legal statement and submit application

\"COMPLETED\"

\n
\n

The legal statement is generated. You can review, change any details, then sign and submit your application.

 
\n
\n\n

Send documents

\n \n \n View the documents needed by HM Courts and Tribunal Service\n \n \n
\n You now need to send us
  • the printed coversheet (accessed in the cover sheet tab) or your reference number 1635154574287286 written on a sheet of paper
  • a photocopy of the signed legal statement and declaration
  • the inheritance tax form IHT207
\n
\n

\"IN

\n
\n
\n\n
\n

3. Review application

\n

These steps are completed by HM Courts and Tribunals Service staff. It can take a few weeks before the review starts.

 
\n
\n\n

Authenticate documents

\n

We will authenticate your documents and match them with your application.

 
\n
\n\n

Examine application

\n

We review your application for incomplete information or problems and validate it against other cases or caveats. After the review we prepare the grant.

 
\n

Your application will update through any of these case states as it is reviewed by our team:

 
\n
    \n
  • Examining
  • \n
  • Case Matching
  • \n
  • Case selected for Quality Assurance
  • \n
  • Ready to issue
  • \n

\n\n

4. Grant of representation

\n

This step is completed by HM Courts and Tribunals Service staff.

 
\n
\n\n

Issue grant of representation

\n

The grant will be delivered in the post a few days after issuing.

 
\n
\n\n
\n
\n", + "totalFee": "15500", + "ihtFormId": "IHT207", + "paperForm": "No", + "willExists": "No", + "bulkPrintId": [], + "caseMatches": [], + "ihtNetValue": "800000", + "solsSOTName": "ppfn ppsn", + "solsWillType": "NoWill", + "ihtGrossValue": "1000000", + "solsPBANumber": { + "value": { + "code": "PBA0082126", + "label": "PBA0082126" + }, + "list_items": [ + { + "code": "PBA0082126", + "label": "PBA0082126" + }, + { + "code": "PBA0083372", + "label": "PBA0083372" + } + ] + }, + "applicationFee": "15500", + "feeForUkCopies": "0", + "solsSOTSurname": "ppsn", + "applicationType": "Solicitor", + "dateOfDeathType": "diedOn", + "deceasedAddress": { + "County": "Greater London", + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Dusted Design Partners Ltd", + "AddressLine2": "65-68 Leadenhall Street", + "AddressLine3": "" + }, + "deceasedSurname": "Eased", + "paragraphDetails": [], + "registryLocation": "ctsc", + "solsSOTForenames": "ppfn", + "boSendToBulkPrint": "Yes", + "bulkScanEnvelopes": [], + "deceasedForenames": "Dec", + "executorsApplying": [], + "feeForNonUkCopies": "0", + "extraCopiesOfGrant": "0", + "solsPaymentMethods": "fee account", + "solsSolicitorEmail": "1@1.com", + "boDocumentsUploaded": [], + "deceasedDateOfBirth": "1900-01-01", + "deceasedDateOfDeath": "2020-01-01", + "solsSOTNeedToUpdate": "No", + "solsSolicitorIsExec": "No", + "executorsNotApplying": [], + "outsideUKGrantCopies": "0", + "solsMinorityInterest": "No", + "solsSolicitorAddress": { + "County": "Greater London", + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Dusted Design Partners Ltd", + "AddressLine2": "65-68 Leadenhall Street", + "AddressLine3": "" + }, + "deceasedAnyOtherNames": "No", + "deceasedMaritalStatus": "marriedCivilPartnership", + "solsSolicitorFirmName": "Firm", + "ihtFormCompletedOnline": "No", + "solsCoversheetDocument": { + "document_url": "http://dm-store:8080/documents/ba162370-a736-49cc-97e4-242ff7260be8", + "document_filename": "solicitorCoverSheet.pdf", + "document_binary_url": "http://dm-store:8080/documents/ba162370-a736-49cc-97e4-242ff7260be8/binary" + }, + "primaryApplicantAddress": { + "County": "Greater London", + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Frederick Gibberd Partnership", + "AddressLine2": "117-121 Curtain Road", + "AddressLine3": "" + }, + "primaryApplicantSurname": "Appsn", + "solsPBAPaymentReference": "REFERENCE", + "solsSolicitorIsApplying": "No", + "applicationSubmittedDate": "2021-10-25", + "primaryApplicantHasAlias": "No", + "solsSolicitorWillSignSOT": "Yes", + "primaryApplicantForenames": "Appfn", + "probateDocumentsGenerated": [], + "solsSolicitorAppReference": "REFERENCE", + "deceasedDomicileInEngWales": "Yes", + "primaryApplicantIsApplying": "Yes", + "solsDeceasedAliasNamesList": [], + "solsLegalStatementDocument": { + "document_url": "http://dm-store:8080/documents/519beecf-0f0d-4d75-bf98-1e10e9a5c00b", + "document_filename": "legalStatementIntestacy.pdf", + "document_binary_url": "http://dm-store:8080/documents/519beecf-0f0d-4d75-bf98-1e10e9a5c00b/binary" + }, + "boCaveatStopSendToBulkPrint": "Yes", + "primaryApplicantPhoneNumber": "123456789", + "boRequestInfoSendToBulkPrint": "Yes", + "primaryApplicantEmailAddress": "1@1.com", + "probateSotDocumentsGenerated": [], + "boCaveatStopEmailNotification": "No", + "boGrantReissueSendToBulkPrint": "Yes", + "probateNotificationsGenerated": [], + "boEmailGrantIssuedNotification": "No", + "boEmailRequestInfoNotification": "No", + "boAssembleLetterSendToBulkPrint": "Yes", + "boEmailDocsReceivedNotification": "No", + "boEmailGrantReissuedNotification": "No", + "solsApplicantRelationshipToDeceased": "SpouseOrCivil" + } + } + } \ No newline at end of file diff --git a/src/functionalTest/resources/json/default/adColligenda/solicitor/adColligendaReissue.json b/src/functionalTest/resources/json/default/adColligenda/solicitor/adColligendaReissue.json new file mode 100644 index 0000000000..86248af6ab --- /dev/null +++ b/src/functionalTest/resources/json/default/adColligenda/solicitor/adColligendaReissue.json @@ -0,0 +1,306 @@ +{ + "case_details": { + "id": 1528365719153338, + "jurisdiction": "PROBATE", + "state": "CaseCreated", + "case_type_id": "GrantOfRepresentation", + "created_date": [ + 2018, + 6, + 7, + 10, + 1, + 59, + 151000000 + ], + "last_modified": [ + 2018, + 6, + 7, + 10, + 8, + 8, + 695000000 + ], + "case_data": { + "caseType": "adColligendaBona", + "payments": [ + { + "id": "d855d577-e7aa-4297-b539-7365f78aa204", + "value": { + "date": null, + "amount": null, + "method": "pba", + "siteId": null, + "status": "Success", + "reference": "RC-1590-6786-1063-9991", + "transactionId": null + } + } + ], + "taskList": "
\n

1. Enter application details

\n

These steps are to be completed by the Probate practitioner.

 
\n
\n\n

Add Probate practitioner details

\"COMPLETED\"

\n
\n
\n\n

Add deceased details

\"COMPLETED\"

\n
\n
\n\n

Add application details

\"COMPLETED\"

\n
\n
\n\n
\n

2. Sign legal statement and submit application

\n

These steps are to be completed by the Probate practitioner.

 
\n
\n\n

Review and sign legal statement and submit application

\"COMPLETED\"

\n
\n

Submitted on 26 Oct 2021

 
\n

The legal statement is generated. You can review, change any details, then sign and submit your application.

 
\n
\n\n

Send documents

\n \n \n View the documents needed by HM Courts and Tribunal Service\n \n \n
\n You now need to send us
  • the printed coversheet (accessed in the cover sheet tab) or your reference number 1635253833256239 written on a sheet of paper
  • a photocopy of the signed legal statement and declaration
  • the inheritance tax form IHT207
\n
\n

\"COMPLETED\"

\n
\n
\n\n
\n

3. Review application

\n

These steps are completed by HM Courts and Tribunals Service staff. It can take a few weeks before the review starts.

 
\n
\n\n

Authenticate documents

\"COMPLETED\"

\n
\n

Authenticated on 26 Oct 2021

 
\n

We will authenticate your documents and match them with your application.

 
\n
\n\n

Examine application

\"IN

\n
\n

We review your application for incomplete information or problems and validate it against other cases or caveats. After the review we prepare the grant.

 
\n

Your application will update through any of these case states as it is reviewed by our team:

 
\n
    \n
  • Examining
  • \n
  • Case Matching
  • \n
  • Case selected for Quality Assurance
  • \n
  • Ready to issue
  • \n

\n\n

4. Grant of representation

\n

This step is completed by HM Courts and Tribunals Service staff.

 
\n
\n\n

Issue grant of representation

\n

The grant will be delivered in the post a few days after issuing.

 
\n
\n\n
\n
\n", + "totalFee": "15500", + "ihtFormId": "IHT207", + "paperForm": "No", + "willExists": "No", + "bulkPrintId": [], + "caseMatches": [ + { + "id": "d5657408-f743-4533-bb1f-073f47cb5661", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635240157292502" + }, + "doImport": "No", + "fullName": "dec eased", + "postcode": "EC3A 2AD", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "e556ae2b-c486-4470-940c-1180aa90c23b", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635237697262540" + }, + "doImport": "No", + "fullName": "dec eased", + "postcode": "dsad", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "8ca02dba-09ea-41eb-ad43-1ebdd0eee194", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635238257021524" + }, + "doImport": "No", + "fullName": "Dec Eased", + "postcode": "ddsfds", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "01c8860b-d772-4f89-81e7-4b954399ac5b", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635252243460860" + }, + "doImport": "No", + "fullName": "Dec Eased", + "postcode": "EC3A 2AD", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + }, + { + "id": "5130ecd7-f585-4c6c-a93b-8fa4cfba3c9b", + "value": { + "id": null, + "dob": "1900-01-01", + "dod": "2020-01-01", + "type": "Grant of Representation", + "valid": "Yes", + "aliases": null, + "comment": null, + "caseLink": { + "CaseReference": "1635252725942401" + }, + "doImport": "No", + "fullName": "Dec Eased", + "postcode": "EC3A 2AD", + "recordId": null, + "ccdCaseId": null, + "legacyCaseViewUrl": null + } + } + ], + "casePrinted": "Yes", + "ihtNetValue": "800000", + "orderNeeded": "Yes", + "reissueDate": "2020-01-01", + "solsSOTName": "ppfn ppsn", + "solsWillType": "NoWill", + "ihtGrossValue": "1000000", + "reissueReason": [ + { + "id": "27f666c6-6b11-4b9d-ad19-f30bc1eaebdb", + "value": { + "reissueReason": "officialError", + "reissueReasonDetails": "Reason for reissue" + } + } + ], + "solsPBANumber": { + "value": { + "code": "PBA0082126", + "label": "PBA0082126" + }, + "list_items": [ + { + "code": "PBA0082126", + "label": "PBA0082126" + }, + { + "code": "PBA0083372", + "label": "PBA0083372" + } + ] + }, + "applicationFee": "15500", + "feeForUkCopies": "0", + "solsSOTSurname": "ppsn", + "applicationType": "Solicitor", + "dateOfDeathType": "diedOn", + "deceasedAddress": { + "County": "Greater London", + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Dusted Design Partners Ltd", + "AddressLine2": "65-68 Leadenhall Street", + "AddressLine3": "" + }, + "deceasedSurname": "Eased", + "evidenceHandled": "Yes", + "grantIssuedDate": "2021-10-26", + "bulkPrintPdfSize": "2", + "paragraphDetails": [], + "registryLocation": "ctsc", + "solsSOTForenames": "ppfn", + "authenticatedDate": "2021-10-26", + "boSendToBulkPrint": "Yes", + "bulkScanEnvelopes": [], + "deceasedForenames": "Dec", + "executorsApplying": [], + "feeForNonUkCopies": "0", + "extraCopiesOfGrant": "0", + "solsPaymentMethods": "fee account", + "solsSolicitorEmail": "1@1.com", + "boDocumentsUploaded": [], + "deceasedDateOfBirth": "1900-01-01", + "deceasedDateOfDeath": "2020-01-01", + "solsSolicitorIsExec": "No", + "executorsNotApplying": [], + "outsideUKGrantCopies": "0", + "solsMinorityInterest": "No", + "solsSolicitorAddress": { + "County": "Greater London", + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Dusted Design Partners Ltd", + "AddressLine2": "65-68 Leadenhall Street", + "AddressLine3": "" + }, + "bulkPrintSendLetterId": "2eb9b21c-e5f1-4090-bd43-3f468c3f75fa", + "deceasedAnyOtherNames": "No", + "deceasedMaritalStatus": "marriedCivilPartnership", + "reissueReasonNotation": "duplicate", + "solsSolicitorFirmName": "Firm", + "ihtFormCompletedOnline": "No", + "solsCoversheetDocument": { + "document_url": "http://dm-store:8080/documents/dcbc7eee-a538-46cf-8168-cac7d8dda4cc", + "document_filename": "solicitorCoverSheet.pdf", + "document_binary_url": "http://dm-store:8080/documents/dcbc7eee-a538-46cf-8168-cac7d8dda4cc/binary" + }, + "primaryApplicantAddress": { + "County": "Greater London", + "Country": "United Kingdom", + "PostCode": "EC3A 2AD", + "PostTown": "London", + "AddressLine1": "Anlon Ltd", + "AddressLine2": "65-68 Leadenhall Street", + "AddressLine3": "" + }, + "primaryApplicantSurname": "Appsn", + "solsPBAPaymentReference": "REFERENCE", + "solsSolicitorIsApplying": "No", + "applicationSubmittedDate": "2021-10-26", + "boExaminationChecklistQ1": "Yes", + "boExaminationChecklistQ2": "Yes", + "primaryApplicantHasAlias": "No", + "solsSolicitorWillSignSOT": "Yes", + "primaryApplicantForenames": "Appfn", + "solsSolicitorAppReference": "REFERENCE", + "boSendToBulkPrintRequested": "Yes", + "deceasedDomicileInEngWales": "Yes", + "primaryApplicantIsApplying": "Yes", + "solsDeceasedAliasNamesList": [], + "solsLegalStatementDocument": { + "document_url": "http://dm-store:8080/documents/d0489fdd-e204-4939-b1b0-46079b7dc29a", + "document_filename": "legalStatementIntestacy.pdf", + "document_binary_url": "http://dm-store:8080/documents/d0489fdd-e204-4939-b1b0-46079b7dc29a/binary" + }, + "boCaveatStopSendToBulkPrint": "Yes", + "boRequestInfoSendToBulkPrint": "Yes", + "primaryApplicantEmailAddress": "1@1.com", + "probateSotDocumentsGenerated": [], + "boCaveatStopEmailNotification": "No", + "boGrantReissueSendToBulkPrint": "Yes", + "probateNotificationsGenerated": [ + { + "id": "49ad590b-464d-4ea8-b420-107f0d701508", + "value": { + "DocumentLink": { + "document_url": "http://dm-store:8080/documents/fe5f11a7-e5a5-436c-882f-35647c09262d", + "document_filename": "sentEmail.pdf", + "document_binary_url": "http://dm-store:8080/documents/fe5f11a7-e5a5-436c-882f-35647c09262d/binary" + }, + "DocumentType": "sentEmail", + "DocumentFileName": "de3ba319-19fe-4ed5-8876-b6bfb18a9a38.pdf", + "DocumentDateAdded": "2021-10-26", + "DocumentGeneratedBy": "4566dedc-7de1-42bd-ad21-99ea1f498595" + } + } + ], + "boEmailGrantIssuedNotification": "No", + "boEmailRequestInfoNotification": "No", + "boAssembleLetterSendToBulkPrint": "Yes", + "boEmailDocsReceivedNotification": "No", + "boExaminationChecklistRequestQA": "No", + "boEmailGrantReissuedNotification": "No", + "solsApplicantRelationshipToDeceased": "SpouseOrCivil", + "boEmailGrantIssuedNotificationRequested": "No", + "boEmailDocsReceivedNotificationRequested": "Yes", + "grantAwaitingDocumentationNotificationDate": "2021-11-30" + } + } + } +} \ No newline at end of file diff --git a/src/functionalTest/resources/json/expectedDocumentGrantAdColligendaWelsh.txt b/src/functionalTest/resources/json/expectedDocumentGrantAdColligendaWelsh.txt new file mode 100644 index 0000000000..1238da3131 --- /dev/null +++ b/src/functionalTest/resources/json/expectedDocumentGrantAdColligendaWelsh.txt @@ -0,0 +1 @@ +High Court of Justice England and WalesPrincipal Registry of the Family DivisionHMCTS ProbatePO Box 12625HarlowCM20 9QE0300 303 0648Uchel Lys Barn Cymru a LloegrPrif Gofrestrfa'r Adran DeuluProfiant GLITEFBlwch Post 12625HarlowCM20 9QE0300 303 0654Ad Colligenda BonaCase Reference: 1528365719154001Cyfeirnod yr Achos: 1528365719154001Date of Issue: 1st August 2021Dyddiad Cyhoeddi: 1 Awst 2021DeadFN1 DeadFN2 DeadSN of / o 1 DecAddress Road HP5 2PNDied on 7th July 2021 domiciled in England and WalesBu farw ar 7 Gorffennaf 2021 ac roedd â’i d/ddomisil Nghymru a Lloegr The Administration of DeadFN1 DeadFN2 DeadSN's estate is granted by this court to the following AdministratorsMae’r llys hwn yn caniatáu i’r Gweinyddwr canlynol weinyddu ystad DeadFN1 DeadFN2 DeadSN App1FN App1SN of / o 1 PrimAppAddress Road HP5 2PN and / a/acexec1FN exec1LN of / o 1 Exec1Address Road HA1 4ET This is an Ad Colligenda Bona grant and is limited for the purposes only of collecting getting in and receiving the estate and doing such acts as may be necessary for the preservation of the same in particular, to deal with issues and if necessary to sell 1 DecAddress Road and until further representation be grantedMae hwn yn grant Ad Colligenda Bona ac mae wedi'i gyfyngu at y dibenion o gasglu, galw i mewn a chael yr ystad yn unig a gwneud y fath weithredoedd a allai fod yn angenrheidiol ar gyfer gwneud hynny, i ddelio â materion ac os oes angen gwerthu 1 DecAddress Road a hyd nes y rhoddir cynrychiolaeth bellachThe application has stated that the gross value of the estate in England and Wales amounts to £300,000 and the net value amounts to £290,000Mae'r cais yn nodi mai £300,000 yw gwerth gros yr ystad yn Nghymru a Lloegr, ac mai £290,000 yw'r gwerth net. DISTRICT REGISTRAR COFRESTRYDD DOSBARTH Extracted personallyWedi ei gyflwyno yn bersonolIf you wish to validate the information contained within this document please call 0300 303 0648Os ydych yn dymuno dilysu'r wybodaeth sydd yn y ddogfen hon, ffoniwch 0300 303 0654 \ No newline at end of file diff --git a/src/functionalTest/resources/json/expectedDocumentReissueAdmonWillWelsh.txt b/src/functionalTest/resources/json/expectedDocumentReissueAdmonWillWelsh.txt index 3040beddb4..f656a78a41 100644 --- a/src/functionalTest/resources/json/expectedDocumentReissueAdmonWillWelsh.txt +++ b/src/functionalTest/resources/json/expectedDocumentReissueAdmonWillWelsh.txt @@ -1 +1 @@ -High Court of Justice England and WalesPrincipal Registry of the Family DivisionHMCTS ProbatePO Box 12625HarlowCM20 9QE0300 303 0648Uchel Lys Barn Cymru a LloegrPrif Gofrestrfa'r Adran DeuluProfiant GLITEFBlwch Post 12625HarlowCM20 9QE0300 303 0654Letters of Administration with willLlythyrau Gweinyddu gydag EwyllysAmended and re-issued pursuant to Registrar’s order dated 6th August 2021Wedi ei ddiwygio a’i ail gyhoeddi yn unol â Gorchymyn y Cofrestrydd 6 Awst 2021Case Reference: 1528365719154001Cyfeirnod yr Achos: 1528365719154001Date of Issue: 5th August 2021Dyddiad Cyhoeddi: 5 Awst 2021DeadFN1 DeadFN2 DeadSN of / o 1 WelshReissue Road HP5 2PNPresumed died on 4th April 2021 domiciled in England and WalesY tybir yn farw ar 4 Ebrill 2021 ac roedd â’i d/ddomisil Nghymru a Lloegr The Last Will and Testament of DeadFN1 DeadFN2 DeadSN (An official copy of which is available from the Court) was proved and registered before the High Court of Justice. The Administration of DeadFN1 DeadFN2 DeadSN's estate is granted by this court to the following AdministratorMae Ewyllys a Thestament olaf DeadFN1 DeadFN2 DeadSN (Mae copi swyddogol ohoni ar gael gan y Llys) wedi'i phrofi a'i chofrestru gerbron yr Uchel Lys Barn. Mae’r llys hwn yn caniatáu i’r Gweinyddwr canlynol weinyddu ystad DeadFN1 DeadFN2 DeadSN App1FN App1SN of / o PrimApp1 WelshReissue Road HP5 2PN The application has stated that the gross value of the estate in England and Wales amounts to £300,000 and the net value amounts to £290,000Mae'r cais yn nodi mai £300,000 yw gwerth gros yr ystad yn Nghymru a Lloegr, ac mai £290,000 yw'r gwerth net. DISTRICT REGISTRAR COFRESTRYDD DOSBARTH Extracted personallyWedi ei gyflwyno yn bersonolIf you wish to validate the information contained within this document please call 0300 303 0648Os ydych yn dymuno dilysu'r wybodaeth sydd yn y ddogfen hon, ffoniwch 0300 303 0654 +High Court of Justice England and WalesPrincipal Registry of the Family DivisionHMCTS ProbatePO Box 12625HarlowCM20 9QE0300 303 0648Uchel Lys Barn Cymru a LloegrPrif Gofrestrfa'r Adran DeuluProfiant GLITEFBlwch Post 12625HarlowCM20 9QE0300 303 0654Letters of Administration with willLlythyrau Gweinyddu gydag EwyllysAmended and re-issued pursuant to Registrar’s order dated 6th August 2021Wedi ei ddiwygio a’i ail gyhoeddi yn unol â Gorchymyn y Cofrestrydd 6 Awst 2021Case Reference: 1528365719154001Cyfeirnod yr Achos: 1528365719154001Date of Issue: 5th August 2021Dyddiad Cyhoeddi: 5 Awst 2021DeadFN1 DeadFN2 DeadSN of / o 1 WelshReissue Road HP5 2PNPresumed died on 4th April 2021 domiciled in England and WalesY tybir yn farw ar 4 Ebrill 2021 ac roedd â’i d/ddomisil Nghymru a Lloegr The Last Will and Testament of DeadFN1 DeadFN2 DeadSN (An official copy of which is available from the Court) was proved and registered before the High Court of Justice. The Administration of DeadFN1 DeadFN2 DeadSN's estate is granted by this court to the following AdministratorMae Ewyllys a Thestament olaf DeadFN1 DeadFN2 DeadSN (Mae copi swyddogol ohoni ar gael gan y Llys) wedi'i phrofi a'i chofrestru gerbron yr Uchel Lys Barn. Mae’r llys hwn yn caniatáu i’r Gweinyddwr canlynol weinyddu ystad DeadFN1 DeadFN2 DeadSN App1FN App1SN of / o PrimApp1 WelshReissue Road HP5 2PN The application has stated that the gross value of the estate in England and Wales amounts to £300,000 and the net value amounts to £290,000Mae'r cais yn nodi mai £300,000 yw gwerth gros yr ystad yn Nghymru a Lloegr, ac mai £290,000 yw'r gwerth net. DISTRICT REGISTRAR COFRESTRYDD DOSBARTH Extracted personallyWedi ei gyflwyno yn bersonolIf you wish to validate the information contained within this document please call 0300 303 0648Os ydych yn dymuno dilysu'r wybodaeth sydd yn y ddogfen hon, ffoniwch 0300 303 0654 diff --git a/src/functionalTest/resources/json/personalPayloadGrantAdColligendaWelsh.json b/src/functionalTest/resources/json/personalPayloadGrantAdColligendaWelsh.json new file mode 100644 index 0000000000..3a0dd54959 --- /dev/null +++ b/src/functionalTest/resources/json/personalPayloadGrantAdColligendaWelsh.json @@ -0,0 +1,134 @@ +{ + "case_details": { + "id": 1528365719154001, + "jurisdiction": "PROBATE", + "state": "CaseCreated", + "case_type_id": "GrantOfRepresentation", + "created_date": [ + 2021, + 1, + 8, + 10, + 11, + 59, + 151000000 + ], + "last_modified": [ + 2021, + 2, + 8, + 10, + 11, + 59, + 151000000 + ], + "security_classification": "PUBLIC", + "case_data": { + "caseType": "adColligendaBona", + "taskList": "
\n

1. Enter application details

\n

These steps are to be completed by the probate practitioner.

 
\n
\n\n

Add solicitor details

\"COMPLETED\"

\n
\n
\n\n

Add deceased details

\"COMPLETED\"

\n
\n
\n\n

Add application details

\"COMPLETED\"

\n
\n
\n\n
\n

2. Sign legal statement and submit application

\n

These steps are to be completed by the probate practitioner.

 
\n
\n\n

Review and sign legal statement and submit application

\"COMPLETED\"

\n
\n

Submitted on 01 Jan 2021

 
\n

The legal statement is generated. You can review, change any details, then sign and submit your application.

 
\n
\n\n

Send documents

\n \n \n View the documents needed by HM Courts and Tribunal Service\n \n \n
\n You now need to send us
  • the printed coversheet (accessed in the cover sheet tab) or your reference number 1628167430385788 written on a sheet of paper
  • a photocopy of the signed legal statement and declaration
  • the original will
\n
\n

\"COMPLETED\"

\n
\n
\n\n
\n

3. Review application

\n

These steps are completed by HM Courts and Tribunals Service staff. It can take a few weeks before the review starts.

 
\n
\n\n

Authenticate documents

\"COMPLETED\"

\n
\n

Authenticated on 05 Aug 2021

 
\n

We will authenticate your documents and match them with your application.

 
\n
\n\n

Examine application

\"IN

\n
\n

We review your application for incomplete information or problems and validate it against other cases or caveats. After the review we prepare the grant.

 
\n

Your application will update through any of these case states as it is reviewed by our team:

 
\n
    \n
  • Examining
  • \n
  • Case Matching
  • \n
  • Case selected for Quality Assurance
  • \n
  • Ready to issue
  • \n

\n\n

4. Grant of representation

\n

This step is completed by HM Courts and Tribunals Service staff.

 
\n
\n\n

Issue grant of representation

\n

The grant will be delivered in the post a few days after issuing.

 
\n
\n\n
\n
\n", + "paperForm": "No", + "willExists": "Yes", + "bulkPrintId": [], + "caseMatches": [], + "casePrinted": "Yes", + "ihtNetValue": "29000000", + "ihtGrossValue": "30000000", + "applicationType": "Personal", + "dateOfDeathType": "diedOn", + "deceasedAddress": { + "County": "", + "Country": "", + "PostCode": "HP5 2PN", + "PostTown": "", + "AddressLine1": "1 DecAddress Road", + "AddressLine2": "", + "AddressLine3": "" + }, + "deceasedSurname": "DeadSN", + "paragraphDetails": [], + "registryLocation": "Oxford", + "authenticatedDate": "2021-08-05", + "boSendToBulkPrint": "Yes", + "bulkScanEnvelopes": [], + "deceasedForenames": "DeadFN1 DeadFN2", + "executorsApplying": [ + { + "id": "38277f48-2e93-4d7b-8d9f-6f02a93b668d", + "value": { + "applyingExecutorName": "exec1FN exec1LN", + "applyingExecutorEmail": null, + "applyingExecutorAddress": { + "County": "", + "Country": "", + "PostCode": "HA1 4ET", + "PostTown": "", + "AddressLine1": "1 Exec1Address Road", + "AddressLine2": "", + "AddressLine3": "" + }, + "applyingExecutorLastName": null, + "applyingExecutorFirstName": null, + "applyingExecutorOtherNames": null, + "applyingExecutorOtherReason": null, + "applyingExecutorPhoneNumber": null, + "applyingExecutorOtherNamesReason": null + } + } + ], + "ihtReferenceNumber": "1234567890", + "deceasedDateOfBirth": "1999-07-07", + "deceasedDateOfDeath": "2021-07-07", + "otherExecutorExists": "Yes", + "executorsNotApplying": [], + "deceasedAnyOtherNames": "No", + "ihtFormCompletedOnline": "Yes", + "languagePreferenceWelsh": "Yes", + "primaryApplicantAddress": { + "County": "", + "Country": "", + "PostCode": "HP5 2PN", + "PostTown": "", + "AddressLine1": "1 PrimAppAddress Road", + "AddressLine2": "", + "AddressLine3": "" + }, + "primaryApplicantSurname": "App1SN", + "applicationSubmittedDate": "2021-01-01", + "primaryApplicantHasAlias": "No", + "primaryApplicantForenames": "App1FN", + "probateDocumentsGenerated": [], + "deceasedDomicileInEngWales": "Yes", + "primaryApplicantIsApplying": "Yes", + "solsDeceasedAliasNamesList": [], + "boCaveatStopSendToBulkPrint": "Yes", + "boRequestInfoSendToBulkPrint": "Yes", + "primaryApplicantEmailAddress": "welshGrant@probate-test.com", + "probateSotDocumentsGenerated": [], + "boCaveatStopEmailNotification": "Yes", + "boGrantReissueSendToBulkPrint": "Yes", + "probateNotificationsGenerated": [ + { + "id": "a2afa1b1-9c56-43b9-93f2-4b9e12e3e5d2", + "value": { + "DocumentLink": { + "document_url": "http://dm-store:8080/documents/6d386963-3504-4619-a77b-ad35a5cdd822", + "document_filename": "sentEmail.pdf", + "document_binary_url": "http://dm-store:8080/documents/6d386963-3504-4619-a77b-ad35a5cdd822/binary" + }, + "DocumentType": "sentEmail", + "DocumentFileName": "939ca551-713e-4b85-84ea-11c3b92a8341.pdf", + "DocumentDateAdded": "2021-08-05", + "DocumentGeneratedBy": "6621863c-8ee5-46b4-9ca5-6549342999f3" + } + } + ], + "boEmailGrantIssuedNotification": "No", + "boEmailRequestInfoNotification": "No", + "boAssembleLetterSendToBulkPrint": "Yes", + "boEmailDocsReceivedNotification": "No", + "boEmailGrantReissuedNotification": "No", + "boEmailDocsReceivedNotificationRequested": "No", + "grantAwaitingDocumentationNotificationDate": "2021-09-09" + } + } +} diff --git a/src/functionalTest/resources/json/solicitorPayloadNotificationsAdColligendaBona.json b/src/functionalTest/resources/json/solicitorPayloadNotificationsAdColligendaBona.json new file mode 100644 index 0000000000..465f0279e8 --- /dev/null +++ b/src/functionalTest/resources/json/solicitorPayloadNotificationsAdColligendaBona.json @@ -0,0 +1,122 @@ +{ + "case_details": { + "id": 1528365719153338, + "jurisdiction": "PROBATE", + "state": "CaseCreated", + "case_type_id": "GrantOfRepresentation", + "created_date": [ + 2018, + 6, + 7, + 10, + 1, + 59, + 151000000 + ], + "last_modified": [ + 2018, + 6, + 7, + 10, + 8, + 8, + 695000000 + ], + "case_data": { + "otherExecutorExists": "No", + "outsideUKGrantCopies": null, + "applicationType": "Solicitor", + "deceasedAddress": { + "County": "", + "Country": "", + "PostCode": "2", + "PostTown": "", + "AddressLine1": "1", + "AddressLine2": "", + "AddressLine3": "" + }, + "caseType": "adColligendaBona", + "boSendToBulkPrint": "No", + "deceasedAnyOtherNames": "No", + "solsFeeAccountNumber": "1234", + "willHasCodicils": "No", + "deceasedDateOfBirth": "1900-01-01", + "willAccessOriginal": null, + "willExists": "No", + "solsWillType": "NoWill", + "deceasedMaritalStatus": "neverMarried", + "solsApplicantRelationshipToDeceased": "Child", + "solsSpouseOrCivilRenouncing": "Yes", + "solsAdoptedEnglandOrWales": "Yes", + "solsMinorityInterest": "No", + "solsApplicantSiblings": "No", + "solsSolicitorFirmName": "Solicitor Firm Name", + "deceasedDateOfDeath": "2000-01-01", + "solsSOTNeedToUpdate": "No", + "primaryApplicantEmailAddress": "primary@probate-test.com", + "primaryApplicantForenames": "Executor name 1", + "primaryApplicantAddress": { + "County": "", + "Country": "", + "PostCode": "2", + "PostTown": "", + "AddressLine1": "1", + "AddressLine2": "", + "AddressLine3": "" + }, + "probateDocumentsGenerated": [ + { + "id": "161186cd-24ee-4e37-8793-b388ebc94443", + "value": { + "DocumentLink": { + "document_url": "http://localhost:8080/documents/b533ddf6-3695-45a8-8546-aab63ff16093", + "document_filename": "intestacyGrantDraft.pdf", + "document_binary_url": "http://localhost:8080/documents/b533ddf6-3695-45a8-8546-aab63ff16093/binary" + }, + "DocumentType": "intestacyGrantDraft", + "DocumentFileName": null, + "DocumentDateAdded": "2018-08-03", + "DocumentGeneratedBy": "30" + } + } + ], + "solsSolicitorEmail": "solicitor@probate-test.com", + "deceasedDomicileInEngWales": "Yes", + "ihtNetValue": "800000", + "boStopDetails": "stop details", + "deceasedSurname": "Deceased Last Name", + "solsLegalStatementDocument": { + "document_url": "http://localhost:8080/documents/e1f4f972-1514-4247-bdb1-964998ef3710", + "document_filename": "legalStatementIntestacy.pdf", + "document_binary_url": "http://localhost:8080/documents/e1f4f972-1514-4247-bdb1-964998ef3710/binary" + }, + "extraCopiesOfGrant": null, + "solsPaymentMethods": "fee account", + "solsSolicitorAddress": { + "AddressLine1": "SolAddLn1", + "AddressLine2": "SolAddLn2", + "AddressLine3": "SolAddLn3", + "PostTown": "SolAddPT", + "County": "SolAddCounty", + "PostCode": "KT10 0LA", + "Country": "SolAddCo" + }, + "deceasedForenames": "Deceased First Name", + "primaryApplicantIsApplying": "Yes", + "primaryApplicantHasAlias": "No", + "solsSOTName": "Solicitor_fn Solicitor_ln", + "solsSOTForenames": "Solicitor_fn", + "solsSOTSurname": "Solicitor_ln", + "solsSolicitorIsExec": "No", + "solsSolicitorIsMainApplicant": null, + "solsSolicitorIsApplying": null, + "solsSolicitorNotApplyingReason": null, + "ihtGrossValue": "1000000", + "ihtFormId": "IHT205", + "registryLocation": "Birmingham", + "primaryApplicantSurname": "Executor Last Name 1", + "solsSolicitorAppReference": "1231-3984-3949-0300", + "solsSOTJobTitle": "job title" + } + } +} diff --git a/src/integrationTest/java/uk/gov/hmcts/probate/controller/DocumentControllerIT.java b/src/integrationTest/java/uk/gov/hmcts/probate/controller/DocumentControllerIT.java index 54f3d694fd..1c0f857ad6 100644 --- a/src/integrationTest/java/uk/gov/hmcts/probate/controller/DocumentControllerIT.java +++ b/src/integrationTest/java/uk/gov/hmcts/probate/controller/DocumentControllerIT.java @@ -59,6 +59,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; @@ -167,6 +169,9 @@ public void setUp() throws NotificationClientException { when(pdfManagementService.generateAndUpload(any(CallbackRequest.class), eq(INTESTACY_GRANT))) .thenReturn(Document.builder().documentType(INTESTACY_GRANT).build()); + when(pdfManagementService.generateAndUpload(any(CallbackRequest.class), eq(AD_COLLIGENDA_BONA_GRANT))) + .thenReturn(Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT).build()); + when(pdfManagementService.generateAndUpload(any(CallbackRequest.class), eq(ADMON_WILL_GRANT_DRAFT))) .thenReturn(Document.builder().documentType(ADMON_WILL_GRANT_DRAFT).build()); @@ -438,6 +443,27 @@ void generateGrantDraftAdmonWill() throws Exception { .getDocument(any(CallbackRequest.class), eq(DocumentStatus.PREVIEW), eq(DocumentIssueType.GRANT)); } + @Test + void generateGrantDraftAdColligendaBona() throws Exception { + when(documentGeneratorService + .getDocument(any(CallbackRequest.class), eq(DocumentStatus.PREVIEW), eq(DocumentIssueType.GRANT))) + .thenReturn(Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT_DRAFT).build()); + + String solicitorPayload = testUtils + .getStringFromFile("solicitorPayloadNotificationsAdColligendaBona.json"); + + mockMvc.perform(post("/document/generate-grant-draft") + .content(solicitorPayload) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.data.probateDocumentsGenerated[1].value.DocumentType", + is(AD_COLLIGENDA_BONA_GRANT_DRAFT.getTemplateName()))) + .andReturn(); + + verify(documentGeneratorService) + .getDocument(any(CallbackRequest.class), eq(DocumentStatus.PREVIEW), eq(DocumentIssueType.GRANT)); + } + @Test void generateGrantAdmonWill() throws Exception { when(documentGeneratorService @@ -480,6 +506,27 @@ void generateGrantIntestacy() throws Exception { .getDocument(any(CallbackRequest.class), eq(DocumentStatus.FINAL), eq(DocumentIssueType.GRANT)); } + @Test + void generateGrantAdColligendaBona() throws Exception { + when(documentGeneratorService + .getDocument(any(CallbackRequest.class), eq(DocumentStatus.FINAL), eq(DocumentIssueType.GRANT))) + .thenReturn(Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT).build()); + + String solicitorPayload = testUtils + .getStringFromFile("solicitorPayloadNotificationsAdColligendaBona.json"); + + mockMvc.perform(post("/document/generate-grant") + .content(solicitorPayload) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.data.probateDocumentsGenerated[1].value.DocumentType", + is(AD_COLLIGENDA_BONA_GRANT.getTemplateName()))) + .andReturn(); + + verify(documentGeneratorService) + .getDocument(any(CallbackRequest.class), eq(DocumentStatus.FINAL), eq(DocumentIssueType.GRANT)); + } + @Test void shouldNotGenerateGrantDraftEdgeCase() throws Exception { when(documentGeneratorService diff --git a/src/integrationTest/java/uk/gov/hmcts/probate/service/docmosis/DocumentTemplateServiceIT.java b/src/integrationTest/java/uk/gov/hmcts/probate/service/docmosis/DocumentTemplateServiceIT.java index ba58f807c4..18b2cc868d 100644 --- a/src/integrationTest/java/uk/gov/hmcts/probate/service/docmosis/DocumentTemplateServiceIT.java +++ b/src/integrationTest/java/uk/gov/hmcts/probate/service/docmosis/DocumentTemplateServiceIT.java @@ -13,11 +13,11 @@ import uk.gov.hmcts.probate.model.DocumentType; import uk.gov.hmcts.probate.model.LanguagePreference; import uk.gov.hmcts.probate.service.CaveatQueryService; -import uk.gov.hmcts.probate.service.docmosis.DocumentTemplateService; import uk.gov.hmcts.probate.service.template.pdf.PDFManagementService; import uk.gov.hmcts.reform.ccd.client.CoreCaseDataApi; import uk.gov.service.notify.SendEmailResponse; +import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -174,4 +174,66 @@ void shouldGetAdmonWillTemplate() { assertEquals(DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT, responseReissueWelshDraft); } + + @Test + void shouldGetAdColligendaBonaTemplate() { + assertAll("AdColligendaBonaTemplate", + () -> { + DocumentType responseEnglish = documentTemplateService + .getTemplateId(LanguagePreference.ENGLISH, DocumentStatus.FINAL, DocumentIssueType.GRANT, + DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.AD_COLLIGENDA_BONA_GRANT, responseEnglish, + "Expected AD_COLLIGENDA_BONA_GRANT for English FINAL GRANT"); + }, + () -> { + DocumentType responseEnglishDraft = documentTemplateService + .getTemplateId(LanguagePreference.ENGLISH, DocumentStatus.PREVIEW, DocumentIssueType.GRANT, + DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT, responseEnglishDraft, + "Expected AD_COLLIGENDA_BONA_GRANT_DRAFT for English PREVIEW GRANT"); + }, + () -> { + DocumentType response = documentTemplateService + .getTemplateId(LanguagePreference.ENGLISH, DocumentStatus.FINAL, DocumentIssueType.REISSUE, + DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE, response, + "Expected AD_COLLIGENDA_BONA_GRANT_REISSUE for English FINAL REISSUE"); + }, + () -> { + DocumentType responseWelsh = documentTemplateService + .getTemplateId(LanguagePreference.WELSH, DocumentStatus.FINAL, DocumentIssueType.GRANT, + DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT, responseWelsh, + "Expected WELSH_AD_COLLIGENDA_BONA_GRANT for Welsh FINAL GRANT"); + }, + () -> { + DocumentType responseDraft = documentTemplateService + .getTemplateId(LanguagePreference.ENGLISH, DocumentStatus.PREVIEW, DocumentIssueType + .REISSUE, DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT, responseDraft, + "Expected AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT for English PREVIEW REISSUE"); + }, + () -> { + DocumentType responseDraftWelsh = documentTemplateService + .getTemplateId(LanguagePreference.WELSH, DocumentStatus.PREVIEW, DocumentIssueType.GRANT, + DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT, responseDraftWelsh, + "Expected WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT for Welsh PREVIEW GRANT"); + }, + () -> { + DocumentType responseReissueWelsh = documentTemplateService + .getTemplateId(LanguagePreference.WELSH, DocumentStatus.FINAL, DocumentIssueType.REISSUE, + DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE, responseReissueWelsh, + "Expected WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE for Welsh FINAL REISSUE"); + }, + () -> { + DocumentType responseReissueWelshDraft = documentTemplateService + .getTemplateId(LanguagePreference.WELSH, DocumentStatus.PREVIEW, DocumentIssueType.REISSUE, + DocumentCaseType.AD_COLLIGENDA_BONA); + assertEquals(DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT, responseReissueWelshDraft, + "Expected WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT for Welsh PREVIEW REISSUE"); + } + ); + } } diff --git a/src/integrationTest/resources/application.yml b/src/integrationTest/resources/application.yml index 0ca3226658..cae8b7f0d8 100644 --- a/src/integrationTest/resources/application.yml +++ b/src/integrationTest/resources/application.yml @@ -240,38 +240,46 @@ documents: intestacy: INTESTACY_GRANT_REISSUE admonWill: ADMON_WILL_GRANT_REISSUE gop: DIGITAL_GRANT_REISSUE + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_REISSUE grant: intestacy: INTESTACY_GRANT admonWill: ADMON_WILL_GRANT gop: DIGITAL_GRANT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT preview: reissue: intestacy: INTESTACY_GRANT_REISSUE_DRAFT admonWill: ADMON_WILL_GRANT_REISSUE_DRAFT gop: DIGITAL_GRANT_REISSUE_DRAFT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT grant: intestacy: INTESTACY_GRANT_DRAFT admonWill: ADMON_WILL_GRANT_DRAFT gop: DIGITAL_GRANT_DRAFT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_DRAFT welsh: final: reissue: intestacy: WELSH_INTESTACY_GRANT_REISSUE admonWill: WELSH_ADMON_WILL_GRANT_REISSUE gop: WELSH_DIGITAL_GRANT_REISSUE + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE grant: intestacy: WELSH_INTESTACY_GRANT admonWill: WELSH_ADMON_WILL_GRANT gop: WELSH_DIGITAL_GRANT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT preview: reissue: intestacy: WELSH_INTESTACY_GRANT_REISSUE_DRAFT admonWill: WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT gop: WELSH_DIGITAL_GRANT_REISSUE_DRAFT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT grant: intestacy: WELSH_INTESTACY_GRANT_DRAFT admonWill: WELSH_ADMON_WILL_GRANT_DRAFT gop: WELSH_DIGITAL_GRANT_DRAFT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT registry: registries: diff --git a/src/main/java/uk/gov/hmcts/probate/controller/BusinessValidationController.java b/src/main/java/uk/gov/hmcts/probate/controller/BusinessValidationController.java index c691e866b0..c0ea8fc68c 100644 --- a/src/main/java/uk/gov/hmcts/probate/controller/BusinessValidationController.java +++ b/src/main/java/uk/gov/hmcts/probate/controller/BusinessValidationController.java @@ -45,6 +45,7 @@ import uk.gov.hmcts.probate.transformer.CallbackResponseTransformer; import uk.gov.hmcts.probate.transformer.CaseDataTransformer; import uk.gov.hmcts.probate.transformer.HandOffLegacyTransformer; +import uk.gov.hmcts.probate.validator.AdColligendaBonaCaseTypeValidationRule; import uk.gov.hmcts.probate.validator.CaseworkerAmendAndCreateValidationRule; import uk.gov.hmcts.probate.validator.CaseworkersSolicitorPostcodeValidationRule; import uk.gov.hmcts.probate.validator.ChangeToSameStateValidationRule; @@ -124,6 +125,7 @@ public class BusinessValidationController { private final HandOffLegacyTransformer handOffLegacyTransformer; private final RegistrarDirectionService registrarDirectionService; private final Pre1900DOBValidationRule pre1900DOBValidationRule; + private final AdColligendaBonaCaseTypeValidationRule adColligendaBonaCaseTypeValidationRule; private final BusinessValidationMessageService businessValidationMessageService; private final UserInfoService userInfoService; @@ -564,6 +566,7 @@ public ResponseEntity paperFormCaseDetails( caseDataTransformer.transformCaseDataForPaperForm(callbackRequest); handOffLegacyTransformer.setHandOffToLegacySiteYes(callbackRequest); validateForPayloadErrors(callbackRequest, bindingResult); + adColligendaBonaCaseTypeValidationRule.validate(callbackRequest.getCaseDetails()); numberOfApplyingExecutorsValidationRule.validate(callbackRequest.getCaseDetails()); Document document = null; diff --git a/src/main/java/uk/gov/hmcts/probate/model/DocumentCaseType.java b/src/main/java/uk/gov/hmcts/probate/model/DocumentCaseType.java index 953c163e8d..958ea03757 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/DocumentCaseType.java +++ b/src/main/java/uk/gov/hmcts/probate/model/DocumentCaseType.java @@ -11,7 +11,9 @@ public enum DocumentCaseType { @JsonProperty("admonWill") ADMON_WILL("admonWill"), @JsonProperty("gop") - GOP("gop"); + GOP("gop"), + @JsonProperty("adColligendaBona") + AD_COLLIGENDA_BONA("adColligendaBona"); private final String caseType; diff --git a/src/main/java/uk/gov/hmcts/probate/model/DocumentType.java b/src/main/java/uk/gov/hmcts/probate/model/DocumentType.java index 4dabf9395b..2a9e8734b9 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/DocumentType.java +++ b/src/main/java/uk/gov/hmcts/probate/model/DocumentType.java @@ -56,6 +56,12 @@ public enum DocumentType { @JsonProperty("admonWillGrantDraft") ADMON_WILL_GRANT_DRAFT("admonWillGrantDraft"), + @JsonProperty("adColligendaBonaGrant") + AD_COLLIGENDA_BONA_GRANT("adColligendaBonaGrant"), + + @JsonProperty("adColligendaBonaGrantDraft") + AD_COLLIGENDA_BONA_GRANT_DRAFT("adColligendaBonaGrantDraft"), + @JsonProperty("sentEmail") SENT_EMAIL("sentEmail"), @@ -119,6 +125,9 @@ public enum DocumentType { @JsonProperty("admonWillGrantReissueDraft") ADMON_WILL_GRANT_REISSUE_DRAFT("admonWillGrantReissueDraft"), + @JsonProperty("adColligendaBonaGrantReissueDraft") + AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT("adColligendaBonaGrantReissueDraft"), + @JsonProperty("digitalGrantReissue") DIGITAL_GRANT_REISSUE("digitalGrantReissue"), @@ -128,6 +137,9 @@ public enum DocumentType { @JsonProperty("admonWillGrantReissue") ADMON_WILL_GRANT_REISSUE("admonWillGrantReissue"), + @JsonProperty("adColligendaBonaGrantReissue") + AD_COLLIGENDA_BONA_GRANT_REISSUE("adColligendaBonaGrantReissue"), + @JsonProperty("sotInformationRequest") SOT_INFORMATION_REQUEST("sotInformationRequest"), @@ -161,6 +173,12 @@ public enum DocumentType { @JsonProperty("welshIntestacyGrant") WELSH_INTESTACY_GRANT("welshIntestacyGrant"), + @JsonProperty("welshAdColligendaBonaGrantDraft") + WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT("welshAdColligendaBonaGrantDraft"), + + @JsonProperty("welshAdColligendaBonaGrant") + WELSH_AD_COLLIGENDA_BONA_GRANT("welshAdColligendaBonaGrant"), + @JsonProperty("welshDigitalGrantReissueDraft") WELSH_DIGITAL_GRANT_REISSUE_DRAFT("welshDigitalGrantReissueDraft"), @@ -170,6 +188,9 @@ public enum DocumentType { @JsonProperty("welshAdmonWillGrantReissueDraft") WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT("welshAdmonWillGrantReissueDraft"), + @JsonProperty("welshAdColligendaBonaGrantReissueDraft") + WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT("welshAdColligendaBonaGrantReissueDraft"), + @JsonProperty("welshDigitalGrantReissue") WELSH_DIGITAL_GRANT_REISSUE("welshDigitalGrantReissue"), @@ -177,7 +198,10 @@ public enum DocumentType { WELSH_INTESTACY_GRANT_REISSUE("welshIntestacyGrantReissue"), @JsonProperty("welshAdmonWillGrantReissue") - WELSH_ADMON_WILL_GRANT_REISSUE("welshAdmonWillGrantReissue"); + WELSH_ADMON_WILL_GRANT_REISSUE("welshAdmonWillGrantReissue"), + + @JsonProperty("welshAdColligendaBonaGrantReissue") + WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE("welshAdColligendaBonaGrantReissue"); private final String templateName; diff --git a/src/main/java/uk/gov/hmcts/probate/service/BulkPrintService.java b/src/main/java/uk/gov/hmcts/probate/service/BulkPrintService.java index d5daf65eac..95b63afd9e 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/BulkPrintService.java +++ b/src/main/java/uk/gov/hmcts/probate/service/BulkPrintService.java @@ -6,6 +6,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.client.HttpClientErrorException; import uk.gov.hmcts.probate.exception.BulkPrintException; +import uk.gov.hmcts.probate.model.DocumentType; import uk.gov.hmcts.probate.model.ccd.caveat.request.CaveatCallbackRequest; import uk.gov.hmcts.probate.model.ccd.raw.Document; import uk.gov.hmcts.probate.model.ccd.raw.request.CallbackRequest; @@ -26,14 +27,19 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; @@ -203,19 +209,20 @@ private List arrangePdfDoc List documents = new LinkedList<>(); String encodedCoverSheet = getPdfAsBase64EncodedString(coverSheetDocument, callbackRequest); String encodedGrantDocument = getPdfAsBase64EncodedString(grantDocument, callbackRequest); - - if (documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), DIGITAL_GRANT) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), ADMON_WILL_GRANT) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), INTESTACY_GRANT) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), WELSH_DIGITAL_GRANT) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), WELSH_INTESTACY_GRANT) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), WELSH_ADMON_WILL_GRANT) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), INTESTACY_GRANT_REISSUE) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), ADMON_WILL_GRANT_REISSUE) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), DIGITAL_GRANT_REISSUE) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), WELSH_DIGITAL_GRANT_REISSUE) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), WELSH_ADMON_WILL_GRANT_REISSUE) - || documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), WELSH_INTESTACY_GRANT_REISSUE)) { + Set documentTypes = Set.of( + DIGITAL_GRANT, ADMON_WILL_GRANT, INTESTACY_GRANT, AD_COLLIGENDA_BONA_GRANT, + WELSH_DIGITAL_GRANT, WELSH_INTESTACY_GRANT, WELSH_ADMON_WILL_GRANT, + WELSH_AD_COLLIGENDA_BONA_GRANT, INTESTACY_GRANT_REISSUE, ADMON_WILL_GRANT_REISSUE, + DIGITAL_GRANT_REISSUE, AD_COLLIGENDA_BONA_GRANT_REISSUE, WELSH_DIGITAL_GRANT_REISSUE, + WELSH_ADMON_WILL_GRANT_REISSUE, WELSH_INTESTACY_GRANT_REISSUE, + WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE + ); + + boolean hasDocumentType = documentTypes.stream() + .anyMatch(documentType -> documentTransformer.hasDocumentWithType(Arrays.asList(grantDocument), + documentType)); + + if (hasDocumentType) { extraCopies = addAdditionalCopiesForGrants(callbackRequest); } diff --git a/src/main/java/uk/gov/hmcts/probate/service/DocumentGeneratorService.java b/src/main/java/uk/gov/hmcts/probate/service/DocumentGeneratorService.java index 6fe0930928..9d4a6c5809 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/DocumentGeneratorService.java +++ b/src/main/java/uk/gov/hmcts/probate/service/DocumentGeneratorService.java @@ -38,6 +38,8 @@ import static java.util.Collections.emptyList; import static java.util.Optional.ofNullable; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT_DRAFT; @@ -48,6 +50,8 @@ import static uk.gov.hmcts.probate.model.DocumentType.LEGAL_STATEMENT_INTESTACY; import static uk.gov.hmcts.probate.model.DocumentType.LEGAL_STATEMENT_PROBATE; import static uk.gov.hmcts.probate.model.DocumentType.LEGAL_STATEMENT_PROBATE_TRUST_CORPS; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT_DRAFT; @@ -233,11 +237,11 @@ private Document generateSolicitorSoT(CallbackRequest callbackRequest) { private void expireDrafts(CallbackRequest callbackRequest) { log.info("Expiring drafts"); DocumentType[] documentTypes = {DIGITAL_GRANT_DRAFT, INTESTACY_GRANT_DRAFT, ADMON_WILL_GRANT_DRAFT, - DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT_REISSUE_DRAFT, - ADMON_WILL_GRANT_REISSUE_DRAFT, WELSH_DIGITAL_GRANT_DRAFT, WELSH_ADMON_WILL_GRANT_DRAFT, - WELSH_INTESTACY_GRANT_DRAFT, + AD_COLLIGENDA_BONA_GRANT_DRAFT, DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT_REISSUE_DRAFT, + ADMON_WILL_GRANT_REISSUE_DRAFT, AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT, WELSH_DIGITAL_GRANT_DRAFT, + WELSH_ADMON_WILL_GRANT_DRAFT, WELSH_INTESTACY_GRANT_DRAFT, WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT, WELSH_DIGITAL_GRANT_REISSUE_DRAFT, WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT, - WELSH_INTESTACY_GRANT_REISSUE_DRAFT}; + WELSH_INTESTACY_GRANT_REISSUE_DRAFT, WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT}; for (DocumentType documentType : documentTypes) { documentService.expire(callbackRequest, documentType); } diff --git a/src/main/java/uk/gov/hmcts/probate/service/notification/SmeeAndFordPersonalisationService.java b/src/main/java/uk/gov/hmcts/probate/service/notification/SmeeAndFordPersonalisationService.java index b6f3dbd555..c035e78c99 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/notification/SmeeAndFordPersonalisationService.java +++ b/src/main/java/uk/gov/hmcts/probate/service/notification/SmeeAndFordPersonalisationService.java @@ -31,10 +31,12 @@ import static uk.gov.hmcts.probate.model.Constants.DOC_SUBTYPE_WILL; import static uk.gov.hmcts.probate.model.Constants.DOC_TYPE_OTHER; import static uk.gov.hmcts.probate.model.Constants.YES; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT; @@ -51,7 +53,8 @@ public class SmeeAndFordPersonalisationService { private static final String SPACE = " "; private static final String COMMA = ","; private static final DocumentType[] GRANT_TYPES = {DIGITAL_GRANT, ADMON_WILL_GRANT, INTESTACY_GRANT, - WELSH_DIGITAL_GRANT, WELSH_ADMON_WILL_GRANT, WELSH_INTESTACY_GRANT}; + WELSH_DIGITAL_GRANT, WELSH_ADMON_WILL_GRANT, WELSH_INTESTACY_GRANT, AD_COLLIGENDA_BONA_GRANT, + WELSH_AD_COLLIGENDA_BONA_GRANT}; private static final String SUBJECT = "Smee And Ford Data extract from :fromDate to :toDate"; private static final String HEADER_ROW_FILE = "templates/dataExtracts/SmeeAndFordHeaderRow.csv"; private static final String APPLICATION_TYPE_PERSONAL = "Personally"; diff --git a/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorService.java b/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorService.java index 97f30f2a5e..75d1f838b1 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorService.java +++ b/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorService.java @@ -20,6 +20,8 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; @@ -97,6 +99,8 @@ private String addExtraCaseData(String dataJson, Object data, DocumentType docum || documentType.equals(INTESTACY_GRANT_DRAFT) || documentType.equals(ADMON_WILL_GRANT) || documentType.equals(ADMON_WILL_GRANT_DRAFT) + || documentType.equals(AD_COLLIGENDA_BONA_GRANT) + || documentType.equals(AD_COLLIGENDA_BONA_GRANT_DRAFT) ) { CaseData caseData = ((CallbackRequest) data).getCaseDetails().getData(); updatedJson = removePenceDecorator.decorate(caseData, documentType); diff --git a/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementService.java b/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementService.java index 4c8d0f84bb..0c24379910 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementService.java +++ b/src/main/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementService.java @@ -75,6 +75,11 @@ public Document generateAndUpload(CallbackRequest callbackRequest, DocumentType .setGrantSignatureBase64(decryptedFileAsBase64String(pdfServiceConfiguration .getGrantSignatureEncryptedFile())); break; + case AD_COLLIGENDA_BONA_GRANT: + callbackRequest.getCaseDetails() + .setGrantSignatureBase64(decryptedFileAsBase64String(pdfServiceConfiguration + .getGrantSignatureEncryptedFile())); + break; default: break; } diff --git a/src/main/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecorator.java b/src/main/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecorator.java index 6c2e2b6f22..ee8e83e931 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecorator.java +++ b/src/main/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecorator.java @@ -11,6 +11,8 @@ import static uk.gov.hmcts.probate.model.Constants.FORMAT; import static uk.gov.hmcts.probate.model.Constants.DIVISOR; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; @@ -44,6 +46,7 @@ private String truncateValue(BigDecimal value, DocumentType documentType) { private static Stream grantDocumentTypeStream() { return Stream.of(ADMON_WILL_GRANT, ADMON_WILL_GRANT_DRAFT, DIGITAL_GRANT, DIGITAL_GRANT_DRAFT, - DIGITAL_GRANT_REISSUE, DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT, INTESTACY_GRANT_DRAFT); + DIGITAL_GRANT_REISSUE, DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT, INTESTACY_GRANT_DRAFT, + AD_COLLIGENDA_BONA_GRANT, AD_COLLIGENDA_BONA_GRANT_DRAFT); } } diff --git a/src/main/java/uk/gov/hmcts/probate/service/zip/ZipFileService.java b/src/main/java/uk/gov/hmcts/probate/service/zip/ZipFileService.java index 291b22ab0d..bbbe106dbf 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/zip/ZipFileService.java +++ b/src/main/java/uk/gov/hmcts/probate/service/zip/ZipFileService.java @@ -31,9 +31,13 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT; @@ -62,10 +66,11 @@ public class ZipFileService { private static final String DELIMITER = "|"; private static final String NEW_LINE = "\n"; private static final DocumentType[] GRANT_TYPES = {DIGITAL_GRANT, ADMON_WILL_GRANT, INTESTACY_GRANT, - WELSH_DIGITAL_GRANT, WELSH_ADMON_WILL_GRANT, WELSH_INTESTACY_GRANT}; + AD_COLLIGENDA_BONA_GRANT, WELSH_DIGITAL_GRANT, WELSH_ADMON_WILL_GRANT, WELSH_INTESTACY_GRANT, + WELSH_AD_COLLIGENDA_BONA_GRANT}; private static final DocumentType[] REISSUE_GRANT_TYPES = {DIGITAL_GRANT_REISSUE, INTESTACY_GRANT_REISSUE, - ADMON_WILL_GRANT_REISSUE, WELSH_DIGITAL_GRANT_REISSUE, WELSH_INTESTACY_GRANT_REISSUE, - WELSH_ADMON_WILL_GRANT_REISSUE}; + ADMON_WILL_GRANT_REISSUE, AD_COLLIGENDA_BONA_GRANT_REISSUE, WELSH_DIGITAL_GRANT_REISSUE, + WELSH_INTESTACY_GRANT_REISSUE, WELSH_ADMON_WILL_GRANT_REISSUE, WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE}; private static final String HEADER_ROW_FILE = "templates/dataExtracts/ManifestFileHeaderRow.csv"; public void generateZipFile(List cases, File tempFile, String fromDate) { diff --git a/src/main/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformer.java b/src/main/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformer.java index 46226f28e5..379e9def4f 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformer.java @@ -76,6 +76,8 @@ import static uk.gov.hmcts.probate.model.Constants.NO; import static uk.gov.hmcts.probate.model.Constants.YES; import static uk.gov.hmcts.probate.model.Constants.CHANNEL_CHOICE_DIGITAL; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.ASSEMBLED_LETTER; @@ -92,6 +94,8 @@ import static uk.gov.hmcts.probate.model.DocumentType.LEGAL_STATEMENT_PROBATE_TRUST_CORPS; import static uk.gov.hmcts.probate.model.DocumentType.SENT_EMAIL; import static uk.gov.hmcts.probate.model.DocumentType.STATEMENT_OF_TRUTH; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; @@ -391,9 +395,11 @@ public CallbackResponse addDocuments(CallbackRequest callbackRequest, List bulkPrint = buildBulkPrint(letterId, templateName); @@ -477,9 +486,11 @@ public CallbackResponse addBulkPrintInformationForReprint(CallbackRequest callba if (documentTransformer.hasDocumentWithType(documents, DIGITAL_GRANT) || documentTransformer.hasDocumentWithType(documents, ADMON_WILL_GRANT) || documentTransformer.hasDocumentWithType(documents, INTESTACY_GRANT) + || documentTransformer.hasDocumentWithType(documents, AD_COLLIGENDA_BONA_GRANT) || documentTransformer.hasDocumentWithType(documents, WELSH_DIGITAL_GRANT) || documentTransformer.hasDocumentWithType(documents, WELSH_INTESTACY_GRANT) - || documentTransformer.hasDocumentWithType(documents, WELSH_ADMON_WILL_GRANT)) { + || documentTransformer.hasDocumentWithType(documents, WELSH_ADMON_WILL_GRANT) + || documentTransformer.hasDocumentWithType(documents, WELSH_AD_COLLIGENDA_BONA_GRANT)) { responseCaseDataBuilder .bulkPrintSendLetterId(letterId) @@ -488,16 +499,19 @@ public CallbackResponse addBulkPrintInformationForReprint(CallbackRequest callba if (documentTransformer.hasDocumentWithType(documents, DIGITAL_GRANT_REISSUE) || documentTransformer.hasDocumentWithType(documents, ADMON_WILL_GRANT_REISSUE) || documentTransformer.hasDocumentWithType(documents, INTESTACY_GRANT_REISSUE) + || documentTransformer.hasDocumentWithType(documents, AD_COLLIGENDA_BONA_GRANT_REISSUE) || documentTransformer.hasDocumentWithType(documents, WELSH_DIGITAL_GRANT_REISSUE) || documentTransformer.hasDocumentWithType(documents, WELSH_ADMON_WILL_GRANT_REISSUE) || documentTransformer.hasDocumentWithType(documents, WELSH_INTESTACY_GRANT_REISSUE) + || documentTransformer.hasDocumentWithType(documents, WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE) || documentTransformer.hasDocumentWithType(documents, STATEMENT_OF_TRUTH) || documentTransformer.hasDocumentWithType(documents, WELSH_STATEMENT_OF_TRUTH) || documentTransformer.hasDocumentWithType(documents, DocumentType.OTHER)) { if (letterId != null) { var documentTypes = new DocumentType[] { DIGITAL_GRANT_REISSUE, ADMON_WILL_GRANT_REISSUE, INTESTACY_GRANT_REISSUE, - WELSH_DIGITAL_GRANT_REISSUE, WELSH_ADMON_WILL_GRANT_REISSUE, WELSH_INTESTACY_GRANT_REISSUE, + AD_COLLIGENDA_BONA_GRANT_REISSUE, WELSH_DIGITAL_GRANT_REISSUE, WELSH_ADMON_WILL_GRANT_REISSUE, + WELSH_INTESTACY_GRANT_REISSUE, WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE, STATEMENT_OF_TRUTH, WELSH_STATEMENT_OF_TRUTH, DocumentType.OTHER }; String templateName = getTemplateName(documents, documentTypes); diff --git a/src/main/java/uk/gov/hmcts/probate/transformer/DocumentTransformer.java b/src/main/java/uk/gov/hmcts/probate/transformer/DocumentTransformer.java index 4a84b4889d..9d39751d42 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/DocumentTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/DocumentTransformer.java @@ -9,13 +9,65 @@ import uk.gov.hmcts.probate.model.ccd.raw.request.CallbackRequest; import uk.gov.hmcts.probate.model.ccd.willlodgement.request.WillLodgementCallbackRequest; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.SOT_INFORMATION_REQUEST; +import static uk.gov.hmcts.probate.model.DocumentType.GRANT_COVER; +import static uk.gov.hmcts.probate.model.DocumentType.ASSEMBLED_LETTER; +import static uk.gov.hmcts.probate.model.DocumentType.BLANK_LETTER; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WILL_LODGEMENT_DEPOSIT_RECEIPT; @Slf4j @Component public class DocumentTransformer { + private static final Set COMMON_DOCUMENT_TYPES = new HashSet<>(Set.of( + DIGITAL_GRANT_DRAFT, DIGITAL_GRANT, DIGITAL_GRANT_REISSUE_DRAFT, DIGITAL_GRANT_REISSUE, + WELSH_DIGITAL_GRANT_REISSUE_DRAFT, WELSH_DIGITAL_GRANT_REISSUE, INTESTACY_GRANT_DRAFT, + INTESTACY_GRANT, INTESTACY_GRANT_REISSUE_DRAFT, INTESTACY_GRANT_REISSUE, + WELSH_INTESTACY_GRANT_REISSUE_DRAFT, WELSH_INTESTACY_GRANT_REISSUE, ADMON_WILL_GRANT_DRAFT, + ADMON_WILL_GRANT, ADMON_WILL_GRANT_REISSUE_DRAFT, ADMON_WILL_GRANT_REISSUE, + WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT, WELSH_ADMON_WILL_GRANT_REISSUE, + AD_COLLIGENDA_BONA_GRANT_DRAFT, AD_COLLIGENDA_BONA_GRANT, AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT, + AD_COLLIGENDA_BONA_GRANT_REISSUE, WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT, + WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE, SOT_INFORMATION_REQUEST, GRANT_COVER, ASSEMBLED_LETTER, + BLANK_LETTER, WELSH_DIGITAL_GRANT_DRAFT, WELSH_DIGITAL_GRANT, WELSH_ADMON_WILL_GRANT_DRAFT, + WELSH_ADMON_WILL_GRANT, WELSH_INTESTACY_GRANT_DRAFT, WELSH_INTESTACY_GRANT, + WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT, WELSH_AD_COLLIGENDA_BONA_GRANT + )); public boolean hasDocumentWithType(List documents, DocumentType documentType) { return documents.stream() @@ -24,65 +76,33 @@ public boolean hasDocumentWithType(List documents, DocumentType docume } public void addDocument(CallbackRequest callbackRequest, Document document, Boolean coversheetNotification) { - switch (document.getDocumentType()) { - case DIGITAL_GRANT_DRAFT: - case DIGITAL_GRANT: - case DIGITAL_GRANT_REISSUE_DRAFT: - case DIGITAL_GRANT_REISSUE: - case WELSH_DIGITAL_GRANT_REISSUE_DRAFT: - case WELSH_DIGITAL_GRANT_REISSUE: - case INTESTACY_GRANT_DRAFT: - case INTESTACY_GRANT: - case INTESTACY_GRANT_REISSUE_DRAFT: - case INTESTACY_GRANT_REISSUE: - case WELSH_INTESTACY_GRANT_REISSUE_DRAFT: - case WELSH_INTESTACY_GRANT_REISSUE: - case ADMON_WILL_GRANT_DRAFT: - case ADMON_WILL_GRANT: - case ADMON_WILL_GRANT_REISSUE_DRAFT: - case ADMON_WILL_GRANT_REISSUE: - case WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT: - case WELSH_ADMON_WILL_GRANT_REISSUE: - case SOT_INFORMATION_REQUEST: - case GRANT_COVER: - case ASSEMBLED_LETTER: - case BLANK_LETTER: - case WELSH_DIGITAL_GRANT_DRAFT: - case WELSH_DIGITAL_GRANT: - case WELSH_ADMON_WILL_GRANT_DRAFT: - case WELSH_ADMON_WILL_GRANT: - case WELSH_INTESTACY_GRANT_DRAFT: - case WELSH_INTESTACY_GRANT: - callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated() - .add(new CollectionMember<>(null, document)); - break; - case STATEMENT_OF_TRUTH: - case WELSH_STATEMENT_OF_TRUTH: - case LEGAL_STATEMENT_PROBATE: - case LEGAL_STATEMENT_PROBATE_TRUST_CORPS: - case LEGAL_STATEMENT_INTESTACY: - case LEGAL_STATEMENT_ADMON: - callbackRequest.getCaseDetails().getData().getProbateSotDocumentsGenerated() - .add(new CollectionMember<>(null, document)); - break; - case SENT_EMAIL: - case GRANT_RAISED: - case CAVEAT_STOPPED: - callbackRequest.getCaseDetails().getData().getProbateNotificationsGenerated() - .add(new CollectionMember<>(null, document)); - break; - case GRANT_COVERSHEET: - if (coversheetNotification) { - callbackRequest.getCaseDetails().getData().getProbateNotificationsGenerated() + if (COMMON_DOCUMENT_TYPES.contains(document.getDocumentType())) { + callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated() + .add(new CollectionMember<>(null, document)); + } else { + switch (document.getDocumentType()) { + case STATEMENT_OF_TRUTH, WELSH_STATEMENT_OF_TRUTH, LEGAL_STATEMENT_PROBATE, + LEGAL_STATEMENT_PROBATE_TRUST_CORPS, LEGAL_STATEMENT_INTESTACY, LEGAL_STATEMENT_ADMON: + callbackRequest.getCaseDetails().getData().getProbateSotDocumentsGenerated() .add(new CollectionMember<>(null, document)); - } else { - callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated() + break; + case SENT_EMAIL, GRANT_RAISED, CAVEAT_STOPPED: + callbackRequest.getCaseDetails().getData().getProbateNotificationsGenerated() .add(new CollectionMember<>(null, document)); - } - break; - case EDGE_CASE: - break; - default: + break; + case GRANT_COVERSHEET: + if (coversheetNotification) { + callbackRequest.getCaseDetails().getData().getProbateNotificationsGenerated() + .add(new CollectionMember<>(null, document)); + } else { + callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated() + .add(new CollectionMember<>(null, document)); + } + break; + case EDGE_CASE: + break; + default: + } } } diff --git a/src/main/java/uk/gov/hmcts/probate/transformer/ReprintTransformer.java b/src/main/java/uk/gov/hmcts/probate/transformer/ReprintTransformer.java index aa0a799956..616ac086d0 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/ReprintTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/ReprintTransformer.java @@ -3,6 +3,7 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import uk.gov.hmcts.probate.model.DocumentType; import uk.gov.hmcts.probate.model.ccd.raw.Document; import uk.gov.hmcts.probate.model.ccd.raw.DynamicList; import uk.gov.hmcts.probate.model.ccd.raw.DynamicListItem; @@ -15,8 +16,23 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; +import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.STATEMENT_OF_TRUTH; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_STATEMENT_OF_TRUTH; import static uk.gov.hmcts.probate.service.ReprintService.LABEL_GRANT; import static uk.gov.hmcts.probate.service.ReprintService.LABEL_REISSUED_GRANT; import static uk.gov.hmcts.probate.service.ReprintService.LABEL_SOT; @@ -30,6 +46,12 @@ @AllArgsConstructor public class ReprintTransformer { + private static final Set GENERATED_DOCUMENT_TYPES = Set.of( + DIGITAL_GRANT, INTESTACY_GRANT, ADMON_WILL_GRANT, AD_COLLIGENDA_BONA_GRANT, WELSH_DIGITAL_GRANT, + WELSH_INTESTACY_GRANT, WELSH_ADMON_WILL_GRANT, WELSH_AD_COLLIGENDA_BONA_GRANT, + DIGITAL_GRANT_REISSUE, INTESTACY_GRANT_REISSUE, ADMON_WILL_GRANT_REISSUE, AD_COLLIGENDA_BONA_GRANT_REISSUE, + STATEMENT_OF_TRUTH, WELSH_STATEMENT_OF_TRUTH + ); public void transformReprintDocuments(@Valid CaseDetails caseDetails, ResponseCaseData.ResponseCaseDataBuilder responseCaseDataBuilder) { @@ -49,7 +71,7 @@ private DynamicList getDocumentsAsDynamicList(CaseData caseData) { listItems.addAll(caseData.getProbateDocumentsGenerated().stream() .filter(doc -> isFromGeneratedDocuments(doc.getValue())) .map(doc -> buildFromGeneratedDocument(doc.getValue()).get()) - .collect(Collectors.toList())); + .toList()); } if (caseData.getProbateSotDocumentsGenerated() != null && !caseData.getProbateSotDocumentsGenerated() @@ -85,24 +107,7 @@ private boolean isFromScannedDOcuments(ScannedDocument document) { } private boolean isFromGeneratedDocuments(Document document) { - switch (document.getDocumentType()) { - case DIGITAL_GRANT: - case INTESTACY_GRANT: - case ADMON_WILL_GRANT: - case WELSH_DIGITAL_GRANT: - case WELSH_INTESTACY_GRANT: - case WELSH_ADMON_WILL_GRANT: - return true; - case DIGITAL_GRANT_REISSUE: - case INTESTACY_GRANT_REISSUE: - case ADMON_WILL_GRANT_REISSUE: - return true; - case STATEMENT_OF_TRUTH: - case WELSH_STATEMENT_OF_TRUTH: - return true; - default: - return false; - } + return GENERATED_DOCUMENT_TYPES.contains(document.getDocumentType()); } private Optional buildFromScannedDocument(ScannedDocument document) { @@ -112,22 +117,16 @@ private Optional buildFromScannedDocument(ScannedDocument docum private Optional buildFromGeneratedDocument(Document document) { Optional optionalDynamicListItem = Optional.empty(); switch (document.getDocumentType()) { - case DIGITAL_GRANT: - case INTESTACY_GRANT: - case ADMON_WILL_GRANT: - case WELSH_DIGITAL_GRANT: - case WELSH_INTESTACY_GRANT: - case WELSH_ADMON_WILL_GRANT: + case DIGITAL_GRANT, INTESTACY_GRANT, ADMON_WILL_GRANT, AD_COLLIGENDA_BONA_GRANT, WELSH_DIGITAL_GRANT, + WELSH_INTESTACY_GRANT, WELSH_ADMON_WILL_GRANT, WELSH_AD_COLLIGENDA_BONA_GRANT: optionalDynamicListItem = Optional.of(buildListItem(document.getDocumentFileName(), LABEL_GRANT)); break; - case DIGITAL_GRANT_REISSUE: - case INTESTACY_GRANT_REISSUE: - case ADMON_WILL_GRANT_REISSUE: + case DIGITAL_GRANT_REISSUE, INTESTACY_GRANT_REISSUE, ADMON_WILL_GRANT_REISSUE, + AD_COLLIGENDA_BONA_GRANT_REISSUE: optionalDynamicListItem = Optional.of(buildListItem(document.getDocumentFileName(), LABEL_REISSUED_GRANT)); break; - case STATEMENT_OF_TRUTH: - case WELSH_STATEMENT_OF_TRUTH: + case STATEMENT_OF_TRUTH, WELSH_STATEMENT_OF_TRUTH: optionalDynamicListItem = Optional.of(buildListItem(document.getDocumentFileName(), LABEL_SOT)); break; default: diff --git a/src/main/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRule.java b/src/main/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRule.java new file mode 100644 index 0000000000..bd461fcaf5 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRule.java @@ -0,0 +1,29 @@ +package uk.gov.hmcts.probate.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.exception.BusinessValidationException; +import uk.gov.hmcts.probate.model.DocumentCaseType; +import uk.gov.hmcts.probate.model.ccd.raw.request.CaseData; +import uk.gov.hmcts.probate.model.ccd.raw.request.CaseDetails; +import uk.gov.hmcts.probate.service.BusinessValidationMessageRetriever; + +import java.util.Locale; + + +@Component +@RequiredArgsConstructor +public class AdColligendaBonaCaseTypeValidationRule { + + private final BusinessValidationMessageRetriever businessValidationMessageRetriever; + + public void validate(CaseDetails caseDetails) { + CaseData caseData = caseDetails.getData(); + if (DocumentCaseType.AD_COLLIGENDA_BONA.getCaseType().equals(caseData.getCaseType())) { + String userMessage = businessValidationMessageRetriever + .getMessage("invalidCaseTypeSelection", null, Locale.UK); + throw new BusinessValidationException(userMessage, + "Ad Colligenda Bona selection is invalid: " + caseDetails.getId()); + } + } +} diff --git a/src/main/resources/ValidationMessages.properties b/src/main/resources/ValidationMessages.properties index b72a0d4b90..140df6fee9 100644 --- a/src/main/resources/ValidationMessages.properties +++ b/src/main/resources/ValidationMessages.properties @@ -195,4 +195,5 @@ dobOverrideDateInvalidWelsh=Mae?r dyddiad geni a roddwyd yn annilys - defnyddiwc invalidCreationEvent=You must select the 'PA1P/PA1A/Solicitors Manual' event on the Create case page for paper form cases. invalidCreationEventWelsh=Rhaid i chi ddewis ?PA1P/PA1A/Llawlyfr Cyfreithwyr? ar y dudalen Creu achos ar gyfer achosion ffurflenni papur. caveatNotificationEvent=If you need to inform the applicant of a caveat stop, you must use the 'Caveat notification' event. -AssembleLetterEvent=As there is no email address recorded for this applicant, you must use the 'Assemble a letter' event to request information instead. \ No newline at end of file +AssembleLetterEvent=As there is no email address recorded for this applicant, you must use the 'Assemble a letter' event to request information instead. +invalidCaseTypeSelection=Cannot select this case type, please select a different case type \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 14fcac8960..66b00b5445 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -89,17 +89,21 @@ docmosis: grantCoversheet: templateName: FL-PRB-GNO-ENG-00024.docx digitalGrantReissueDraft: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc intestacyGrantReissueDraft: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc admonWillGrantReissueDraft: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc + adColligendaBonaGrantReissueDraft: + templateName: FL-PRB-GRP-ENG-01295.doc digitalGrantReissue: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc intestacyGrantReissue: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc admonWillGrantReissue: - templateName: FL-PRB-GRP-ENG-01294.doc + templateName: FL-PRB-GRP-ENG-01295.doc + adColligendaBonaGrantReissue: + templateName: FL-PRB-GRP-ENG-01295.doc sotInformationRequest: templateName: FL-PRB-GNO-ENG-00085.doc sentEmail: @@ -113,29 +117,37 @@ docmosis: blankLetter: templateName: FL-PRB-GNO-ENG-01040.docx welshDigitalGrant: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshIntestacyGrant: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshAdmonWillGrant: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc + welshAdColligendaBonaGrant: + templateName: FL-PRB-GRP-WEL-00236.doc welshDigitalGrantDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshIntestacyGrantDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshAdmonWillGrantDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc + welshAdColligendaBonaGrantDraft: + templateName: FL-PRB-GRP-WEL-00236.doc welshDigitalGrantReissueDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshIntestacyGrantReissueDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshAdmonWillGrantReissueDraft: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc + welshAdColligendaBonaGrantReissueDraft: + templateName: FL-PRB-GRP-WEL-00236.doc welshDigitalGrantReissue: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshIntestacyGrantReissue: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc welshAdmonWillGrantReissue: - templateName: FL-PRB-GRP-WEL-00235.doc + templateName: FL-PRB-GRP-WEL-00236.doc + welshAdColligendaBonaGrantReissue: + templateName: FL-PRB-GRP-WEL-00236.doc fee.api: url: http://localhost:4411 @@ -348,38 +360,46 @@ documents: intestacy: INTESTACY_GRANT_REISSUE admonWill: ADMON_WILL_GRANT_REISSUE gop: DIGITAL_GRANT_REISSUE + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_REISSUE grant: intestacy: INTESTACY_GRANT admonWill: ADMON_WILL_GRANT gop: DIGITAL_GRANT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT preview: reissue: intestacy: INTESTACY_GRANT_REISSUE_DRAFT admonWill: ADMON_WILL_GRANT_REISSUE_DRAFT gop: DIGITAL_GRANT_REISSUE_DRAFT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT grant: intestacy: INTESTACY_GRANT_DRAFT admonWill: ADMON_WILL_GRANT_DRAFT gop: DIGITAL_GRANT_DRAFT + adColligendaBona: AD_COLLIGENDA_BONA_GRANT_DRAFT welsh: final: reissue: intestacy: WELSH_INTESTACY_GRANT_REISSUE admonWill: WELSH_ADMON_WILL_GRANT_REISSUE gop: WELSH_DIGITAL_GRANT_REISSUE + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE grant: intestacy: WELSH_INTESTACY_GRANT admonWill: WELSH_ADMON_WILL_GRANT gop: WELSH_DIGITAL_GRANT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT preview: reissue: intestacy: WELSH_INTESTACY_GRANT_REISSUE_DRAFT admonWill: WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT gop: WELSH_DIGITAL_GRANT_REISSUE_DRAFT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT grant: intestacy: WELSH_INTESTACY_GRANT_DRAFT admonWill: WELSH_ADMON_WILL_GRANT_DRAFT gop: WELSH_DIGITAL_GRANT_DRAFT + adColligendaBona: WELSH_AD_COLLIGENDA_BONA_GRANT_DRAFT registry: registries: diff --git a/src/main/resources/templates/pdf/adColligendaBonaGrant.html b/src/main/resources/templates/pdf/adColligendaBonaGrant.html new file mode 100644 index 0000000000..42043cd6f0 --- /dev/null +++ b/src/main/resources/templates/pdf/adColligendaBonaGrant.html @@ -0,0 +1,329 @@ + +{% macro address(address)%} +{% if address != null %} +{% if address.AddressLine1 != null and address.AddressLine1 != "" %}{{ address.AddressLine1 }}, {% endif %} +{% if address.AddressLine2 != null and address.AddressLine2 != "" %}{{ address.AddressLine2 }}, {% endif %} +{% if address.AddressLine3 != null and address.AddressLine3 != "" %}{{ address.AddressLine3 }}, {% endif %} +{% if address.PostTown != null and address.PostTown != "" %}{{ address.PostTown }}, {% endif %} +{% if address.County != null and address.County != "" %}{{ address.County }}, {% endif %} +{% if address.PostCode != null and address.PostCode != "" %}{{ address.PostCode }}, {% endif %} +{% if address.Country != null and address.Country != "" %}{{ address.Country }}{% endif %} +{% endif %} +{% endmacro %} + + + Grant of Probate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + {% if case_details.case_data.registryLocation == "ctsc" %} + High Court of Justice England and Wales
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + + {% elseif case_details.case_data.registryLocation == "London" %} + High Court of Justice England and Wales
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + + {% elseif case_details.case_data.registryLocation == "Cardiff" %} + High Court of Justice England and Wales
+ Probate Registry of Wales
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + + {% else %} + High Court of Justice England and Wales
+ {{case_details.case_data.registryLocation}} District Probate Registry
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + {% endif %} +
+

+
+
+
+ Ad Colligenda Bona +
+
+
+ Case Reference: {{case_details.id}}
+ Date of Issue: {{case_details.case_data.currentDateFormatted}} +
+
+
+

+ {% if case_details.case_data.boDeceasedTitle != null and case_details.case_data.boDeceasedTitle != "" %}{{ case_details.case_data.boDeceasedTitle }}{% endif %} {{case_details.case_data.deceasedForenames}} {{case_details.case_data.deceasedSurname}} {% if case_details.case_data.boDeceasedHonours != null and case_details.case_data.boDeceasedHonours != "" %}{{ case_details.case_data.boDeceasedHonours }}{% endif %}{% if case_details.case_data.solsDeceasedAliasNamesList != null and case_details.case_data.solsDeceasedAliasNamesList != "" %}{% for alias in case_details.case_data.solsDeceasedAliasNamesList %}{% if loop.first %} otherwise {{alias.value.SolsAliasname}}{% else %}, {{alias.value.SolsAliasname}}{% endif %}{% endfor %}{% endif %} of {% if case_details.case_data.deceasedAddress.AddressLine1 != null and case_details.case_data.deceasedAddress.AddressLine1 != "" %}{{ case_details.case_data.deceasedAddress.AddressLine1}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine2 != null and case_details.case_data.deceasedAddress.AddressLine2 != "" %} {{case_details.case_data.deceasedAddress.AddressLine2}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine3 != null and case_details.case_data.deceasedAddress.AddressLine3 != "" %} {{case_details.case_data.deceasedAddress.AddressLine3}}{% endif %} + {% if case_details.case_data.deceasedAddress.PostTown != null and case_details.case_data.deceasedAddress.PostTown != "" %} {{case_details.case_data.deceasedAddress.PostTown}}{% endif %} + {% if case_details.case_data.deceasedAddress.County != null and case_details.case_data.deceasedAddress.County != "" %} {{case_details.case_data.deceasedAddress.County}}{% endif %} + {% if case_details.case_data.deceasedAddress.PostCode != null and case_details.case_data.deceasedAddress.PostCode != ""%} {{case_details.case_data.deceasedAddress.PostCode}}{% endif %} + {% if case_details.case_data.deceasedAddress.Country != null and case_details.case_data.deceasedAddress.Country != ""%} {{case_details.case_data.deceasedAddress.Country}}{% endif %} + +
{% if case_details.case_data.dateOfDeathType == null %} + Died on + {% elseif case_details.case_data.dateOfDeathType == "diedOnOrAbout" %} + Died on or about + {% elseif case_details.case_data.dateOfDeathType == "presumedDiedOn" %} + Presumed died on + {% elseif case_details.case_data.dateOfDeathType == "diedOnOrBefore" %} + Died on or before + {% elseif case_details.case_data.dateOfDeathType == "diedOnOrSince" %} + Died on or since + {% elseif case_details.case_data.dateOfDeathType == "diedOn" %} + Died on + {% endif %} {{case_details.case_data.deceasedDateOfDeathFormatted}} domiciled in {% if case_details.case_data.domicilityCountry != null and case_details.case_data.domicilityCountry != "" %}{{case_details.case_data.domicilityCountry}}{% else %}England and Wales{% endif %} +

+

The Administration of {{case_details.case_data.deceasedForenames}} {{case_details.case_data.deceasedSurname}}'s estate is granted by the High Court of Justice on this date to the following administrator{% set applyingExecCounter = 0 %}{% for executor + in case_details.case_data.executorsApplying %}{% set applyingExecCounter = applyingExecCounter + 1 %}{% + endfor %}{% if applyingExecCounter > 0 %}s{% endif %} +

+ {% if case_details.case_data.primaryApplicantIsApplying == "No" %} +

{% for executor in case_details.case_data.executorsApplying %} + {% if loop.first %} + + {% if executor.value.applyingExecutorName != null and executor.value.applyingExecutorName != ""%}{{executor.value.applyingExecutorName}}{% else %}{{executor.value.applyingExecutorFirstName}} {{executor.value.applyingExecutorLastName}}{% endif %} + + of + {% if executor.value.applyingExecutorAddress.AddressLine1 != null and executor.value.applyingExecutorAddress.AddressLine1 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine1 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine2 != null and executor.value.applyingExecutorAddress.AddressLine2 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine2 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine3 != null and executor.value.applyingExecutorAddress.AddressLine3 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine3 }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostTown != null and executor.value.applyingExecutorAddress.PostTown != "" %}{{ executor.value.applyingExecutorAddress.PostTown }}{% endif %} + {% if executor.value.applyingExecutorAddress.County != null and executor.value.applyingExecutorAddress.County != "" %}{{ executor.value.applyingExecutorAddress.County }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostCode != null and executor.value.applyingExecutorAddress.PostCode != ""%}{{ executor.value.applyingExecutorAddress.PostCode }}{% endif %} + {% if executor.value.applyingExecutorAddress.Country != null and executor.value.applyingExecutorAddress.Country != ""%}{{ executor.value.applyingExecutorAddress.Country }}{% endif %} + + {% else %} +
+ and + + {% if executor.value.applyingExecutorName != null and executor.value.applyingExecutorName != ""%}{{executor.value.applyingExecutorName}}{% else %}{{executor.value.applyingExecutorFirstName}} {{executor.value.applyingExecutorLastName}}{% endif %} + + of + {% if executor.value.applyingExecutorAddress.AddressLine1 != null and executor.value.applyingExecutorAddress.AddressLine1 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine1 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine2 != null and executor.value.applyingExecutorAddress.AddressLine2 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine2 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine3 != null and executor.value.applyingExecutorAddress.AddressLine3 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine3 }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostTown != null and executor.value.applyingExecutorAddress.PostTown != "" %}{{ executor.value.applyingExecutorAddress.PostTown }}{% endif %} + {% if executor.value.applyingExecutorAddress.County != null and executor.value.applyingExecutorAddress.County != "" %}{{ executor.value.applyingExecutorAddress.County }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostCode != null and executor.value.applyingExecutorAddress.PostCode != ""%}{{ executor.value.applyingExecutorAddress.PostCode }}{% endif %} + {% if executor.value.applyingExecutorAddress.Country != null and executor.value.applyingExecutorAddress.Country != ""%}{{ executor.value.applyingExecutorAddress.Country }}{% endif %} + + {% endif %} + {% endfor %} +

+ {% else %} +

+ + {{case_details.case_data.primaryApplicantForenames}} {{case_details.case_data.primaryApplicantSurname}} + of + + {% if case_details.case_data.primaryApplicantAddress.AddressLine1 != null and case_details.case_data.primaryApplicantAddress.AddressLine1 != "" %}{{ case_details.case_data.primaryApplicantAddress.AddressLine1}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.AddressLine2 != null and case_details.case_data.primaryApplicantAddress.AddressLine2 != "" %} {{case_details.case_data.primaryApplicantAddress.AddressLine2}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.AddressLine3 != null and case_details.case_data.primaryApplicantAddress.AddressLine3 != "" %} {{case_details.case_data.primaryApplicantAddress.AddressLine3}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.PostTown != null and case_details.case_data.primaryApplicantAddress.PostTown != "" %} {{case_details.case_data.primaryApplicantAddress.PostTown}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.County != null and case_details.case_data.primaryApplicantAddress.County != "" %} {{case_details.case_data.primaryApplicantAddress.County}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.PostCode != null and case_details.case_data.primaryApplicantAddress.PostCode != ""%} {{case_details.case_data.primaryApplicantAddress.PostCode}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.Country != null and case_details.case_data.primaryApplicantAddress.Country != ""%} {{case_details.case_data.primaryApplicantAddress.Country}}{% endif %} + + {% for executor in case_details.case_data.executorsApplying %} +
+ and + + {% if executor.value.applyingExecutorName != null and executor.value.applyingExecutorName != ""%}{{executor.value.applyingExecutorName}}{% else %}{{executor.value.applyingExecutorFirstName}} {{executor.value.applyingExecutorLastName}}{% endif %} + + of + {% if executor.value.applyingExecutorAddress.AddressLine1 != null and executor.value.applyingExecutorAddress.AddressLine1 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine1 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine2 != null and executor.value.applyingExecutorAddress.AddressLine2 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine2 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine3 != null and executor.value.applyingExecutorAddress.AddressLine3 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine3 }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostTown != null and executor.value.applyingExecutorAddress.PostTown != "" %}{{ executor.value.applyingExecutorAddress.PostTown }}{% endif %} + {% if executor.value.applyingExecutorAddress.County != null and executor.value.applyingExecutorAddress.County != "" %}{{ executor.value.applyingExecutorAddress.County }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostCode != null and executor.value.applyingExecutorAddress.PostCode != ""%}{{ executor.value.applyingExecutorAddress.PostCode }}{% endif %} + {% if executor.value.applyingExecutorAddress.Country != null and executor.value.applyingExecutorAddress.Country != ""%}{{ executor.value.applyingExecutorAddress.Country }}{% endif %} + + {% endfor %} +

+ {% endif %} +

This is an Ad Colligenda Bona grant and is limited for the purposes only of collecting getting in and + receiving the estate and doing such acts as may be necessary for the preservation of the same in + particular, to deal with issues and if necessary to sell {% if case_details.case_data.deceasedAddress.AddressLine1 != null and case_details.case_data.deceasedAddress.AddressLine1 != "" %}{{ case_details.case_data.deceasedAddress.AddressLine1}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine2 != null and case_details.case_data.deceasedAddress.AddressLine2 != "" %} {{case_details.case_data.deceasedAddress.AddressLine2}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine3 != null and case_details.case_data.deceasedAddress.AddressLine3 != "" %} {{case_details.case_data.deceasedAddress.AddressLine3}}{% endif %} + {% if case_details.case_data.deceasedAddress.PostTown != null and case_details.case_data.deceasedAddress.PostTown != "" %} {{case_details.case_data.deceasedAddress.PostTown}}{% endif %} and until further + representation be granted

+

The application has stated that the gross value of the estate in {% if case_details.case_data.deceasedDomicileInEngWales != "No" %}the United Kingdom{% else %}England and Wales{% endif %} amounts to + {% if case_extras !=null%} + £{{case_extras.grossValue}} and the net value amounts to + £{{case_extras.netValue}}{% endif %} +

+
+ +

DISTRICT REGISTRAR

+
+ +
+ +

Extracted {% if + case_details.case_data.applicationType != "Personal"%} + by {{case_details.case_data.solsSolicitorFirmName}} (Ref: + {{case_details.case_data.solsSolicitorAppReference}}) + {{address(case_details.case_data.solsSolicitorAddress)}} {% else %}personally{% endif %}
+ If you wish to validate the information contained within this document please call {{case_details.ctscTelephone}}

+
+ + diff --git a/src/main/resources/templates/pdf/adColligendaBonaGrantDraft.html b/src/main/resources/templates/pdf/adColligendaBonaGrantDraft.html new file mode 100644 index 0000000000..12047e5460 --- /dev/null +++ b/src/main/resources/templates/pdf/adColligendaBonaGrantDraft.html @@ -0,0 +1,334 @@ + +{% macro address(address)%} +{% if address != null %} +{% if address.AddressLine1 != null and address.AddressLine1 != "" %}{{ address.AddressLine1 }}, {% endif %} +{% if address.AddressLine2 != null and address.AddressLine2 != "" %}{{ address.AddressLine2 }}, {% endif %} +{% if address.AddressLine3 != null and address.AddressLine3 != "" %}{{ address.AddressLine3 }}, {% endif %} +{% if address.PostTown != null and address.PostTown != "" %}{{ address.PostTown }}, {% endif %} +{% if address.County != null and address.County != "" %}{{ address.County }}, {% endif %} +{% if address.PostCode != null and address.PostCode != "" %}{{ address.PostCode }}, {% endif %} +{% if address.Country != null and address.Country != "" %}{{ address.Country }}{% endif %} +{% endif %} +{% endmacro %} + + + Grant of Probate + + + + +
+ DRAFT COPY - +
NOT FOR CIRCULATION +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + {% if case_details.case_data.registryLocation == "ctsc" %} + High Court of Justice England and Wales
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + + {% elseif case_details.case_data.registryLocation == "London" %} + High Court of Justice England and Wales
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + + {% elseif case_details.case_data.registryLocation == "Cardiff" %} + High Court of Justice England and Wales
+ Probate Registry of Wales
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + + {% else %} + High Court of Justice England and Wales
+ {{case_details.case_data.registryLocation}} District Probate Registry
+ {% if case_details.registryAddressLine1 != null and case_details.registryAddressLine1 != "" %}{{case_details.registryAddressLine1}}
{% endif %} + {% if case_details.registryAddressLine2 != null and case_details.registryAddressLine2 != "" %}{{case_details.registryAddressLine2}}
{% endif %} + {% if case_details.registryAddressLine3 != null and case_details.registryAddressLine3 != "" %}{{case_details.registryAddressLine3}}
{% endif %} + {% if case_details.registryAddressLine4 != null and case_details.registryAddressLine4 != "" %}{{case_details.registryAddressLine4}}
{% endif %} + {% if case_details.registryTown != null and case_details.registryTown != "" %}{{case_details.registryTown}}
{% endif %} + {% if case_details.registryPostcode != null and case_details.registryPostcode != "" %}{{case_details.registryPostcode}}
{% endif %} + {% if case_details.registryTelephone != null and case_details.registryTelephone != "" %}{{case_details.registryTelephone}}{% endif %} + {% endif %} +
+

+
+
+
+ Ad Colligenda Bona +
+
+
+ Case Reference: {{case_details.id}}
+ Date of Issue: {{case_details.case_data.currentDateFormatted}} +
+
+
+

+ {% if case_details.case_data.boDeceasedTitle != null and case_details.case_data.boDeceasedTitle != "" %}{{ case_details.case_data.boDeceasedTitle }}{% endif %} {{case_details.case_data.deceasedForenames}} {{case_details.case_data.deceasedSurname}} {% if case_details.case_data.boDeceasedHonours != null and case_details.case_data.boDeceasedHonours != "" %}{{ case_details.case_data.boDeceasedHonours }}{% endif %}{% if case_details.case_data.solsDeceasedAliasNamesList != null and case_details.case_data.solsDeceasedAliasNamesList != "" %}{% for alias in case_details.case_data.solsDeceasedAliasNamesList %}{% if loop.first %} otherwise {{alias.value.SolsAliasname}}{% else %}, {{alias.value.SolsAliasname}}{% endif %}{% endfor %}{% endif %} of {% if case_details.case_data.deceasedAddress.AddressLine1 != null and case_details.case_data.deceasedAddress.AddressLine1 != "" %}{{ case_details.case_data.deceasedAddress.AddressLine1}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine2 != null and case_details.case_data.deceasedAddress.AddressLine2 != "" %} {{case_details.case_data.deceasedAddress.AddressLine2}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine3 != null and case_details.case_data.deceasedAddress.AddressLine3 != "" %} {{case_details.case_data.deceasedAddress.AddressLine3}}{% endif %} + {% if case_details.case_data.deceasedAddress.PostTown != null and case_details.case_data.deceasedAddress.PostTown != "" %} {{case_details.case_data.deceasedAddress.PostTown}}{% endif %} + {% if case_details.case_data.deceasedAddress.County != null and case_details.case_data.deceasedAddress.County != "" %} {{case_details.case_data.deceasedAddress.County}}{% endif %} + {% if case_details.case_data.deceasedAddress.PostCode != null and case_details.case_data.deceasedAddress.PostCode != ""%} {{case_details.case_data.deceasedAddress.PostCode}}{% endif %} + {% if case_details.case_data.deceasedAddress.Country != null and case_details.case_data.deceasedAddress.Country != ""%} {{case_details.case_data.deceasedAddress.Country}}{% endif %} +
{% if case_details.case_data.dateOfDeathType == null %} + Died on + {% elseif case_details.case_data.dateOfDeathType == "diedOnOrAbout" %} + Died on or about + {% elseif case_details.case_data.dateOfDeathType == "presumedDiedOn" %} + Presumed died on + {% elseif case_details.case_data.dateOfDeathType == "diedOnOrBefore" %} + Died on or before + {% elseif case_details.case_data.dateOfDeathType == "diedOnOrSince" %} + Died on or since + {% elseif case_details.case_data.dateOfDeathType == "diedOn" %} + Died on + {% endif %} {{case_details.case_data.deceasedDateOfDeathFormatted}} domiciled in {% if case_details.case_data.domicilityCountry != null and case_details.case_data.domicilityCountry != "" %}{{case_details.case_data.domicilityCountry}}{% else %}England and Wales{% endif %} +

+

The Administration of {{case_details.case_data.deceasedForenames}} {{case_details.case_data.deceasedSurname}}'s estate is granted by the High Court of Justice on this date to the following administrator{% set applyingExecCounter = 0 %}{% for executor + in case_details.case_data.executorsApplying %}{% set applyingExecCounter = applyingExecCounter + 1 %}{% + endfor %}{% if applyingExecCounter > 0 %}s{% endif %} +

+ {% if case_details.case_data.primaryApplicantIsApplying == "No" %} +

{% for executor in case_details.case_data.executorsApplying %} + {% if loop.first %} + + {% if executor.value.applyingExecutorName != null and executor.value.applyingExecutorName != ""%}{{executor.value.applyingExecutorName}}{% else %}{{executor.value.applyingExecutorFirstName}} {{executor.value.applyingExecutorLastName}}{% endif %} + + of + {% if executor.value.applyingExecutorAddress.AddressLine1 != null and executor.value.applyingExecutorAddress.AddressLine1 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine1 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine2 != null and executor.value.applyingExecutorAddress.AddressLine2 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine2 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine3 != null and executor.value.applyingExecutorAddress.AddressLine3 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine3 }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostTown != null and executor.value.applyingExecutorAddress.PostTown != "" %}{{ executor.value.applyingExecutorAddress.PostTown }}{% endif %} + {% if executor.value.applyingExecutorAddress.County != null and executor.value.applyingExecutorAddress.County != "" %}{{ executor.value.applyingExecutorAddress.County }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostCode != null and executor.value.applyingExecutorAddress.PostCode != ""%}{{ executor.value.applyingExecutorAddress.PostCode }}{% endif %} + {% if executor.value.applyingExecutorAddress.Country != null and executor.value.applyingExecutorAddress.Country != ""%}{{ executor.value.applyingExecutorAddress.Country }}{% endif %} + + {% else %} +
+ and + + {% if executor.value.applyingExecutorName != null and executor.value.applyingExecutorName != ""%}{{executor.value.applyingExecutorName}}{% else %}{{executor.value.applyingExecutorFirstName}} {{executor.value.applyingExecutorLastName}}{% endif %} + + of + {% if executor.value.applyingExecutorAddress.AddressLine1 != null and executor.value.applyingExecutorAddress.AddressLine1 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine1 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine2 != null and executor.value.applyingExecutorAddress.AddressLine2 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine2 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine3 != null and executor.value.applyingExecutorAddress.AddressLine3 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine3 }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostTown != null and executor.value.applyingExecutorAddress.PostTown != "" %}{{ executor.value.applyingExecutorAddress.PostTown }}{% endif %} + {% if executor.value.applyingExecutorAddress.County != null and executor.value.applyingExecutorAddress.County != "" %}{{ executor.value.applyingExecutorAddress.County }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostCode != null and executor.value.applyingExecutorAddress.PostCode != ""%}{{ executor.value.applyingExecutorAddress.PostCode }}{% endif %} + {% if executor.value.applyingExecutorAddress.Country != null and executor.value.applyingExecutorAddress.Country != ""%}{{ executor.value.applyingExecutorAddress.Country }}{% endif %} + + {% endif %} + {% endfor %} +

+ {% else %} +

+ + {{case_details.case_data.primaryApplicantForenames}} {{case_details.case_data.primaryApplicantSurname}} + of + + {% if case_details.case_data.primaryApplicantAddress.AddressLine1 != null and case_details.case_data.primaryApplicantAddress.AddressLine1 != "" %}{{ case_details.case_data.primaryApplicantAddress.AddressLine1}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.AddressLine2 != null and case_details.case_data.primaryApplicantAddress.AddressLine2 != "" %} {{case_details.case_data.primaryApplicantAddress.AddressLine2}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.AddressLine3 != null and case_details.case_data.primaryApplicantAddress.AddressLine3 != "" %} {{case_details.case_data.primaryApplicantAddress.AddressLine3}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.PostTown != null and case_details.case_data.primaryApplicantAddress.PostTown != "" %} {{case_details.case_data.primaryApplicantAddress.PostTown}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.County != null and case_details.case_data.primaryApplicantAddress.County != "" %} {{case_details.case_data.primaryApplicantAddress.County}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.PostCode != null and case_details.case_data.primaryApplicantAddress.PostCode != ""%} {{case_details.case_data.primaryApplicantAddress.PostCode}}{% endif %} + {% if case_details.case_data.primaryApplicantAddress.Country != null and case_details.case_data.primaryApplicantAddress.Country != ""%} {{case_details.case_data.primaryApplicantAddress.Country}}{% endif %} + + {% for executor in case_details.case_data.executorsApplying %} +
+ and + + {% if executor.value.applyingExecutorName != null and executor.value.applyingExecutorName != ""%}{{executor.value.applyingExecutorName}}{% else %}{{executor.value.applyingExecutorFirstName}} {{executor.value.applyingExecutorLastName}}{% endif %} + + of + {% if executor.value.applyingExecutorAddress.AddressLine1 != null and executor.value.applyingExecutorAddress.AddressLine1 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine1 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine2 != null and executor.value.applyingExecutorAddress.AddressLine2 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine2 }}{% endif %} + {% if executor.value.applyingExecutorAddress.AddressLine3 != null and executor.value.applyingExecutorAddress.AddressLine3 != "" %}{{ executor.value.applyingExecutorAddress.AddressLine3 }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostTown != null and executor.value.applyingExecutorAddress.PostTown != "" %}{{ executor.value.applyingExecutorAddress.PostTown }}{% endif %} + {% if executor.value.applyingExecutorAddress.County != null and executor.value.applyingExecutorAddress.County != "" %}{{ executor.value.applyingExecutorAddress.County }}{% endif %} + {% if executor.value.applyingExecutorAddress.PostCode != null and executor.value.applyingExecutorAddress.PostCode != ""%}{{ executor.value.applyingExecutorAddress.PostCode }}{% endif %} + {% if executor.value.applyingExecutorAddress.Country != null and executor.value.applyingExecutorAddress.Country != ""%}{{ executor.value.applyingExecutorAddress.Country }}{% endif %} + + {% endfor %} +

+ {% endif %} +

This is an Ad Colligenda Bona grant and is limited for the purposes only of collecting getting in and + receiving the estate and doing such acts as may be necessary for the preservation of the same in + particular, to deal with issues and if necessary to sell {% if case_details.case_data.deceasedAddress.AddressLine1 != null and case_details.case_data.deceasedAddress.AddressLine1 != "" %}{{ case_details.case_data.deceasedAddress.AddressLine1}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine2 != null and case_details.case_data.deceasedAddress.AddressLine2 != "" %} {{case_details.case_data.deceasedAddress.AddressLine2}}{% endif %} + {% if case_details.case_data.deceasedAddress.AddressLine3 != null and case_details.case_data.deceasedAddress.AddressLine3 != "" %} {{case_details.case_data.deceasedAddress.AddressLine3}}{% endif %} + {% if case_details.case_data.deceasedAddress.PostTown != null and case_details.case_data.deceasedAddress.PostTown != "" %} {{case_details.case_data.deceasedAddress.PostTown}}{% endif %} and until further + representation be granted +

+ +

The application has stated that the gross value of the estate in {% if case_details.case_data.deceasedDomicileInEngWales != "No" %}the United Kingdom{% else %}England and Wales{% endif %} amounts to + {% if case_extras !=null%} + £{{case_extras.grossValue}} and the net value amounts to + £{{case_extras.netValue}}{% endif %} +

+
+

DISTRICT REGISTRAR

+
+ +
+ +

Extracted {% if + case_details.case_data.applicationType != "Personal"%} + by {{case_details.case_data.solsSolicitorFirmName}} (Ref: + {{case_details.case_data.solsSolicitorAppReference}}) + {{address(case_details.case_data.solsSolicitorAddress)}} {% else %}personally{% endif %}
+ If you wish to validate the information contained within this document please call {{case_details.ctscTelephone}} +

+
+ + diff --git a/src/test/java/uk/gov/hmcts/probate/controller/BusinessValidationUnitTest.java b/src/test/java/uk/gov/hmcts/probate/controller/BusinessValidationUnitTest.java index 1a1855562d..7a1ed32f16 100644 --- a/src/test/java/uk/gov/hmcts/probate/controller/BusinessValidationUnitTest.java +++ b/src/test/java/uk/gov/hmcts/probate/controller/BusinessValidationUnitTest.java @@ -39,6 +39,7 @@ import uk.gov.hmcts.probate.transformer.reset.ResetCaseDataTransformer; import uk.gov.hmcts.probate.transformer.solicitorexecutors.LegalStatementExecutorTransformer; import uk.gov.hmcts.probate.transformer.solicitorexecutors.SolicitorApplicationCompletionTransformer; +import uk.gov.hmcts.probate.validator.AdColligendaBonaCaseTypeValidationRule; import uk.gov.hmcts.probate.validator.CaseworkerAmendAndCreateValidationRule; import uk.gov.hmcts.probate.validator.CaseworkersSolicitorPostcodeValidationRule; import uk.gov.hmcts.probate.validator.CheckListAmendCaseValidationRule; @@ -189,6 +190,8 @@ class BusinessValidationUnitTest { @Mock private BusinessValidationMessageService businessValidationMessageServiceMock; @Mock + private AdColligendaBonaCaseTypeValidationRule adColligendaBonaCaseTypeValidationRule; + @Mock private UserInfoService userInfoServiceMock; @Mock @@ -230,6 +233,7 @@ public void setUp() { handOffLegacyTransformer, registrarDirectionServiceMock, pre1900DOBValidationRuleMock, + adColligendaBonaCaseTypeValidationRule, businessValidationMessageServiceMock, userInfoServiceMock); @@ -915,6 +919,7 @@ void shouldTransformCaseDataForEvidenceHandledCW() throws NotificationClientExce bindingResultMock); assertThat(response.getStatusCode(), is(HttpStatus.OK)); + verify(adColligendaBonaCaseTypeValidationRule, times(1)).validate(caseDetailsMock); verify(caseDataTransformerMock).transformCaseDataForEvidenceHandledForManualCreateByCW(callbackRequestMock); } diff --git a/src/test/java/uk/gov/hmcts/probate/service/BulkPrintServiceTest.java b/src/test/java/uk/gov/hmcts/probate/service/BulkPrintServiceTest.java index f60cbdbb1b..549e5c5b77 100644 --- a/src/test/java/uk/gov/hmcts/probate/service/BulkPrintServiceTest.java +++ b/src/test/java/uk/gov/hmcts/probate/service/BulkPrintServiceTest.java @@ -484,6 +484,11 @@ void testSuccessfulSendToBulkPrintAdmonWillGrant() { testSuccessfulSendToBulkPrintForDocumentType(DocumentType.ADMON_WILL_GRANT); } + @Test + void testSuccessfulSendToBulkPrintAdColligendaBonaGrant() { + testSuccessfulSendToBulkPrintForDocumentType(DocumentType.AD_COLLIGENDA_BONA_GRANT); + } + @Test void testSuccessfulSendToBulkPrintGrantReissue() { testSuccessfulSendToBulkPrintForDocumentType(DocumentType.DIGITAL_GRANT_REISSUE); @@ -499,6 +504,11 @@ void testSuccessfulSendToBulkPrintAdmonWillGrantReissue() { testSuccessfulSendToBulkPrintForDocumentType(DocumentType.ADMON_WILL_GRANT_REISSUE); } + @Test + void testSuccessfulSendToBulkPrintAdColligendaBonaGrantReissue() { + testSuccessfulSendToBulkPrintForDocumentType(DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE); + } + @Test void testSuccessfulSendToBulkPrintGrantReissueWelsh() { testSuccessfulSendToBulkPrintForDocumentType(DocumentType.WELSH_DIGITAL_GRANT_REISSUE); @@ -514,6 +524,11 @@ void testSuccessfulSendToBulkPrintAdmonWillGrantReissueWelsh() { testSuccessfulSendToBulkPrintForDocumentType(DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE); } + @Test + void testSuccessfulSendToBulkPrintAdColligendaBonaGrantReissueWelsh() { + testSuccessfulSendToBulkPrintForDocumentType(DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE); + } + @Test void testUnSuccessfulValidateEmailThrowsError() throws BulkPrintException { diff --git a/src/test/java/uk/gov/hmcts/probate/service/ReprintTransformerTest.java b/src/test/java/uk/gov/hmcts/probate/service/ReprintTransformerTest.java index ed44164460..88e84b26b8 100644 --- a/src/test/java/uk/gov/hmcts/probate/service/ReprintTransformerTest.java +++ b/src/test/java/uk/gov/hmcts/probate/service/ReprintTransformerTest.java @@ -21,6 +21,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; import static org.mockito.Mockito.when; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.CAVEAT_EXTENDED; @@ -31,6 +33,7 @@ import static uk.gov.hmcts.probate.model.DocumentType.INTESTACY_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.OTHER; import static uk.gov.hmcts.probate.model.DocumentType.STATEMENT_OF_TRUTH; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_INTESTACY_GRANT; @@ -135,12 +138,17 @@ void shouldCreateSingleGeneratedListItems() { createAndAssertGeneratedListItem(INTESTACY_GRANT, "IGrant1", "Grant"); createAndAssertGeneratedListItem(WELSH_INTESTACY_GRANT, "WIGrant1", "Grant"); + createAndAssertGeneratedListItem(AD_COLLIGENDA_BONA_GRANT, "ACBGrant1", "Grant"); + createAndAssertGeneratedListItem(WELSH_AD_COLLIGENDA_BONA_GRANT, "WACBGrant1", "Grant"); + createAndAssertGeneratedListItem(ADMON_WILL_GRANT, "AWGrant1", "Grant"); createAndAssertGeneratedListItem(WELSH_ADMON_WILL_GRANT, "WAWGrant1", "Grant"); createAndAssertGeneratedListItem(DIGITAL_GRANT_REISSUE, "GrantReissue1", "ReissuedGrant"); createAndAssertGeneratedListItem(INTESTACY_GRANT_REISSUE, "IGrantReissue1", "ReissuedGrant"); createAndAssertGeneratedListItem(ADMON_WILL_GRANT_REISSUE, "AWGrantReissue1", "ReissuedGrant"); + createAndAssertGeneratedListItem(AD_COLLIGENDA_BONA_GRANT_REISSUE, "ACBGrantReissue1", + "ReissuedGrant"); } @Test diff --git a/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorServiceTest.java b/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorServiceTest.java index ceaa52d1ca..1a0ab0b39b 100644 --- a/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorServiceTest.java +++ b/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFDecoratorServiceTest.java @@ -27,6 +27,8 @@ import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.openMocks; import static uk.gov.hmcts.probate.model.DocumentType.GRANT_COVER; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; @@ -168,7 +170,8 @@ void shouldDecorateGrantDocuments(final DocumentType documentType) throws JsonPr private static Stream grantDocumentTypeStream() { return Stream.of(ADMON_WILL_GRANT, ADMON_WILL_GRANT_DRAFT, DIGITAL_GRANT, DIGITAL_GRANT_DRAFT, - DIGITAL_GRANT_REISSUE, DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT, INTESTACY_GRANT_DRAFT); + DIGITAL_GRANT_REISSUE, DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT, INTESTACY_GRANT_DRAFT, + AD_COLLIGENDA_BONA_GRANT, AD_COLLIGENDA_BONA_GRANT_DRAFT); } private static Stream legalDocumentTypeStream() { diff --git a/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementServiceTest.java b/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementServiceTest.java index 2251fbc4e2..fff169f977 100644 --- a/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementServiceTest.java +++ b/src/test/java/uk/gov/hmcts/probate/service/template/pdf/PDFManagementServiceTest.java @@ -43,6 +43,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.any; import static org.mockito.Mockito.when; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.CAVEAT_RAISED; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; @@ -179,6 +180,11 @@ void shouldGenerateAndUploadIntestacyGrant() throws IOException { assertDocumentUploaded(INTESTACY_GRANT, "intestacyGrant.pdf"); } + @Test + void shouldGenerateAndUploadAdColligendaBonaGrant() throws IOException { + assertDocumentUploaded(AD_COLLIGENDA_BONA_GRANT, "adColligendaBonaGrant.pdf"); + } + @Test void shouldGenerateAndUploadAdmonWillGrant() throws IOException { assertDocumentUploaded(ADMON_WILL_GRANT, "admonWillGrant.pdf"); diff --git a/src/test/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecoratorTest.java b/src/test/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecoratorTest.java index fba5d73b1e..f1a1cc67b8 100644 --- a/src/test/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecoratorTest.java +++ b/src/test/java/uk/gov/hmcts/probate/service/template/pdf/caseextra/decorator/RemovePenceDecoratorTest.java @@ -18,6 +18,8 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.DIGITAL_GRANT; @@ -62,6 +64,7 @@ void shouldNotDecorateWithThousandSeparatorForLegalDocuments() { private static Stream grantDocumentTypeStream() { return Stream.of(ADMON_WILL_GRANT, ADMON_WILL_GRANT_DRAFT, DIGITAL_GRANT, DIGITAL_GRANT_DRAFT, - DIGITAL_GRANT_REISSUE, DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT, INTESTACY_GRANT_DRAFT); + DIGITAL_GRANT_REISSUE, DIGITAL_GRANT_REISSUE_DRAFT, INTESTACY_GRANT, INTESTACY_GRANT_DRAFT, + AD_COLLIGENDA_BONA_GRANT, AD_COLLIGENDA_BONA_GRANT_DRAFT); } } diff --git a/src/test/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformerTest.java b/src/test/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformerTest.java index c261dda4b0..ac6cedc7e4 100644 --- a/src/test/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformerTest.java +++ b/src/test/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformerTest.java @@ -130,6 +130,8 @@ import static uk.gov.hmcts.probate.model.Constants.CHANNEL_CHOICE_BULKSCAN; import static uk.gov.hmcts.probate.model.Constants.CHANNEL_CHOICE_DIGITAL; import static uk.gov.hmcts.probate.model.Constants.CTSC; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.CAVEAT_STOPPED; @@ -143,6 +145,8 @@ import static uk.gov.hmcts.probate.model.DocumentType.OTHER; import static uk.gov.hmcts.probate.model.DocumentType.SENT_EMAIL; import static uk.gov.hmcts.probate.model.DocumentType.STATEMENT_OF_TRUTH; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT; @@ -1353,6 +1357,25 @@ void shouldSetSendLetterIdAndPdfSizeInWelshAdmonWillGrant() { callbackResponse.getData().getProbateNotificationsGenerated().get(0).getValue()); } + @Test + void shouldSetSendLetterIdAndPdfSizeInWelshAdColligendaBonaGrant() { + Document grantDocument = Document.builder().documentType(WELSH_AD_COLLIGENDA_BONA_GRANT).build(); + Document grantIssuedSentEmail = Document.builder().documentType(SENT_EMAIL).build(); + + CallbackResponse callbackResponse = underTest.addDocuments(callbackRequestMock, + Arrays.asList(grantDocument, grantIssuedSentEmail), "abc123", "2", CASEWORKER_USERINFO); + + assertCommon(callbackResponse); + + assertEquals("2", callbackResponse.getData().getBulkPrintPdfSize()); + assertEquals("abc123", callbackResponse.getData().getBulkPrintSendLetterId()); + assertEquals(1, callbackResponse.getData().getProbateDocumentsGenerated().size()); + assertEquals(grantDocument, callbackResponse.getData().getProbateDocumentsGenerated().get(0).getValue()); + assertEquals(1, callbackResponse.getData().getProbateNotificationsGenerated().size()); + assertEquals(grantIssuedSentEmail, + callbackResponse.getData().getProbateNotificationsGenerated().get(0).getValue()); + } + @Test void shouldSetSendLetterIdAndPdfSizeGrantReissue() { Document grantDocument = Document.builder().documentType(DIGITAL_GRANT_REISSUE).build(); @@ -1424,6 +1447,30 @@ void shouldSetSendLetterIdAndPdfSizeIntestacyGrantReissue() { } + @Test + void shouldSetSendLetterIdAndPdfSizeAdColligendaBonaGrantReissue() { + Document grantDocument = Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT_REISSUE).build(); + Document grantIssuedSentEmail = Document.builder().documentType(SENT_EMAIL).build(); + + CallbackResponse callbackResponse = underTest.addDocuments(callbackRequestMock, + Arrays.asList(grantDocument, grantIssuedSentEmail), "abc123", "2", CASEWORKER_USERINFO); + + assertCommon(callbackResponse); + + assertEquals("abc123", callbackResponse.getData() + .getBulkPrintId().get(0).getValue().getSendLetterId()); + assertEquals(AD_COLLIGENDA_BONA_GRANT_REISSUE.getTemplateName(), + callbackResponse.getData().getBulkPrintId().get(0).getValue().getTemplateName()); + assertEquals(1, callbackResponse.getData().getProbateDocumentsGenerated().size()); + assertEquals(grantDocument, callbackResponse.getData().getProbateDocumentsGenerated().get(0).getValue()); + assertEquals(1, callbackResponse.getData().getProbateNotificationsGenerated().size()); + assertEquals(grantIssuedSentEmail, + callbackResponse.getData().getProbateNotificationsGenerated().get(0).getValue()); + assertEquals(YES, callbackResponse.getData().getBoEmailGrantReissuedNotificationRequested()); + assertEquals(YES, callbackResponse.getData().getBoGrantReissueSendToBulkPrintRequested()); + + } + @Test void shouldSetSendLetterIdAndPdfSizeWelshGrantReissue() { Document grantDocument = Document.builder().documentType(WELSH_DIGITAL_GRANT_REISSUE).build(); @@ -1493,6 +1540,29 @@ void shouldSetSendLetterIdAndPdfSizeWelshAdmonWillReissue() { assertEquals(YES, callbackResponse.getData().getBoGrantReissueSendToBulkPrintRequested()); } + @Test + void shouldSetSendLetterIdAndPdfSizeWelshAdColligendaBonaReissue() { + Document grantDocument = Document.builder().documentType(WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE).build(); + Document grantIssuedSentEmail = Document.builder().documentType(SENT_EMAIL).build(); + + CallbackResponse callbackResponse = underTest.addDocuments(callbackRequestMock, + Arrays.asList(grantDocument, grantIssuedSentEmail), "abc123", "2", CASEWORKER_USERINFO); + + assertCommon(callbackResponse); + + assertEquals("abc123", callbackResponse.getData() + .getBulkPrintId().get(0).getValue().getSendLetterId()); + assertEquals(WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE.getTemplateName(), + callbackResponse.getData().getBulkPrintId().get(0).getValue().getTemplateName()); + assertEquals(1, callbackResponse.getData().getProbateDocumentsGenerated().size()); + assertEquals(grantDocument, callbackResponse.getData().getProbateDocumentsGenerated().get(0).getValue()); + assertEquals(1, callbackResponse.getData().getProbateNotificationsGenerated().size()); + assertEquals(grantIssuedSentEmail, + callbackResponse.getData().getProbateNotificationsGenerated().get(0).getValue()); + assertEquals(YES, callbackResponse.getData().getBoEmailGrantReissuedNotificationRequested()); + assertEquals(YES, callbackResponse.getData().getBoGrantReissueSendToBulkPrintRequested()); + } + @Test void shouldSetGrantIssuedDateForEdgeCase() { Document document = Document.builder() @@ -3222,6 +3292,21 @@ void shouldAddBPInformationForIntestacyReprint() { assertThat(callbackResponse.getData().getBulkPrintPdfSize(), is(pdfSize)); } + @Test + void shouldAddBPInformationForAdColligendaBonaReprint() { + Document document = Document.builder() + .documentType(AD_COLLIGENDA_BONA_GRANT) + .build(); + String letterId = "letterId"; + String pdfSize = "10"; + CallbackResponse callbackResponse = + underTest.addBulkPrintInformationForReprint(callbackRequestMock, document, letterId, pdfSize, + CASEWORKER_USERINFO); + + assertThat(callbackResponse.getData().getBulkPrintSendLetterId(), is(letterId)); + assertThat(callbackResponse.getData().getBulkPrintPdfSize(), is(pdfSize)); + } + @Test void shouldAddBPInformationForWelshGrantReprint() { Document document = Document.builder() diff --git a/src/test/java/uk/gov/hmcts/probate/transformer/DocumentTransformerTest.java b/src/test/java/uk/gov/hmcts/probate/transformer/DocumentTransformerTest.java index 75093d42f5..172799391d 100644 --- a/src/test/java/uk/gov/hmcts/probate/transformer/DocumentTransformerTest.java +++ b/src/test/java/uk/gov/hmcts/probate/transformer/DocumentTransformerTest.java @@ -24,6 +24,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.when; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_DRAFT; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.ADMON_WILL_GRANT_REISSUE; @@ -49,6 +53,8 @@ import static uk.gov.hmcts.probate.model.DocumentType.SENT_EMAIL; import static uk.gov.hmcts.probate.model.DocumentType.SOT_INFORMATION_REQUEST; import static uk.gov.hmcts.probate.model.DocumentType.STATEMENT_OF_TRUTH; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE; +import static uk.gov.hmcts.probate.model.DocumentType.WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_ADMON_WILL_GRANT_REISSUE_DRAFT; import static uk.gov.hmcts.probate.model.DocumentType.WELSH_DIGITAL_GRANT_REISSUE; @@ -199,12 +205,56 @@ void shouldAddDigitalGrantReissueToGeneratedDocuments() { assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); } + @Test + void shouldAddAdColligendaBonaGrantToGeneratedDocuments() { + assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); + + documentTransformer + .addDocument(callbackRequest, Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT).build(), + false); + + assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); + } + + @Test + void shouldAddAdColligendaBonaGrantDraftToGeneratedDocuments() { + assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); + + documentTransformer + .addDocument(callbackRequest, Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT_DRAFT).build(), + false); + + assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); + } + + @Test + void shouldAddAdColligendaBonaGrantReissueDraftToGeneratedDocuments() { + assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); + + documentTransformer + .addDocument(callbackRequest, Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT) + .build(), false); + + assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); + } + + @Test + void shouldAddAdColligendaBonaGrantReissueToGeneratedDocuments() { + assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); + + documentTransformer + .addDocument(callbackRequest, Document.builder().documentType(AD_COLLIGENDA_BONA_GRANT_REISSUE).build(), + false); + + assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); + } + @Test void shouldAddIntestacyGrantToGeneratedDocuments() { assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); documentTransformer - .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT).build(), false); + .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT).build(), false); assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); } @@ -214,7 +264,7 @@ void shouldAddIntestacyGrantDraftToGeneratedDocuments() { assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); documentTransformer - .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT_DRAFT).build(), false); + .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT_DRAFT).build(), false); assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); } @@ -224,8 +274,8 @@ void shouldAddIntestacyGrantReissueDraftToGeneratedDocuments() { assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); documentTransformer - .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT_REISSUE_DRAFT).build(), - false); + .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT_REISSUE_DRAFT).build(), + false); assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); } @@ -235,7 +285,7 @@ void shouldAddIntestacyGrantReissueToGeneratedDocuments() { assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); documentTransformer - .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT_REISSUE).build(), false); + .addDocument(callbackRequest, Document.builder().documentType(INTESTACY_GRANT_REISSUE).build(), false); assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); } @@ -324,6 +374,30 @@ void shouldAddWelshIntestacyGrantReissueToGeneratedDocuments() { assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); } + @Test + void shouldAddWelshAdColligendaBonaGrantReissueDraftToGeneratedDocuments() { + assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); + + documentTransformer + .addDocument(callbackRequest, Document.builder() + .documentType(WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE_DRAFT).build(), + false); + + assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); + } + + @Test + void shouldAddWelshAdColligendaBonaGrantReissueToGeneratedDocuments() { + assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); + + documentTransformer + .addDocument(callbackRequest, Document.builder() + .documentType(WELSH_AD_COLLIGENDA_BONA_GRANT_REISSUE).build(), + false); + + assertEquals(1, callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().size()); + } + @Test void shouldAddWelshAdmonWillGrantReissueDraftToGeneratedDocuments() { assertTrue(callbackRequest.getCaseDetails().getData().getProbateDocumentsGenerated().isEmpty()); diff --git a/src/test/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRuleTest.java b/src/test/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRuleTest.java new file mode 100644 index 0000000000..f15d633c19 --- /dev/null +++ b/src/test/java/uk/gov/hmcts/probate/validator/AdColligendaBonaCaseTypeValidationRuleTest.java @@ -0,0 +1,62 @@ +package uk.gov.hmcts.probate.validator; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import uk.gov.hmcts.probate.exception.BusinessValidationException; +import uk.gov.hmcts.probate.model.ccd.raw.request.CaseData; +import uk.gov.hmcts.probate.model.ccd.raw.request.CaseDetails; +import uk.gov.hmcts.probate.service.BusinessValidationMessageRetriever; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + + +class AdColligendaBonaCaseTypeValidationRuleTest { + + @InjectMocks + private AdColligendaBonaCaseTypeValidationRule caseTypeValidationRule; + @Mock + private BusinessValidationMessageRetriever businessValidationMessageRetriever; + private static final String[] LAST_MODIFIED = {"2018", "1", "1", "0", "0", "0", "0"}; + private static final Long CASE_ID = 12345678987654321L; + private CaseData dataMock; + private CaseDetails detailsMock; + + private AutoCloseable closeableMocks; + + @BeforeEach + public void setUp() { + closeableMocks = MockitoAnnotations.openMocks(this); + dataMock = CaseData.builder().caseType("gop").build(); + detailsMock = new CaseDetails(dataMock, LAST_MODIFIED, CASE_ID); + } + + @AfterEach + void cleanUp() throws Exception { + closeableMocks.close(); + } + + @Test + void shouldReturnErrorForAdColligendaBonaCaseType() { + dataMock = CaseData.builder() + .caseType("adColligendaBona").build(); + detailsMock = new CaseDetails(dataMock, LAST_MODIFIED, CASE_ID); + + BusinessValidationException exception = assertThrows(BusinessValidationException.class, () -> { + caseTypeValidationRule.validate(detailsMock); + }); + assertEquals("Ad Colligenda Bona selection is invalid: 12345678987654321", exception.getMessage()); + } + + @Test + void shouldReturnNoErrorForOtherCaseType() { + assertDoesNotThrow(() -> { + caseTypeValidationRule.validate(detailsMock); + }); + } +} diff --git a/src/test/resources/solicitorPayloadNotificationsAdColligendaBona.json b/src/test/resources/solicitorPayloadNotificationsAdColligendaBona.json new file mode 100644 index 0000000000..465f0279e8 --- /dev/null +++ b/src/test/resources/solicitorPayloadNotificationsAdColligendaBona.json @@ -0,0 +1,122 @@ +{ + "case_details": { + "id": 1528365719153338, + "jurisdiction": "PROBATE", + "state": "CaseCreated", + "case_type_id": "GrantOfRepresentation", + "created_date": [ + 2018, + 6, + 7, + 10, + 1, + 59, + 151000000 + ], + "last_modified": [ + 2018, + 6, + 7, + 10, + 8, + 8, + 695000000 + ], + "case_data": { + "otherExecutorExists": "No", + "outsideUKGrantCopies": null, + "applicationType": "Solicitor", + "deceasedAddress": { + "County": "", + "Country": "", + "PostCode": "2", + "PostTown": "", + "AddressLine1": "1", + "AddressLine2": "", + "AddressLine3": "" + }, + "caseType": "adColligendaBona", + "boSendToBulkPrint": "No", + "deceasedAnyOtherNames": "No", + "solsFeeAccountNumber": "1234", + "willHasCodicils": "No", + "deceasedDateOfBirth": "1900-01-01", + "willAccessOriginal": null, + "willExists": "No", + "solsWillType": "NoWill", + "deceasedMaritalStatus": "neverMarried", + "solsApplicantRelationshipToDeceased": "Child", + "solsSpouseOrCivilRenouncing": "Yes", + "solsAdoptedEnglandOrWales": "Yes", + "solsMinorityInterest": "No", + "solsApplicantSiblings": "No", + "solsSolicitorFirmName": "Solicitor Firm Name", + "deceasedDateOfDeath": "2000-01-01", + "solsSOTNeedToUpdate": "No", + "primaryApplicantEmailAddress": "primary@probate-test.com", + "primaryApplicantForenames": "Executor name 1", + "primaryApplicantAddress": { + "County": "", + "Country": "", + "PostCode": "2", + "PostTown": "", + "AddressLine1": "1", + "AddressLine2": "", + "AddressLine3": "" + }, + "probateDocumentsGenerated": [ + { + "id": "161186cd-24ee-4e37-8793-b388ebc94443", + "value": { + "DocumentLink": { + "document_url": "http://localhost:8080/documents/b533ddf6-3695-45a8-8546-aab63ff16093", + "document_filename": "intestacyGrantDraft.pdf", + "document_binary_url": "http://localhost:8080/documents/b533ddf6-3695-45a8-8546-aab63ff16093/binary" + }, + "DocumentType": "intestacyGrantDraft", + "DocumentFileName": null, + "DocumentDateAdded": "2018-08-03", + "DocumentGeneratedBy": "30" + } + } + ], + "solsSolicitorEmail": "solicitor@probate-test.com", + "deceasedDomicileInEngWales": "Yes", + "ihtNetValue": "800000", + "boStopDetails": "stop details", + "deceasedSurname": "Deceased Last Name", + "solsLegalStatementDocument": { + "document_url": "http://localhost:8080/documents/e1f4f972-1514-4247-bdb1-964998ef3710", + "document_filename": "legalStatementIntestacy.pdf", + "document_binary_url": "http://localhost:8080/documents/e1f4f972-1514-4247-bdb1-964998ef3710/binary" + }, + "extraCopiesOfGrant": null, + "solsPaymentMethods": "fee account", + "solsSolicitorAddress": { + "AddressLine1": "SolAddLn1", + "AddressLine2": "SolAddLn2", + "AddressLine3": "SolAddLn3", + "PostTown": "SolAddPT", + "County": "SolAddCounty", + "PostCode": "KT10 0LA", + "Country": "SolAddCo" + }, + "deceasedForenames": "Deceased First Name", + "primaryApplicantIsApplying": "Yes", + "primaryApplicantHasAlias": "No", + "solsSOTName": "Solicitor_fn Solicitor_ln", + "solsSOTForenames": "Solicitor_fn", + "solsSOTSurname": "Solicitor_ln", + "solsSolicitorIsExec": "No", + "solsSolicitorIsMainApplicant": null, + "solsSolicitorIsApplying": null, + "solsSolicitorNotApplyingReason": null, + "ihtGrossValue": "1000000", + "ihtFormId": "IHT205", + "registryLocation": "Birmingham", + "primaryApplicantSurname": "Executor Last Name 1", + "solsSolicitorAppReference": "1231-3984-3949-0300", + "solsSOTJobTitle": "job title" + } + } +}