diff --git a/ccdImports/configFiles/CCD_Probate_Backoffice/AuthorisationCaseField/AuthorisationCaseField.json b/ccdImports/configFiles/CCD_Probate_Backoffice/AuthorisationCaseField/AuthorisationCaseField.json index 5976f811f6..8e931d8620 100644 --- a/ccdImports/configFiles/CCD_Probate_Backoffice/AuthorisationCaseField/AuthorisationCaseField.json +++ b/ccdImports/configFiles/CCD_Probate_Backoffice/AuthorisationCaseField/AuthorisationCaseField.json @@ -343,6 +343,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-issuer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-issuer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-issuer", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-issuer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-issuer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-issuer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-issuer", "CRUD": "CRUD"}, @@ -858,6 +859,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-caseadmin", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-caseadmin", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-caseadmin", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-caseadmin", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-caseadmin", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-caseadmin", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-caseadmin", "CRUD": "CRUD"}, @@ -1370,6 +1372,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-caseofficer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-caseofficer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-caseofficer", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-caseofficer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-caseofficer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-caseofficer", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-caseofficer", "CRUD": "CRUD"}, @@ -1882,6 +1885,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-registrar", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-registrar", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-registrar", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-registrar", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-registrar", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-registrar", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-registrar", "CRUD": "CRUD"}, @@ -2215,6 +2219,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsIHT400Date", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsPaymentMethods", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdditionalExecutorList", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsIntestacyExecutorList", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdditionalInfo", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsLegalStatementDocument", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsNextStepsDocument", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, @@ -2273,6 +2278,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "childrenDiedUnderEighteen", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "grandChildrenSurvived", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "childAlive", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "isApplicantParentDeceasedChild", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "grandChildrenSurvivedOverEighteen", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "grandChildrenSurvivedUnderEighteen", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "spouseOrPartner", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, @@ -2394,6 +2400,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-superuser", "CRUD": "CRUD"}, @@ -2728,6 +2735,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsIHT400Date", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsPaymentMethods", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdditionalExecutorList", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsIntestacyExecutorList", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdditionalInfo", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsLegalStatementDocument", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsNextStepsDocument", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, @@ -2906,6 +2914,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-scheduler", "CRUD": "CRUD"}, @@ -3178,6 +3187,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, @@ -3237,6 +3247,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "executorsApplying", "UserRole": "caseworker-probate-solicitor", "CRUD": "R"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "executorsNotApplying", "UserRole": "caseworker-probate-solicitor", "CRUD": "R"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdditionalExecutorList", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsIntestacyExecutorList", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsPrimaryExecutorNotApplyingReason", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsBeforeSubmitPage", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsCYANeedToUpdate", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, @@ -3306,6 +3317,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "deceasedAnyOtherParentAlive", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "applicantSameParentsAsDeceased", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "deceasedAnyLivingParents", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "anyLivingWholeBloodSiblings", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "deceasedHasAssetsOutsideUK", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "pcqId", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "dispenseWithNotice", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, @@ -3356,9 +3368,11 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "primaryApplicantParentAdoptedIn", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "primaryApplicantParentAdoptionInEnglandOrWales", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "primaryApplicantParentAdoptedOut", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "isApplicantParentDeceasedChild", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "deceasedAdoptedIn", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "deceasedAdoptionInEnglandOrWales", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "deceasedAdoptedOut", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "wholeBloodSiblingsDiedBeforeDeceased", "UserRole": "caseworker-probate-solicitor", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "schemaVersion", "UserRole": "citizen", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "applicationID", "UserRole": "citizen", "CRUD": "CR"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "applicationSubmittedDate", "UserRole": "citizen", "CRUD": "CRU"}, @@ -3769,6 +3783,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsIHT400Date", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsPaymentMethods", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdditionalExecutorList", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsIntestacyExecutorList", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdditionalInfo", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsLegalStatementDocument", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsNextStepsDocument", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, @@ -3823,6 +3838,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "childrenDiedUnderEighteen", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "grandChildrenSurvived", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "childAlive", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "isApplicantParentDeceasedChild", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "grandChildrenSurvivedOverEighteen", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "grandChildrenSurvivedUnderEighteen", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "spouseOrPartner", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, @@ -3941,6 +3957,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRU"}, @@ -4100,6 +4117,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "citizenResponses", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "TTL", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "firstStopReminderSentDate", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "anyLivingWholeBloodSiblings", "UserRole": "caseworker-probate-systemupdate", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "schemaVersion", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "customHistoryViewer", "UserRole": "caseworker-probate-rparobot", "CRUD": "R"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "customPaymentHistoryViewer", "UserRole": "caseworker-probate-rparobot", "CRUD": "R"}, @@ -4441,6 +4459,7 @@ {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstate", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "immovableEstateInfo", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantNameSection", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, + {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipSection", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsApplicantRelationshipToDeceased", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsSpouseOrCivilRenouncing", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, {"CaseTypeID": "GrantOfRepresentation", "CaseFieldID": "solsAdoptedEnglandOrWales", "UserRole": "caseworker-probate-rparobot", "CRUD": "CRUD"}, diff --git a/ccdImports/configFiles/CCD_Probate_Backoffice/CaseEventToFields/CaseEventToFields.json b/ccdImports/configFiles/CCD_Probate_Backoffice/CaseEventToFields/CaseEventToFields.json index d98c4940c4..5003c0db63 100644 --- a/ccdImports/configFiles/CCD_Probate_Backoffice/CaseEventToFields/CaseEventToFields.json +++ b/ccdImports/configFiles/CCD_Probate_Backoffice/CaseEventToFields/CaseEventToFields.json @@ -131,26 +131,39 @@ {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantForenames", "PageFieldDisplayOrder": 2, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage1", "PageLabel": "About the applicant", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantSurname", "PageFieldDisplayOrder": 3, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage1", "PageLabel": "About the applicant", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantPhoneNumber", "PageFieldDisplayOrder": 4, "DisplayContext": "OPTIONAL", "PageID": "solicitorUpdateIntestacyPage1", "PageLabel": "About the applicant", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantEmailAddress", "PageFieldDisplayOrder": 5, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage1", "PageLabel": "About the applicant", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantAddress", "PageFieldDisplayOrder": 6, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage1", "PageLabel": "About the applicant", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "languagePreferenceWelsh", "PageFieldDisplayOrder": 7, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage1", "CaseEventFieldLabel":"Do you need a bilingual grant in English and Welsh?", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedDomicileInEngWales", "PageFieldDisplayOrder": 1, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageDisplayOrder": 2, "FieldShowCondition": "[STATE]=\"NeverShow\"", "ShowSummaryChangeOption": "y", "RetainHiddenValue": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsApplicantRelationshipSection", "PageFieldDisplayOrder": 1, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "n"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsApplicantRelationshipToDeceased", "PageFieldDisplayOrder": 2, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsAdoptedEnglandOrWales", "PageFieldDisplayOrder": 3, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"ChildAdopted\"", "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsApplicantSiblings", "PageFieldDisplayOrder": 4, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Child*\"", "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsApplicantSiblingsInfo", "PageFieldDisplayOrder": 5, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Child*\" AND solsApplicantSiblings=\"Yes\"", "ShowSummaryChangeOption": "n"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsDeceasedRelationsSection", "PageFieldDisplayOrder": 6, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "n"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedMaritalStatus", "PageFieldDisplayOrder": 7, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsSpouseOrCivilRenouncing", "PageFieldDisplayOrder": 8, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Child*\" AND deceasedMaritalStatus=\"marriedCivilPartnership\"", "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsSpouseOrCivilRenouncingInfo", "PageFieldDisplayOrder": 9, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsSpouseOrCivilRenouncing=\"No\" AND solsApplicantRelationshipToDeceased=\"Child*\"", "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsMinorityInterest", "PageFieldDisplayOrder": 10, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsMinorityInterestInfo", "PageFieldDisplayOrder": 11, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsMinorityInterest=\"Yes\"", "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsDeceasedPropertySection", "PageFieldDisplayOrder": 12, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "FieldShowCondition": "deceasedDomicileInEngWales=\"No\"", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "n"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "immovableEstate", "PageFieldDisplayOrder": 13, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageDisplayOrder": 2, "FieldShowCondition": "deceasedDomicileInEngWales=\"No\"", "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "immovableEstateInfo", "PageFieldDisplayOrder": 14, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageDisplayOrder": 2, "FieldShowCondition": "immovableEstate=\"No\"", "ShowSummaryChangeOption": "n"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "furtherEvidenceForApplication", "PageFieldDisplayOrder": 1, "DisplayContext": "OPTIONAL", "PageID": "solicitorUpdateIntestacyPage3", "PageDisplayOrder": 3, "ShowSummaryChangeOption": "y"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsAdditionalInfo", "PageFieldDisplayOrder": 1, "DisplayContext": "OPTIONAL", "PageID": "solicitorUpdateIntestacyPage4", "PageDisplayOrder": 4, "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantAddress", "PageFieldDisplayOrder": 5, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage1", "PageLabel": "About the applicant", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "languagePreferenceWelsh", "PageFieldDisplayOrder": 6, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage1", "CaseEventFieldLabel":"Do you need a bilingual grant in English and Welsh?", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsApplicantRelationshipSection", "PageFieldDisplayOrder": 1, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "n"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedDomicileInEngWales", "PageFieldDisplayOrder": 2, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageDisplayOrder": 2, "FieldShowCondition": "[STATE]=\"NeverShow\"", "ShowSummaryChangeOption": "y", "RetainHiddenValue": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsApplicantRelationshipToDeceased", "PageFieldDisplayOrder": 3, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "CallBackURLMidEvent": "http://${CCD_DEF_CASE_SERVICE_BASE_URL}/case/validateApplicantAndSetupDynamicList", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "isApplicantParentDeceasedChild", "PageFieldDisplayOrder": 4, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Is one of the applicant’s parents a deceased child of the deceased?", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Grandchild\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantParentAdoptedIn", "PageFieldDisplayOrder": 5, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Did the deceased legally adopt the applicant’s parent?", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Grandchild\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantParentAdoptionInEnglandOrWales", "PageFieldDisplayOrder": 6, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Did the adoption take place in England or Wales?", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Grandchild\" AND primaryApplicantParentAdoptedIn=\"Yes\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantParentAdoptedOut", "PageFieldDisplayOrder": 7, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Did the deceased legally adopt the applicant’s parent out of the family?", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Grandchild\" AND primaryApplicantParentAdoptedIn=\"No\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedAnyLivingDescendants", "PageFieldDisplayOrder": 8, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Sibling\" OR solsApplicantRelationshipToDeceased=\"Parent\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedAnyLivingParents", "PageFieldDisplayOrder": 9, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Sibling\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedAdoptedIn", "PageFieldDisplayOrder": 10, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Sibling\" OR solsApplicantRelationshipToDeceased=\"Parent\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedAdoptionInEnglandOrWales", "PageFieldDisplayOrder": 11, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "deceasedAdoptedIn=\"Yes\" AND (solsApplicantRelationshipToDeceased=\"Sibling\" OR solsApplicantRelationshipToDeceased=\"Parent\")", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedAdoptedOut", "PageFieldDisplayOrder": 12, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "deceasedAdoptedIn=\"No\" AND (solsApplicantRelationshipToDeceased=\"Sibling\" OR solsApplicantRelationshipToDeceased=\"Parent\")", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "applicantSameParentsAsDeceased", "PageFieldDisplayOrder": 13, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Sibling\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "anyLivingWholeBloodSiblings", "PageFieldDisplayOrder": 14, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Sibling\" AND applicantSameParentsAsDeceased=\"oneParentsSame\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantAdoptedIn", "PageFieldDisplayOrder": 15, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "solsApplicantRelationshipToDeceased=\"Child\" OR solsApplicantRelationshipToDeceased=\"Grandchild\" OR solsApplicantRelationshipToDeceased=\"Sibling\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantAdoptionInEnglandOrWales", "PageFieldDisplayOrder": 16, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "primaryApplicantAdoptedIn=\"Yes\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "primaryApplicantAdoptedOut", "PageFieldDisplayOrder": 17, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "PageDisplayOrder": 2, "FieldShowCondition": "primaryApplicantAdoptedIn=\"No\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedMaritalStatus", "PageFieldDisplayOrder": 18, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsSpouseOrCivilRenouncing", "PageFieldDisplayOrder": 19, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "deceasedMaritalStatus=\"marriedCivilPartnership\" AND (solsApplicantRelationshipToDeceased=\"Child*\" OR solsApplicantRelationshipToDeceased=\"Parent\")", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsSpouseOrCivilRenouncingInfo", "PageFieldDisplayOrder": 20, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsSpouseOrCivilRenouncing=\"No\" AND solsApplicantRelationshipToDeceased=\"Child*\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "dateOfDivorcedCPJudicially", "PageFieldDisplayOrder": 21, "DisplayContext": "OPTIONAL", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "deceasedMaritalStatus=\"divorcedCivilPartnership\" OR deceasedMaritalStatus=\"judicially\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "deceasedDivorcedInEnglandOrWales", "PageFieldDisplayOrder": 22, "DisplayContext": "OPTIONAL", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "CaseEventFieldLabel": "Did the divorce, civil partnership dissolved or judicial separation take place in England or Wales?", "FieldShowCondition": "deceasedMaritalStatus=\"divorcedCivilPartnership\" OR deceasedMaritalStatus=\"judicially\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsMinorityInterest", "PageFieldDisplayOrder": 23, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "otherExecutorExists", "PageFieldDisplayOrder": 24, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageDisplayOrder": 2, "CaseEventFieldLabel": "Are there other applicants?", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsMinorityInterestInfo", "PageFieldDisplayOrder": 25, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "About the applicant", "PageDisplayOrder": 2, "FieldShowCondition": "solsMinorityInterest=\"Yes\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsDeceasedPropertySection", "PageFieldDisplayOrder": 26, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageLabel": "Applicant and deceased relations", "FieldShowCondition": "deceasedDomicileInEngWales=\"No\"", "PageDisplayOrder": 2, "ShowSummaryChangeOption": "n"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "immovableEstate", "PageFieldDisplayOrder": 27, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage2", "PageDisplayOrder": 2, "FieldShowCondition": "deceasedDomicileInEngWales=\"No\"", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "immovableEstateInfo", "PageFieldDisplayOrder": 28, "DisplayContext": "READONLY", "PageID": "solicitorUpdateIntestacyPage2", "PageDisplayOrder": 2, "FieldShowCondition": "immovableEstate=\"No\"", "ShowSummaryChangeOption": "n"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsIntestacyExecutorList", "PageFieldDisplayOrder": 1, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateIntestacyPage3", "PageDisplayOrder": 3, "PageShowCondition": "otherExecutorExists=\"Yes\"", "CallBackURLMidEvent": "http://${CCD_DEF_CASE_SERVICE_BASE_URL}/case/validateCoApplicants", "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "furtherEvidenceForApplication", "PageFieldDisplayOrder": 1, "DisplayContext": "OPTIONAL", "PageID": "solicitorUpdateIntestacyPage4", "PageDisplayOrder": 4, "ShowSummaryChangeOption": "y"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateIntestacy", "CaseFieldID": "solsAdditionalInfo", "PageFieldDisplayOrder": 26, "DisplayContext": "OPTIONAL", "PageID": "solicitorUpdateIntestacyPage4", "PageDisplayOrder": 4, "ShowSummaryChangeOption": "y"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateAdmon", "CaseFieldID": "willAccessOriginal", "PageFieldDisplayOrder": 1, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateAdmonPage1", "PageDisplayOrder": 1, "ShowSummaryChangeOption": "y", "CallBackURLMidEvent": "http://${CCD_DEF_CASE_SERVICE_BASE_URL}/case/sols-validate-will-and-codicil-dates"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateAdmon", "CaseFieldID": "willAccessNotarial", "PageFieldDisplayOrder": 2, "DisplayContext": "MANDATORY", "PageID": "solicitorUpdateAdmonPage1", "PageDisplayOrder": 1, "FieldShowCondition": "willAccessOriginal=\"No\"", "ShowSummaryChangeOption": "y"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "CaseEventID": "solicitorUpdateAdmon", "CaseFieldID": "willAccessOriginalHintText", "PageFieldDisplayOrder": 3, "DisplayContext": "READONLY", "PageID": "solicitorUpdateAdmonPage1", "PageDisplayOrder": 1, "FieldShowCondition": "willAccessOriginal=\"No\" AND willAccessNotarial=\"No\"", "ShowSummaryChangeOption": "n"}, diff --git a/ccdImports/configFiles/CCD_Probate_Backoffice/CaseField/CaseField.json b/ccdImports/configFiles/CCD_Probate_Backoffice/CaseField/CaseField.json index c47550c6c5..91404bb2e5 100644 --- a/ccdImports/configFiles/CCD_Probate_Backoffice/CaseField/CaseField.json +++ b/ccdImports/configFiles/CCD_Probate_Backoffice/CaseField/CaseField.json @@ -205,7 +205,6 @@ {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsApplicantNameSection", "Label": "## Applicant details", "FieldType": "Label", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsApplicantRelationshipSection", "Label": "## Applicant's relationship", "FieldType": "Label", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsApplicantRelationshipToDeceased", "Label": "What is the applicant’s relationship to the deceased?", "FieldType": "FixedRadioList", "FieldTypeParameter": "solsRelationshipsToDeceased", "SecurityClassification": "Public"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsDeceasedRelationsSection", "Label": "## Deceased's relations", "FieldType": "Label", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsSpouseOrCivilRenouncing", "Label": "Is there a living spouse or civil partner who is renouncing their right to apply now and in the future?", "HintText": "If a spouse is unable to apply because they lack mental capacity you will not be able to continue this application online.", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsSpouseOrCivilRenouncingInfo", "Label": "You can’t use this service if the spouse or civil partner is not renouncing.", "FieldType": "Label", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsAdoptedEnglandOrWales", "Label": "Did the adoption take place in England or Wales?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, @@ -411,7 +410,7 @@ {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "anyDeceasedChildrenDieBeforeDeceased", "Label": "Did any of the deceased's children die before deceased?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "anyDeceasedGrandChildrenUnderEighteen", "Label": "Are any of the deceased's grand children under eighteen?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "deceasedAnyChildren", "Label": "Did the deceased have any children?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "deceasedAnyLivingDescendants", "Label": "Did the deceased have any living descendants?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "deceasedAnyLivingDescendants", "Label": "Are there any living children, grandchildren or great-grandchildren of the deceased?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "deceasedAnyOtherParentAlive", "Label": "Is the deceased’s other parent alive?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "statementOfTruthDocument", "Label": "Legal Statement", "FieldType": "Document", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "amendedLegalStatement", "Label": "Amended Legal Statement", "FieldType": "Document", "SecurityClassification": "Public", "RegularExpression": ".pdf"}, @@ -556,8 +555,11 @@ {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "childrenDiedBeforeDeceased", "Label": "Did any of these children die before deceased?", "FieldType": "FixedList", "FieldTypeParameter": "predeceasedFixedList", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "hasCoApplicant", "Label": "Has any co-applicants?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "childAlive", "Label": "Is deceased‘s child alive?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "isApplicantParentDeceasedChild", "Label": "Is one of the applicant’s parents a deceased child of the deceased?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "grandchildParentOtherChildren", "Label": "Did the grandchild parent have any children?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "grandchildParentChildrenOverEighteen", "Label": "Did the grandchild parent children are over 18?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "applicantSameParentsAsDeceased", "Label": "Did the applicant share both the same parents as the deceased?", "FieldType": "FixedList", "FieldTypeParameter": "sameParentFixedList", "SecurityClassification": "Public"}, - {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "deceasedAnyLivingParents", "Label": "Are there any living parents of the deceased?", "FieldType": "YesOrNo", "SecurityClassification": "Public"} + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "deceasedAnyLivingParents", "Label": "Are there any living parents of the deceased?", "FieldType": "YesOrNo", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "solsIntestacyExecutorList", "Label": "Co-applicant", "FieldType": "Collection", "FieldTypeParameter": "solIntestacyAdditionalExecutor", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "CaseTypeID": "GrantOfRepresentation", "ID": "anyLivingWholeBloodSiblings", "Label": "Are there any living whole blood siblings of the deceased?", "FieldType": "YesOrNo", "SecurityClassification": "Public"} ] diff --git a/ccdImports/configFiles/CCD_Probate_Backoffice/ComplexTypes.json b/ccdImports/configFiles/CCD_Probate_Backoffice/ComplexTypes.json index 23cdb74b6a..d5d17fd8ff 100644 --- a/ccdImports/configFiles/CCD_Probate_Backoffice/ComplexTypes.json +++ b/ccdImports/configFiles/CCD_Probate_Backoffice/ComplexTypes.json @@ -80,6 +80,21 @@ {"LiveFrom": "01/01/2017", "ID": "solAdditionalExecutor", "ListElementCode": "additionalApplying", "FieldType": "YesOrNo", "ElementLabel": "Are they applying?", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "ID": "solAdditionalExecutor", "ListElementCode": "additionalExecAddress", "FieldType": "AddressUK", "ElementLabel": "Executor address", "FieldShowCondition": "additionalApplying=\"Yes\"", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "ID": "solAdditionalExecutor", "ListElementCode": "additionalExecReasonNotApplying", "FieldType": "FixedRadioList", "FieldTypeParameter": "notApplyingExecutorReasonFixedList", "ElementLabel": "Why are they not applying?", "FieldShowCondition": "additionalApplying=\"No\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "relationship", "FieldType": "DynamicRadioList", "ElementLabel": "What is the co-applicant’s relationship to the deceased?", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "applicantRelationshipToDeceased", "FieldType": "Text", "FieldShowCondition": "applicantRelationshipToDeceased=\"NeverShowThisField\"", "ElementLabel": " ", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "coApplicantAdoptedIn", "FieldType": "YesOrNo", "ElementLabel": "Was the co-applicant adopted in to the family?", "FieldShowCondition": "applicantRelationshipToDeceased!=\"Parent\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "coApplicantAdoptionInEnglandOrWales", "FieldType": "YesOrNo", "ElementLabel": "Did the adoption take place in England or Wales?", "FieldShowCondition": "coApplicantAdoptedIn=\"Yes\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "coApplicantAdoptedOut", "FieldType": "YesOrNo", "ElementLabel": "Was the co-applicant adopted out of the family?", "FieldShowCondition": "coApplicantAdoptedIn=\"No\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "grandchildParentDieBeforeDeceased", "FieldType": "YesOrNo", "ElementLabel": "Is one of the co-applicant’s parents a deceased child of the deceased?", "FieldShowCondition": "relationship=\"grandchild\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "grandchildParentAdoptedIn", "FieldType": "YesOrNo", "ElementLabel": "Did the deceased legally adopt the co-applicant’s parent?", "FieldShowCondition": "relationship=\"grandchild\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "grandchildParentAdoptionInEnglandOrWales", "FieldType": "YesOrNo", "ElementLabel": "Did the adoption take place in England or Wales?", "FieldShowCondition": "relationship=\"grandchild\" AND grandchildParentAdoptedIn=\"Yes\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "grandchildParentAdoptedOut", "FieldType": "YesOrNo", "ElementLabel": "Was the co-applicant’s parent adopted out of the family?", "FieldShowCondition": "relationship=\"grandchild\" AND grandchildParentAdoptedIn=\"No\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "wholeNieceOrNephewParentDieBeforeDeceased", "FieldType": "YesOrNo", "ElementLabel": "Is one of the applicant’s parents a deceased whole blood sibling of the deceased?", "FieldShowCondition": "relationship=\"wholeBloodNieceOrNephew\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "SolsApplicantFamilyDetails", "ListElementCode": "halfNieceOrNephewParentDieBeforeDeceased", "FieldType": "YesOrNo", "ElementLabel": "Is one of the applicant’s parents a deceased half blood sibling of the deceased?", "FieldShowCondition": "relationship=\"halfBloodNieceOrNephew\"", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "solIntestacyAdditionalExecutor", "ListElementCode": "additionalExecForenames", "FieldType": "Text", "ElementLabel": "First name(s)", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "solIntestacyAdditionalExecutor", "ListElementCode": "additionalExecLastname", "FieldType": "Text", "ElementLabel": "Last name(s)", "SecurityClassification": "Public"}, + {"LiveFrom": "01/01/2017", "ID": "solIntestacyAdditionalExecutor", "ListElementCode": "additionalExecAddress", "FieldType": "AddressUK", "ElementLabel": "Co-applicant address", "SecurityClassification": "Public"}, + {"LiveFrom": "02/01/2017", "ID": "solIntestacyAdditionalExecutor", "ListElementCode": "solsApplicantFamilyDetails", "FieldType": "SolsApplicantFamilyDetails", "ElementLabel": " ", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "ID": "ExecutorActingForTrustCorp", "ListElementCode": "additionalExecForenames", "FieldType": "Text", "ElementLabel": "First name(s)", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "ID": "ExecutorActingForTrustCorp", "ListElementCode": "additionalExecLastname", "FieldType": "Text", "ElementLabel": "Last name(s)", "SecurityClassification": "Public"}, {"LiveFrom": "01/01/2017", "ID": "ExecutorActingForTrustCorp", "ListElementCode": "additionalExecutorTrustCorpPosition", "FieldType": "Text", "ElementLabel": "Name of their position within the trust corporation as per the resolution", "SecurityClassification": "Public"}, diff --git a/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json b/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json index a15daec103..c2d90e9108 100644 --- a/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json +++ b/ccdImports/configFiles/CCD_Probate_Backoffice/FixedLists.json @@ -48,9 +48,11 @@ {"LiveFrom": "06/01/2017", "ID": "solsResiduaryTypes", "ListElementCode": "Legatee", "ListElement": "the residuary legatee"}, {"LiveFrom": "06/01/2017", "ID": "solsResiduaryTypes", "ListElementCode": "Devisee", "ListElement": "the residuary devisee"}, {"LiveFrom": "06/01/2017", "ID": "solsResiduaryTypes", "ListElementCode": "LegateeDevisee", "ListElement": "the residuary legatee and devisee"}, - {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "SpouseOrCivil", "ListElement": "Spouse or civil partner", "DisplayOrder": "1"}, - {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "Child", "ListElement": "Child", "DisplayOrder": "2"}, - {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "ChildAdopted", "ListElement": "Adopted child", "DisplayOrder": "3"}, + {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "SpouseOrCivil", "ListElement": "They are the deceased’s husband, wife or civil partner", "DisplayOrder": "1"}, + {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "Child", "ListElement": "They are the deceased’s child", "DisplayOrder": "2"}, + {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "Grandchild", "ListElement": "They are the deceased’s grandchild", "DisplayOrder": "3"}, + {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "Parent", "ListElement": "They are the deceased’s parent", "DisplayOrder": "4"}, + {"LiveFrom": "06/01/2017", "ID": "solsRelationshipsToDeceased", "ListElementCode": "Sibling", "ListElement": "They are the deceased’s sibling", "DisplayOrder": "5"}, {"LiveFrom": "06/01/2017", "ID": "casePrintedTypes", "ListElementCode": "Yes", "ListElement": "Yes"}, {"LiveFrom": "01/01/2017", "ID": "stopReasonFixedList", "ListElementCode": "DeceasedAddressMissing", "ListElement": "Address of deceased missing", "DisplayOrder": "1"}, {"LiveFrom": "01/01/2017", "ID": "stopReasonFixedList", "ListElementCode": "Affidavit", "ListElement": "Affidavit", "DisplayOrder": "2"}, @@ -202,21 +204,22 @@ {"LiveFrom": "06/01/2017", "ID": "relationshipToDeceasedFixedList", "ListElementCode": "parent", "ListElement": "Parent"}, {"LiveFrom": "06/01/2017", "ID": "relationshipToDeceasedFixedList", "ListElementCode": "other", "ListElement": "Other"}, {"LiveFrom": "06/01/2017", "ID": "relationshipToDeceasedFixedList", "ListElementCode": "adoptedChild", "ListElement": "Adopted child"}, - {"LiveFrom": "06/01/2017", "ID": "sameParentFixedList", "ListElementCode": "bothParentsSame", "ListElement": "Whole"}, - {"LiveFrom": "06/01/2017", "ID": "sameParentFixedList", "ListElementCode": "oneParentsSame", "ListElement": "Half"}, + {"LiveFrom": "06/01/2017", "ID": "sameParentFixedList", "ListElementCode": "bothParentsSame", "ListElement": "Yes, they are their whole blood sibling"}, + {"LiveFrom": "06/01/2017", "ID": "sameParentFixedList", "ListElementCode": "oneParentsSame", "ListElement": "No, they are their half blood sibling"}, {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "partner", "ListElement": "Spouse"}, {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "child", "ListElement": "Child"}, {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "grandchild", "ListElement": "Grandchild"}, + {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "parent", "ListElement": "Parent"}, {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "wholeBloodSibling", "ListElement": "Whole blood Sibling"}, {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "halfBloodSibling", "ListElement": "Half blood Sibling"}, - {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "wholeBloodNieceOrNephew", "ListElement": "Whole blood Niece Or Whole blood Nephew"}, - {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "halfBloodNieceOrNephew", "ListElement": "Half blood Niece Or Half blood Nephew"}, + {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "wholeBloodNieceOrNephew", "ListElement": "Whole blood Niece Or Nephew"}, + {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "halfBloodNieceOrNephew", "ListElement": "Half blood Niece Or Nephew"}, {"LiveFrom": "06/01/2017", "ID": "coApplicantRelationshipToDeceasedFixedList", "ListElementCode": "other", "ListElement": "Other"}, {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "marriedCivilPartnership", "ListElement": "Married or in a civil partnership", "DisplayOrder": 1}, - {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "divorcedCivilPartnership", "ListElement": "Divorced or civil partnership has dissolved", "DisplayOrder": 2}, - {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "widowed", "ListElement": "Widowed, their spouse or civil partner died before them", "DisplayOrder": 3}, - {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "judicially", "ListElement": "Judicially separated", "DisplayOrder": 4}, - {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "neverMarried", "ListElement": "Never married", "DisplayOrder": 5}, + {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "divorcedCivilPartnership", "ListElement": "Divorced or had ended their civil partnership", "DisplayOrder": 2}, + {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "judicially", "ListElement": "Legally separated", "DisplayOrder": 3}, + {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "widowed", "ListElement": "Widowed or surviving civil partner", "DisplayOrder": 4}, + {"LiveFrom": "06/01/2017", "ID": "martialStatusFixedList", "ListElementCode": "neverMarried", "ListElement": "Never married or never in a civil partnership", "DisplayOrder": 5}, {"LiveFrom": "06/01/2017", "ID": "deceasedDeathCertificateFixedList", "ListElementCode": "interimDeathCertificate", "ListElement": "Interim death certificate"}, {"LiveFrom": "06/01/2017", "ID": "deceasedDeathCertificateFixedList", "ListElementCode": "deathCertificate", "ListElement": "Death certificate"}, {"LiveFrom": "06/01/2017", "ID": "entitledToApplyFixedList", "ListElementCode": "executors", "ListElement": "The executor/s named in the will/codicil of the person who has died"}, diff --git a/src/functionalTest/java/uk/gov/hmcts/probate/functional/businessvalidation/SolCcdServiceBusinessValidationTests.java b/src/functionalTest/java/uk/gov/hmcts/probate/functional/businessvalidation/SolCcdServiceBusinessValidationTests.java index 9a1f6b1694..fa6fbdd74a 100644 --- a/src/functionalTest/java/uk/gov/hmcts/probate/functional/businessvalidation/SolCcdServiceBusinessValidationTests.java +++ b/src/functionalTest/java/uk/gov/hmcts/probate/functional/businessvalidation/SolCcdServiceBusinessValidationTests.java @@ -49,6 +49,7 @@ public class SolCcdServiceBusinessValidationTests extends IntegrationTestBase { private static final String REDECLARATION_SOT = "/case/redeclarationSot"; private static final String DEFAULT_SOLS_NEXT_STEP = "/case/default-sols-next-steps"; private static final String SOLS_VALIDATE_IHT_ESTATE = "/case/validate-iht-estate"; + private static final String SOLS_VALIDATE_SET_UP_DYNAMIC_LIST = "/case/validateApplicantAndSetupDynamicList"; private static final String DEFAULT_SOLS_IHT_ESTATE = "/case/default-iht-estate"; private static final String SOL_VALIDATE_MAX_EXECUTORS_URL = "/case/sols-validate-executors"; private static final String SOLS_VALIDATE_WILL_AND_CODICIL_DATES_URL = "/case/sols-validate-will-and-codicil-dates"; @@ -701,6 +702,40 @@ void verifyTitleAndClearingListsReset() throws IOException { assertNull(trustCorpExecs); } + @Test + void verifyRequestIntestacySuccessForUpdatePage2() throws IOException { + final ResponseBody body = validatePostSuccessForPayload(utils.getJsonFromFile( + "solicitorPDFPayloadIntestacy.json"), SOLS_VALIDATE_SET_UP_DYNAMIC_LIST, + utils.getHeadersWithCaseworkerUser()); + + final JsonPath jsonPath = JsonPath.from(body.asString()); + final String errors = jsonPath.get("data.errors"); + assertNull(errors); + } + + @Test + void verifyRequestIntestacyFailureForUpdatePage2() throws IOException { + String payload = utils.getJsonFromFile("solicitorPDFPayloadIntestacy.json"); + payload = replaceAllInString(payload, "\"deceasedMaritalStatus\": \"marriedCivilPartnership\",", + "\"deceasedMaritalStatus\": \"divorcedCivilPartnership\","); + validatePostFailureWithPayload(payload, "The selected marital status is not possible if the " + + "applicant is the deceased's husband, wife or civil partner.", + 200, SOLS_VALIDATE_SET_UP_DYNAMIC_LIST); + } + + @Test + void verifyRequestIntestacyFailureOtherExecutorExistsForUpdatePage2() throws IOException { + String payload = utils.getJsonFromFile("solicitorPDFPayloadIntestacy.json"); + payload = replaceAllInString(payload, "\"deceasedMaritalStatus\": \"marriedCivilPartnership\",", + "\"marriedCivilPartnership\": \"marriedCivilPartnership\"," + + "\n\"otherExecutorExists\" : \"Yes\","); + validatePostFailureWithPayload(payload, "A joint application is not possible if the main " + + "applicant is the deceased's husband, wife or civil partner.\n" + + "In some cases, the deceased's child can be a joint " + + "applicant. Use Form PA1A to apply by post instead.", + 200, SOLS_VALIDATE_SET_UP_DYNAMIC_LIST); + } + @Test void verifyRequestInTestacySuccessForDefaultNext() throws IOException { final ResponseBody body = validatePostSuccessForPayload(utils.getJsonFromFile("solicitorPDFPayloadIntestacy" diff --git a/src/functionalTest/resources/json/solicitorPDFPayloadIntestacy.json b/src/functionalTest/resources/json/solicitorPDFPayloadIntestacy.json index c627c01d1f..aef98ed611 100644 --- a/src/functionalTest/resources/json/solicitorPDFPayloadIntestacy.json +++ b/src/functionalTest/resources/json/solicitorPDFPayloadIntestacy.json @@ -147,6 +147,166 @@ "59000000" ], "id": 1594742160663214, + "state": "CaseCreated", + "grantSignatureBase64": null, + "registryAddressLine1": null, + "registryAddressLine2": null, + "registryAddressLine3": null, + "registryAddressLine4": null, + "registryTown": null, + "registryPostcode": null, + "registryTelephone": null, + "ctscTelephone": null + }, + "case_details_before": { + "case_data": { + "solsPaymentMethods": "fee account", + "solsPBANumber": { + "value": { + "code": "PBA0082126", + "label": "PBA0082126" + }, + "list_items": [ + { + "code": "PBA0082126", + "label": "PBA0082126" + }, + { + "code": "PBA0083372", + "label": "PBA0083372" + } + ] + }, + "solsPBAPaymentReference": "appref-PAY1", + "solsSolicitorFirmName": "Firm Name", + "solsSolicitorAddress": { + "AddressLine1": "Test Road", + "AddressLine2": "", + "AddressLine3": "", + "County": "Test County", + "PostTown": "Test City", + "PostCode": "A1 2BC", + "Country": "United Kingdom" + }, + "solsSolicitorAppReference": "12345", + "solsSolicitorEmail": "solicitor@probate-test.com", + "solsSolicitorPhoneNumber": "12345678", + "solsSolicitorIsExec": "No", + "applicationGrounds": "Grounds", + "furtherEvidenceForApplication": "Further evidence", + "deceasedForenames": "De", + "deceasedSurname": "Ceased", + "deceasedDateOfDeath": "2020-01-23", + "applicationSubmittedDate": "2023-12-12", + "deceasedDateOfBirth": "1997-01-23", + "deceasedDomicileInEngWales": "Yes", + "deceasedAddress": { + "AddressLine1": "Test", + "AddressLine2": "Test", + "AddressLine3": "", + "County": "", + "PostTown": "Test", + "PostCode": "A1 2BC", + "Country": "" + }, + "deceasedAnyOtherNames": "No", + "ihtFormId": "IHT400421", + "ihtNetValue": 20000, + "ihtGrossValue": 20000, + "solsWillType": "NoWill", + "primaryApplicantForenames": "FirstName", + "primaryApplicantSurname": "LastName", + "primaryApplicantIsApplying": "Yes", + "primaryApplicantAddress": { + "AddressLine1": "123 Street", + "AddressLine2": "", + "AddressLine3": "", + "County": "", + "PostTown": "Town", + "PostCode": "Postcode", + "Country": "" + }, + "primaryApplicantEmailAddress": "primary@probate-test.com", + "willExists": "No", + "deceasedMaritalStatus": "marriedCivilPartnership", + "solsApplicantRelationshipToDeceased": "SpouseOrCivil", + "solsMinorityInterest": "No", + "solsApplicantSiblings": "No", + "executorsApplying": [ + { + "id": null, + "value": { + "applyingExecutorName": "FirstName", + "applyingExecutorFirstName": "LastName", + "applyingExecutorLastName": "LastName", + "applyingExecutorPhoneNumber": "234567", + "applyingExecutorEmail": "asetrdyfguhkilj", + "additionalApplying": "Yes", + "applyingExecutorAddress": { + "AddressLine1": "123 Street", + "AddressLine2": "", + "AddressLine3": "", + "County": "", + "PostTown": "Town", + "PostCode": "Postcode", + "Country": "UK" + }, + "applyingExecutorOtherNames": "gksdajgj", + "applyingExecutorOtherNamesReason": "fsdnkvdv", + "applyingExecutorOtherReason": "gksdajgj" + } + } + ], + "executorsNotApplying": [], + "applicationType": "Solicitor", + "registryLocation": "ctsc", + "caseType": "intestacy", + "paperForm": "No", + "channelChoice": "Digital", + "dateOfDeathType": "diedOn", + "currentDate": "2020-07-14", + "currentDateFormatted": "14th July 2020", + "deceasedDateOfDeathFormatted": "23rd January 2020", + "boEmailDocsReceivedNotification": "No", + "boEmailGrantIssuedNotification": "No", + "boSendToBulkPrint": "Yes", + "probateDocumentsGenerated": [], + "probateNotificationsGenerated": [], + "caseMatches": [], + "boCaveatStopEmailNotification": "No", + "boEmailGrantReissuedNotification": "Yes", + "boCaveatStopSendToBulkPrint": "Yes", + "boGrantReissueSendToBulkPrint": "Yes", + "probateSotDocumentsGenerated": [], + "boEmailRequestInfoNotification": "No", + "boRequestInfoSendToBulkPrint": "Yes", + "boAssembleLetterSendToBulkPrint": "Yes", + "defaultValueForCaveatStopEmailNotification": "Yes", + "sendForBulkPrintingRequestedGrantReIssued": true, + "primaryApplicantFullName": "FirstName LastName", + "languagePreference": "ENGLISH", + "caveatStopNotificationRequested": false, + "caveatStopEmailNotificationRequested": false, + "caveatStopSendToBulkPrintRequested": true, + "docsReceivedEmailNotificationRequested": false, + "defaultValueForEmailNotifications": "Yes", + "deceasedFullName": "De Ceased", + "primaryApplicantApplying": true, + "sendForBulkPrintingRequested": true, + "grantIssuedEmailNotificationRequested": false, + "grantReissuedEmailNotificationRequested": true + }, + "last_modified": [ + "2020", + "7", + "14", + "15", + "57", + "31", + "59000000" + ], + "id": 1594742160663214, + "state": "CaseCreated", "grantSignatureBase64": null, "registryAddressLine1": null, "registryAddressLine2": null, diff --git a/src/integrationTest/java/uk/gov/hmcts/probate/controller/BusinessValidationControllerIT.java b/src/integrationTest/java/uk/gov/hmcts/probate/controller/BusinessValidationControllerIT.java index f651dd9ca1..5b2e1d5740 100644 --- a/src/integrationTest/java/uk/gov/hmcts/probate/controller/BusinessValidationControllerIT.java +++ b/src/integrationTest/java/uk/gov/hmcts/probate/controller/BusinessValidationControllerIT.java @@ -137,9 +137,7 @@ class BusinessValidationControllerIT { private static final String RESIDUARY = "Yes"; private static final String RESIDUARY_TYPE = "Legatee"; private static final String LIFE_INTEREST = "No"; - private static final String ANSWER_NO = "No"; private static final String SOLS_NOT_APPLYING_REASON = "Power reserved"; - private static final String APPLICATION_GROUNDS = "Application grounds"; private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final String SOLS_DEFAULT_IHT_ESTATE_URL = "/case/default-iht-estate"; @@ -161,7 +159,6 @@ class BusinessValidationControllerIT { private static final String REDEC_COMPLETE = "/case/redeclarationComplete"; private static final String REDECE_SOT = "/case/redeclarationSot"; private static final String DEFAULT_SOLS_NEXT_STEPS = "/case/default-sols-next-steps"; - private static final String DEFAULT_SOLS_PBA = "/case/default-sols-pba"; private static final String REACTIVATE_CASE = "/case/reactivate-case"; private static final String PA_CREATE_URL = "/case/pa-create"; private static final String DEFAULT_REGISTRARS_DECISION = "/case/default-registrars-decision"; @@ -169,9 +166,7 @@ class BusinessValidationControllerIT { private static final String AUTH_HEADER = "Authorization"; private static final String AUTH_TOKEN = "Bearer someAuthorizationToken"; private static final String SOLS_VALIDATE_FURTHER_EVIDENCE_URL = "/case/validate-further-evidence"; - private static final String CASE_WORKER_ESCALATED = "/case/case-worker-escalated"; private static final String CASE_WORKER_RESOLVED_ESCALATED = "/case/resolve-case-worker-escalated"; - private static final String PREPARE_FOR_NOC = "/case/prepare-case-for-noc"; private static final String UNIQUE_CODE = "/case/validate-unique-code"; private static final String ROLLBACK = "/case/rollback"; private static final String uniqueCode = "CTS 0405231104 3tpp s8e9"; @@ -188,6 +183,8 @@ class BusinessValidationControllerIT { private static final String ESCALATE_TO_REGISTRAR = "/case/case-escalated"; private static final String SOLICITOR_SUBMIT_CASE = "/case/setCaseSubmissionDate"; private static final String CLEAR_FIELDS_BASED_ON_RELATIONSHIPS = "/case/clearFieldsBasedOnRelationships"; + private static final String VALIDATE_APPLICANT = "/case/validateApplicantAndSetupDynamicList"; + private static final String VALIDATE_CO_APPLICANT = "/case/validateCoApplicants"; private static final DocumentLink SCANNED_DOCUMENT_URL = DocumentLink.builder() .documentBinaryUrl("http://somedoc") @@ -1487,5 +1484,29 @@ void shouldReturnSuccessForSolicitorSubmitEvent() throws Exception { .andExpect(jsonPath("$.data.schemaVersion").doesNotExist()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } + + @Test + void shouldValidateIntestacyApplicantAndSetupDynamicList() throws Exception { + CaseDetails caseDetails = new CaseDetails(caseDataBuilder.build(), LAST_MODIFIED, ID); + caseDetails.setState("Intestacy"); + CallbackRequest callbackRequest = new CallbackRequest(caseDetails); + callbackRequest.setCaseDetailsBefore(caseDetails); + + String json = OBJECT_MAPPER.writeValueAsString(callbackRequest); + mockMvc.perform(post(VALIDATE_APPLICANT).header(AUTH_HEADER, AUTH_TOKEN) + .content(json).contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()); + } + + @Test + void shouldValidateIntestacyCoApplicant() throws Exception { + CaseDetails caseDetails = new CaseDetails(caseDataBuilder.build(), LAST_MODIFIED, ID); + CallbackRequest callbackRequest = new CallbackRequest(caseDetails); + + String json = OBJECT_MAPPER.writeValueAsString(callbackRequest); + mockMvc.perform(post(VALIDATE_CO_APPLICANT).header(AUTH_HEADER, AUTH_TOKEN) + .content(json).contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()); + } } 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 990c2e96e8..3ed1c0cd72 100644 --- a/src/main/java/uk/gov/hmcts/probate/controller/BusinessValidationController.java +++ b/src/main/java/uk/gov/hmcts/probate/controller/BusinessValidationController.java @@ -51,6 +51,8 @@ import uk.gov.hmcts.probate.validator.CaseworkerAmendAndCreateValidationRule; import uk.gov.hmcts.probate.validator.CaseworkersSolicitorPostcodeValidationRule; import uk.gov.hmcts.probate.validator.ChangeToSameStateValidationRule; +import uk.gov.hmcts.probate.validator.CheckIntestacyMaritalStatusRule; +import uk.gov.hmcts.probate.validator.CheckIntestacyOtherApplicantRule; import uk.gov.hmcts.probate.validator.CodicilDateValidationRule; import uk.gov.hmcts.probate.validator.EmailAddressNotifyApplicantValidationRule; import uk.gov.hmcts.probate.validator.FurtherEvidenceForApplicationValidationRule; @@ -58,6 +60,10 @@ import uk.gov.hmcts.probate.validator.IHTFourHundredDateValidationRule; import uk.gov.hmcts.probate.validator.IHTValidationRule; import uk.gov.hmcts.probate.validator.IhtEstateValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyApplicantDetailsValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyCoApplicantValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyDeceasedDetailsValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyDivorceOrSeparationValidationRule; import uk.gov.hmcts.probate.validator.NaValidationRule; import uk.gov.hmcts.probate.validator.NumberOfApplyingExecutorsValidationRule; import uk.gov.hmcts.probate.validator.OriginalWillSignedDateValidationRule; @@ -136,6 +142,12 @@ public class BusinessValidationController { private final Pre1900DOBValidationRule pre1900DOBValidationRule; private final AdColligendaBonaCaseTypeValidationRule adColligendaBonaCaseTypeValidationRule; private final ZeroApplyingExecutorsValidationRule zeroApplyingExecutorsValidationRule; + private final CheckIntestacyOtherApplicantRule checkIntestacyOtherApplicantRule; + private final CheckIntestacyMaritalStatusRule checkIntestacyMaritalStatusRule; + private final IntestacyDeceasedDetailsValidationRule intestacyDeceasedDetailsValidationRule; + private final IntestacyApplicantDetailsValidationRule intestacyApplicantDetailsValidationRule; + private final IntestacyDivorceOrSeparationValidationRule intestacyDivorceOrSeparationValidationRule; + private final IntestacyCoApplicantValidationRule intestacyCoApplicantValidationRule; private final BusinessValidationMessageService businessValidationMessageService; private final UserInfoService userInfoService; private final DocumentTransformer documentTransformer; @@ -274,6 +286,8 @@ public ResponseEntity solsValidateIntestacy( numberOfApplyingExecutorsValidationRule.validate(callbackRequest.getCaseDetails()); CallbackResponse response = eventValidationService.validateRequest(callbackRequest, allValidationRules); if (response.getErrors().isEmpty()) { + caseDataTransformer.transformCaseDataForValidateIntestacy(callbackRequest); + Optional newState = stateChangeService.getChangedStateForIntestacyUpdate(callbackRequest.getCaseDetails().getData()); response = getCallbackResponseForGenerateAndUpload(callbackRequest, newState, LEGAL_STATEMENT_INTESTACY, @@ -734,6 +748,42 @@ public ResponseEntity reactivateCase( return ResponseEntity.ok(callbackResponseTransformer.transformCase(callbackRequest, caseworkerInfo)); } + @PostMapping(path = "/validateApplicantAndSetupDynamicList", + consumes = APPLICATION_JSON_VALUE, produces = {APPLICATION_JSON_VALUE}) + public ResponseEntity validateIntestacyApplicantAndSetupDynamicList( + @RequestBody CallbackRequest callbackRequest, + HttpServletRequest request) { + logRequest(request.getRequestURI(), callbackRequest); + var rules = new ValidationRule[]{checkIntestacyOtherApplicantRule, checkIntestacyMaritalStatusRule, + intestacyDeceasedDetailsValidationRule, intestacyApplicantDetailsValidationRule, + intestacyDivorceOrSeparationValidationRule}; + final List intestacyApplicantValidations = Arrays.asList(rules); + CallbackResponse response = eventValidationService.validateRequest(callbackRequest, + intestacyApplicantValidations); + if (response.getErrors().isEmpty()) { + return ResponseEntity.ok(callbackResponseTransformer.setupDynamicList(callbackRequest)); + } + return ResponseEntity.ok(response); + } + + @PostMapping(path = "/validateCoApplicants", + consumes = APPLICATION_JSON_VALUE, produces = {APPLICATION_JSON_VALUE}) + public ResponseEntity validateIntestacyCoApplicants( + @RequestBody CallbackRequest callbackRequest, + HttpServletRequest request) { + logRequest(request.getRequestURI(), callbackRequest); + var rules = new ValidationRule[]{intestacyCoApplicantValidationRule}; + final List intestacyCoApplicantValidations = Arrays.asList(rules); + + CallbackResponse response = eventValidationService.validateRequest(callbackRequest, + intestacyCoApplicantValidations); + if (response.getErrors().isEmpty()) { + return ResponseEntity.ok(callbackResponseTransformer.transformCase(callbackRequest, + Optional.empty())); + } + return ResponseEntity.ok(response); + } + @PostMapping(path = "/default-registrars-decision", consumes = APPLICATION_JSON_VALUE, produces = {APPLICATION_JSON_VALUE}) public ResponseEntity setupRegistrarsDecision( diff --git a/src/main/java/uk/gov/hmcts/probate/model/Constants.java b/src/main/java/uk/gov/hmcts/probate/model/Constants.java index 0b72612485..d69442f27f 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/Constants.java +++ b/src/main/java/uk/gov/hmcts/probate/model/Constants.java @@ -67,13 +67,25 @@ public final class Constants { public static final String SOLS_APP_RELATIONSHIP_TO_DECEASED_ADOPTED_CHILD = "ChildAdopted"; public static final String PRIMARY_APP_RELATIONSHIP_TO_DECEASED_ADOPTED_CHILD = "adoptedChild"; - public static final String CHILD = "child"; public static final String GRAND_CHILD = "grandchild"; public static final String PARENT = "parent"; public static final String SIBLING = "sibling"; public static final String WHOLE_SIBLING = "bothParentsSame"; public static final String HALF_SIBLING = "oneParentsSame"; + public static final String WHOLE_BLOOD_SIBLING = "wholeBloodSibling"; + public static final String WHOLE_BLOOD_NIECE_OR_NEPHEW = "wholeBloodNieceOrNephew"; + public static final String HALF_BLOOD_SIBLING = "halfBloodSibling"; + public static final String HALF_BLOOD_NIECE_OR_NEPHEW = "halfBloodNieceOrNephew"; + + public static final String CHILD_LABEL = "They are the deceased’s child"; + public static final String GRAND_CHILD_LABEL = "They are the deceased’s grandchild"; + public static final String PARENT_LABEL = "They are the deceased’s parent"; + public static final String WHOLE_BLOOD_SIBLING_LABEL = "They are the deceased’s whole blood sibling"; + public static final String WHOLE_BLOOD_NIECE_OR_NEPHEW_LABEL = "They are the deceased’s whole blood niece or " + + "nephew"; + public static final String HALF_BLOOD_SIBLING_LABEL = "They are the deceased’s half blood sibling"; + public static final String HALF_BLOOD_NIECE_OR_NEPHEW_LABEL = "They are the deceased’s half blood niece or nephew"; public static final String TITLE_AND_CLEARING_PARTNER_SUCCESSOR_POWER_RESERVED = "TCTPartSuccPowerRes"; public static final String TITLE_AND_CLEARING_FIRM_CEASED_TRADING_NO_SUCCESSOR = "TCTFirmCeasedTradingNoSucc"; diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/Applicant.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/Applicant.java new file mode 100644 index 0000000000..26e5193b77 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/Applicant.java @@ -0,0 +1,19 @@ +package uk.gov.hmcts.probate.model.ccd; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Builder +public class Applicant implements Serializable { + private final String isApplicantParentDeceasedChild; + private final String primaryApplicantAdoptedIn; + private final String primaryApplicantParentAdoptedIn; + private final String primaryApplicantParentAdoptionInEnglandOrWales; + private final String primaryApplicantParentAdoptedOut; + private final String primaryApplicantAdoptionInEnglandOrWales; + private final String primaryApplicantAdoptedOut; + private final String anyLivingWholeBloodSiblings; +} diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/CCDData.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/CCDData.java index c7d611b523..0a76e4d205 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/ccd/CCDData.java +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/CCDData.java @@ -17,6 +17,7 @@ public class CCDData implements Serializable { private final String solicitorReference; private final Solicitor solicitor; private final Deceased deceased; + private final Applicant applicant; private final InheritanceTax iht; private final Fee fee; private final String solsAdditionalInfo; @@ -39,6 +40,7 @@ public class CCDData implements Serializable { private final LocalDate originalWillSignedDate; private final List codicilAddedDateList; private final LocalDate deceasedDateOfDeath; + private final String deceasedMaritalStatus; private final DocumentLink solsCoversheetDocument; private final String solsApplicantRelationshipToDeceased; private final String solsApplicantSiblings; @@ -48,4 +50,5 @@ public class CCDData implements Serializable { private final String dispenseWithNoticeSupportingDocs; private final String englishWill; private final String channelChoice; + private final String otherExecutorExists; } diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/Deceased.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/Deceased.java index 23c6de8b50..01a9d80212 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/ccd/Deceased.java +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/Deceased.java @@ -16,4 +16,11 @@ public class Deceased implements Serializable { private final LocalDate dateOfBirth; private final LocalDate dateOfDeath; private final SolsAddress address; + private final String deceasedMaritalStatus; + private final String deceasedDivorcedInEnglandOrWales; + private final String deceasedAdoptedIn; + private final String deceasedAdoptionInEnglandOrWales; + private final String deceasedAdoptedOut; + private final String deceasedAnyLivingDescendants; + private final String deceasedAnyLivingParents; } diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/Executor.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/Executor.java index d22546f20d..734a681341 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/ccd/Executor.java +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/Executor.java @@ -3,6 +3,7 @@ import lombok.Builder; import lombok.Data; import uk.gov.hmcts.probate.model.ccd.raw.SolsAddress; +import uk.gov.hmcts.probate.model.ccd.raw.SolsApplicantFamilyDetails; import java.io.Serializable; @@ -15,4 +16,5 @@ public class Executor implements Serializable { private final String reasonNotApplying; private final String forename; private final String lastname; + private final SolsApplicantFamilyDetails applicantFamilyDetails; } diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/DynamicRadioList.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/DynamicRadioList.java new file mode 100644 index 0000000000..8e14ee8827 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/DynamicRadioList.java @@ -0,0 +1,30 @@ +package uk.gov.hmcts.probate.model.ccd.raw; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +@Builder +public class DynamicRadioList { + @JsonProperty("value") + private DynamicRadioListElement value; + @JsonProperty("list_items") + private List listItems; + + @JsonIgnore + public String getValueCode() { + return value == null ? null : value.getCode(); + } +} \ No newline at end of file diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/DynamicRadioListElement.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/DynamicRadioListElement.java new file mode 100644 index 0000000000..729db5dfe2 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/DynamicRadioListElement.java @@ -0,0 +1,31 @@ +package uk.gov.hmcts.probate.model.ccd.raw; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +@Builder +public class DynamicRadioListElement { + + /** + * Property that maps to the value attribute of the option tag. + */ + @JsonProperty("code") + private String code; + + /** + * Property that maps to the label attribute of the option tag. + */ + @JsonProperty("label") + private String label; + +} \ No newline at end of file diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/IntestacyAdditionalExecutor.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/IntestacyAdditionalExecutor.java new file mode 100644 index 0000000000..7a4853c189 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/IntestacyAdditionalExecutor.java @@ -0,0 +1,14 @@ +package uk.gov.hmcts.probate.model.ccd.raw; + +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class IntestacyAdditionalExecutor { + + private final String additionalExecForenames; + private final String additionalExecLastname; + private final SolsAddress additionalExecAddress; + private final SolsApplicantFamilyDetails solsApplicantFamilyDetails; +} diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/SolsApplicantFamilyDetails.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/SolsApplicantFamilyDetails.java new file mode 100644 index 0000000000..0ba099010c --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/SolsApplicantFamilyDetails.java @@ -0,0 +1,20 @@ +package uk.gov.hmcts.probate.model.ccd.raw; + +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class SolsApplicantFamilyDetails { + private final DynamicRadioList relationship; + private final String applicantRelationshipToDeceased; + private final String coApplicantAdoptedIn; + private final String coApplicantAdoptionInEnglandOrWales; + private final String coApplicantAdoptedOut; + private final String grandchildParentDieBeforeDeceased; + private final String grandchildParentAdoptedIn; + private final String grandchildParentAdoptionInEnglandOrWales; + private final String grandchildParentAdoptedOut; + private final String wholeNieceOrNephewParentDieBeforeDeceased; + private final String halfNieceOrNephewParentDieBeforeDeceased; +} \ No newline at end of file diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/request/CaseData.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/request/CaseData.java index 60374576be..1240c5fb53 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/request/CaseData.java +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/request/CaseData.java @@ -42,6 +42,7 @@ import uk.gov.hmcts.probate.model.ccd.raw.DocumentLink; import uk.gov.hmcts.probate.model.ccd.raw.DynamicList; import uk.gov.hmcts.probate.model.ccd.raw.EstateItem; +import uk.gov.hmcts.probate.model.ccd.raw.IntestacyAdditionalExecutor; import uk.gov.hmcts.probate.model.ccd.raw.LegalStatement; import uk.gov.hmcts.probate.model.ccd.raw.OriginalDocuments; import uk.gov.hmcts.probate.model.ccd.raw.ParagraphDetail; @@ -226,8 +227,7 @@ public class CaseData extends CaseDataParent { ApplicationIntestacyGroup.class}, message = "{primaryApplicantAddressIsNull}") private SolsAddress primaryApplicantAddress; - @NotBlank(groups = {ApplicationAdmonGroup.class, - ApplicationIntestacyGroup.class}, message = "{primaryApplicantEmailAddressIsNull}") + @NotBlank(groups = {ApplicationAdmonGroup.class}, message = "{primaryApplicantEmailAddressIsNull}") private String primaryApplicantEmailAddress; @NotBlank(groups = {ApplicationProbateGroup.class}, message = "{otherExecutorExistsIsNull}") @@ -235,6 +235,8 @@ public class CaseData extends CaseDataParent { private final List> solsAdditionalExecutorList; + private List> solsIntestacyExecutorList; + private final String solsAdditionalInfo; // EVENT = solicitorUpdateIntestacy @@ -664,6 +666,8 @@ public class CaseData extends CaseDataParent { private LocalDate firstStopReminderSentDate; private final String evidenceHandledDate; private final String childAlive; + private final String isApplicantParentDeceasedChild; + private final String anyLivingWholeBloodSiblings; private TTL ttl; @@ -816,4 +820,8 @@ private String getPoundValue(BigDecimal value) { public void clearAdditionalExecutorList() { getSolsAdditionalExecutorList().clear(); } + + public void clearAdditionalIntestacyExecutorList() { + getSolsIntestacyExecutorList().clear(); + } } diff --git a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/response/ResponseCaseData.java b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/response/ResponseCaseData.java index d7af354ffa..55d293f7c4 100644 --- a/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/response/ResponseCaseData.java +++ b/src/main/java/uk/gov/hmcts/probate/model/ccd/raw/response/ResponseCaseData.java @@ -28,6 +28,7 @@ import uk.gov.hmcts.probate.model.ccd.raw.Document; import uk.gov.hmcts.probate.model.ccd.raw.DocumentLink; import uk.gov.hmcts.probate.model.ccd.raw.EstateItem; +import uk.gov.hmcts.probate.model.ccd.raw.IntestacyAdditionalExecutor; import uk.gov.hmcts.probate.model.ccd.raw.LegalStatement; import uk.gov.hmcts.probate.model.ccd.raw.OriginalDocuments; import uk.gov.hmcts.probate.model.ccd.raw.ParagraphDetail; @@ -141,6 +142,7 @@ public class ResponseCaseData extends ResponseCaseDataParent { @JsonProperty(value = "executorsNotApplying") private final List> additionalExecutorsNotApplying; private final List> solsAdditionalExecutorList; + private final List> solsIntestacyExecutorList; private final SolsAddress deceasedAddress; private final String deceasedAnyOtherNames; private final SolsAddress primaryApplicantAddress; @@ -450,5 +452,6 @@ public class ResponseCaseData extends ResponseCaseDataParent { private final String halfBloodSiblingsOverEighteen; private final String halfBloodNiecesAndNephewsOverEighteen; private final String childAlive; - private final List> deceasedAliasNameList; + private final String isApplicantParentDeceasedChild; + private final String anyLivingWholeBloodSiblings; } diff --git a/src/main/java/uk/gov/hmcts/probate/service/solicitorexecutor/ExecutorListMapperService.java b/src/main/java/uk/gov/hmcts/probate/service/solicitorexecutor/ExecutorListMapperService.java index 97bcbc3c4b..66450f1681 100644 --- a/src/main/java/uk/gov/hmcts/probate/service/solicitorexecutor/ExecutorListMapperService.java +++ b/src/main/java/uk/gov/hmcts/probate/service/solicitorexecutor/ExecutorListMapperService.java @@ -6,6 +6,8 @@ import uk.gov.hmcts.probate.model.ccd.raw.AdditionalExecutorNotApplying; import uk.gov.hmcts.probate.model.ccd.raw.CollectionMember; import uk.gov.hmcts.probate.model.ccd.raw.request.CaseData; +import uk.gov.hmcts.probate.model.ccd.raw.ApplicantFamilyDetails; +import uk.gov.hmcts.probate.model.ccd.raw.SolsApplicantFamilyDetails; import java.time.LocalDate; import java.util.ArrayList; @@ -13,6 +15,12 @@ import java.util.UUID; import java.util.stream.Collectors; +import static uk.gov.hmcts.probate.model.Constants.CHILD; +import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_NIECE_OR_NEPHEW; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_NIECE_OR_NEPHEW; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_SIBLING; import static uk.gov.hmcts.probate.model.Constants.EXECUTOR_NOT_APPLYING_REASON; import static uk.gov.hmcts.probate.model.Constants.EXECUTOR_TYPE_NAMED; import static uk.gov.hmcts.probate.model.Constants.EXECUTOR_TYPE_PROFESSIONAL; @@ -175,6 +183,97 @@ public List> mapFromDispenseWith .collect(Collectors.toList()); } + public List> mapFromSolsIntestacyExecutorListToApplyingExecutors( + CaseData caseData) { + return caseData.getSolsIntestacyExecutorList() + .stream() + .map(exec -> { + final String applExecFNames = FormattingService.capitaliseEachWord( + exec.getValue().getAdditionalExecForenames(), + "additional executor forenames"); + final String applExecLName = FormattingService.capitaliseEachWord( + exec.getValue().getAdditionalExecLastname(), + "additional executor last name"); + final String applExecName = applExecFNames + " " + applExecLName; + final SolsApplicantFamilyDetails solsApplicantFamilyDetails = + exec.getValue().getSolsApplicantFamilyDetails(); + final String selectedRelationship = solsApplicantFamilyDetails.getRelationship().getValue() + .getCode(); + ApplicantFamilyDetails.ApplicantFamilyDetailsBuilder builder = ApplicantFamilyDetails.builder() + .relationshipToDeceased(selectedRelationship); + switch (selectedRelationship) { + case CHILD: + builder.childAdoptedIn(solsApplicantFamilyDetails.getCoApplicantAdoptedIn()) + .childAdoptionInEnglandOrWales(solsApplicantFamilyDetails + .getCoApplicantAdoptionInEnglandOrWales()) + .childAdoptedOut(solsApplicantFamilyDetails.getCoApplicantAdoptedOut()); + break; + case GRAND_CHILD: + builder.childDieBeforeDeceased(solsApplicantFamilyDetails + .getGrandchildParentDieBeforeDeceased()) + .grandchildParentAdoptedIn(solsApplicantFamilyDetails + .getGrandchildParentAdoptedIn()) + .grandchildParentAdoptionInEnglandOrWales(solsApplicantFamilyDetails + .getGrandchildParentAdoptionInEnglandOrWales()) + .grandchildParentAdoptedOut(solsApplicantFamilyDetails + .getGrandchildParentAdoptedOut()) + .grandchildAdoptedIn(solsApplicantFamilyDetails.getCoApplicantAdoptedIn()) + .grandchildAdoptionInEnglandOrWales(solsApplicantFamilyDetails + .getCoApplicantAdoptionInEnglandOrWales()) + .grandchildAdoptedOut(solsApplicantFamilyDetails.getCoApplicantAdoptedOut()); + break; + case WHOLE_BLOOD_SIBLING: + builder.wholeBloodSiblingAdoptedIn(solsApplicantFamilyDetails.getCoApplicantAdoptedIn()) + .wholeBloodSiblingAdoptionInEnglandOrWales(solsApplicantFamilyDetails + .getCoApplicantAdoptionInEnglandOrWales()) + .wholeBloodSiblingAdoptedOut(solsApplicantFamilyDetails.getCoApplicantAdoptedOut()); + break; + case WHOLE_BLOOD_NIECE_OR_NEPHEW: + builder.wholeBloodSiblingDiedBeforeDeceased(solsApplicantFamilyDetails + .getWholeNieceOrNephewParentDieBeforeDeceased()) + .wholeBloodNieceOrNephewAdoptedIn(solsApplicantFamilyDetails + .getCoApplicantAdoptedIn()) + .wholeBloodNieceOrNephewAdoptionInEnglandOrWales(solsApplicantFamilyDetails + .getCoApplicantAdoptionInEnglandOrWales()) + .wholeBloodNieceOrNephewAdoptedOut(solsApplicantFamilyDetails + .getCoApplicantAdoptedOut()); + break; + case HALF_BLOOD_SIBLING: + builder.halfBloodSiblingAdoptedIn(solsApplicantFamilyDetails.getCoApplicantAdoptedIn()) + .halfBloodSiblingAdoptionInEnglandOrWales(solsApplicantFamilyDetails + .getCoApplicantAdoptionInEnglandOrWales()) + .halfBloodSiblingAdoptedOut(solsApplicantFamilyDetails.getCoApplicantAdoptedOut()); + break; + case HALF_BLOOD_NIECE_OR_NEPHEW: + builder.halfBloodSiblingDiedBeforeDeceased(solsApplicantFamilyDetails + .getHalfNieceOrNephewParentDieBeforeDeceased()) + .halfBloodNieceOrNephewAdoptedIn(solsApplicantFamilyDetails + .getCoApplicantAdoptedIn()) + .halfBloodNieceOrNephewAdoptionInEnglandOrWales(solsApplicantFamilyDetails + .getCoApplicantAdoptionInEnglandOrWales()) + .halfBloodNieceOrNephewAdoptedOut(solsApplicantFamilyDetails + .getCoApplicantAdoptedOut()); + break; + default: + throw new IllegalArgumentException( + "Unexpected relationship to deceased for additional applying executor: " + + selectedRelationship); + } + ApplicantFamilyDetails applicantFamilyDetails = builder.build(); + return new CollectionMember<>( + exec.getId(), + AdditionalExecutorApplying.builder() + .applyingExecutorAddress(exec.getValue().getAdditionalExecAddress()) + .applyingExecutorFirstName(applExecFNames) + .applyingExecutorLastName(applExecLName) + .applyingExecutorName(applExecName) + .applicantFamilyDetails(applicantFamilyDetails) + .applyingExecutorType(EXECUTOR_TYPE_NAMED) + .build()); + }) + .collect(Collectors.toList()); + } + public List> mapFromSolsAdditionalExecutorListToApplyingExecutors( CaseData caseData) { return caseData.getSolsAdditionalExecutorList() diff --git a/src/main/java/uk/gov/hmcts/probate/transformer/CCDDataTransformer.java b/src/main/java/uk/gov/hmcts/probate/transformer/CCDDataTransformer.java index 7fe3e40c9a..1d13c0d2aa 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/CCDDataTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/CCDDataTransformer.java @@ -3,6 +3,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import uk.gov.hmcts.probate.model.DocumentType; +import uk.gov.hmcts.probate.model.ccd.Applicant; import uk.gov.hmcts.probate.model.ccd.CCDData; import uk.gov.hmcts.probate.model.ccd.Deceased; import uk.gov.hmcts.probate.model.ccd.Executor; @@ -48,6 +49,7 @@ private CCDData buildCCDData(CallbackRequest callbackRequest) { .solsSolicitorNotApplyingReason(caseData.getSolsSolicitorNotApplyingReason()) .solicitor(buildSolicitorDetails(caseData)) .deceased(buildDeceasedDetails(caseData)) + .applicant(buildApplicantDetails(caseData)) .iht(buildInheritanceTaxDetails(caseData)) .fee(buildFeeDetails(caseData)) .solsAdditionalInfo(caseData.getSolsAdditionalInfo()) @@ -60,6 +62,7 @@ private CCDData buildCCDData(CallbackRequest callbackRequest) { .originalWillSignedDate(caseData.getOriginalWillSignedDate()) .codicilAddedDateList(getCodicilAddedDates(caseData)) .deceasedDateOfDeath(caseData.getDeceasedDateOfDeath()) + .deceasedMaritalStatus(caseData.getDeceasedMaritalStatus()) .solsCoversheetDocument(caseData.getSolsCoversheetDocument()) .solsApplicantRelationshipToDeceased(caseData.getSolsApplicantRelationshipToDeceased()) .solsApplicantSiblings(caseData.getSolsApplicantSiblings()) @@ -68,6 +71,7 @@ private CCDData buildCCDData(CallbackRequest callbackRequest) { .englishWill(caseData.getEnglishWill()) .dispenseWithNotice(caseData.getDispenseWithNotice()) .dispenseWithNoticeSupportingDocs(caseData.getDispenseWithNoticeSupportingDocs()) + .otherExecutorExists(caseData.getOtherExecutorExists()) .channelChoice(caseData.getChannelChoice()); if (caseData.getApplicationType() != null) { @@ -121,10 +125,29 @@ private Deceased buildDeceasedDetails(CaseData caseData) { .lastname(caseData.getDeceasedSurname()) .dateOfBirth((caseData.getDeceasedDateOfBirth())) .dateOfDeath((caseData.getDeceasedDateOfDeath())) + .deceasedMaritalStatus(caseData.getDeceasedMaritalStatus()) + .deceasedDivorcedInEnglandOrWales(caseData.getDeceasedDivorcedInEnglandOrWales()) + .deceasedAdoptedIn(caseData.getDeceasedAdoptedIn()) + .deceasedAdoptionInEnglandOrWales(caseData.getDeceasedAdoptionInEnglandOrWales()) + .deceasedAdoptedOut(caseData.getDeceasedAdoptedOut()) .address(caseData.getDeceasedAddress()) .build(); } + private Applicant buildApplicantDetails(CaseData caseData) { + return Applicant.builder() + .isApplicantParentDeceasedChild(caseData.getIsApplicantParentDeceasedChild()) + .primaryApplicantAdoptedIn(caseData.getPrimaryApplicantAdoptedIn()) + .primaryApplicantParentAdoptedIn((caseData.getPrimaryApplicantParentAdoptedIn())) + .primaryApplicantParentAdoptionInEnglandOrWales( + caseData.getPrimaryApplicantParentAdoptionInEnglandOrWales()) + .primaryApplicantParentAdoptedOut(caseData.getPrimaryApplicantParentAdoptedOut()) + .primaryApplicantAdoptionInEnglandOrWales(caseData.getPrimaryApplicantAdoptionInEnglandOrWales()) + .primaryApplicantAdoptedOut(caseData.getPrimaryApplicantAdoptedOut()) + .anyLivingWholeBloodSiblings(caseData.getWholeBloodSiblingsDiedBeforeDeceased()) + .build(); + } + private InheritanceTax buildInheritanceTaxDetails(CaseData caseData) { return InheritanceTax.builder() .formName(caseData.getIhtFormId()) @@ -182,6 +205,18 @@ private List getAllExecutors(CaseData caseData) { .build()) .collect(Collectors.toList())); } + if (caseData.getSolsIntestacyExecutorList() != null) { + executors.addAll(caseData.getSolsIntestacyExecutorList().stream() + .map(CollectionMember::getValue) + .map(executor -> Executor.builder() + .applying(true) + .address(executor.getAdditionalExecAddress()) + .forename(executor.getAdditionalExecForenames()) + .lastname(executor.getAdditionalExecLastname()) + .applicantFamilyDetails(executor.getSolsApplicantFamilyDetails()) + .build()) + .toList()); + } if (caseData.getAdditionalExecutorsTrustCorpList() != null) { executors.addAll(caseData.getAdditionalExecutorsTrustCorpList().stream() 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 49c3447a26..6f5c2f5110 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformer.java @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import uk.gov.hmcts.probate.model.ApplicationType; +import uk.gov.hmcts.probate.model.DocumentCaseType; import uk.gov.hmcts.probate.model.DocumentType; import uk.gov.hmcts.probate.model.ExecutorsApplyingNotification; import uk.gov.hmcts.probate.model.caseaccess.Organisation; @@ -19,9 +20,13 @@ import uk.gov.hmcts.probate.model.ccd.raw.CollectionMember; import uk.gov.hmcts.probate.model.ccd.raw.Document; import uk.gov.hmcts.probate.model.ccd.raw.DocumentLink; +import uk.gov.hmcts.probate.model.ccd.raw.DynamicRadioList; +import uk.gov.hmcts.probate.model.ccd.raw.DynamicRadioListElement; +import uk.gov.hmcts.probate.model.ccd.raw.IntestacyAdditionalExecutor; import uk.gov.hmcts.probate.model.ccd.raw.OriginalDocuments; import uk.gov.hmcts.probate.model.ccd.raw.ProbateAliasName; import uk.gov.hmcts.probate.model.ccd.raw.RegistrarDirection; +import uk.gov.hmcts.probate.model.ccd.raw.SolsApplicantFamilyDetails; import uk.gov.hmcts.probate.model.ccd.raw.UploadDocument; import uk.gov.hmcts.probate.model.ccd.raw.request.CallbackRequest; import uk.gov.hmcts.probate.model.ccd.raw.request.CaseData; @@ -70,20 +75,31 @@ import static uk.gov.hmcts.probate.model.ApplicationState.BO_CASE_STOPPED; import static uk.gov.hmcts.probate.model.ApplicationType.PERSONAL; import static uk.gov.hmcts.probate.model.ApplicationType.SOLICITOR; -import static uk.gov.hmcts.probate.model.Constants.CHILD; import static uk.gov.hmcts.probate.model.Constants.CTSC; import static uk.gov.hmcts.probate.model.Constants.DATE_OF_DEATH_TYPE_DEFAULT; -import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD; -import static uk.gov.hmcts.probate.model.Constants.PARENT; -import static uk.gov.hmcts.probate.model.Constants.SIBLING; -import static uk.gov.hmcts.probate.model.Constants.WHOLE_SIBLING; -import static uk.gov.hmcts.probate.model.Constants.HALF_SIBLING; import static uk.gov.hmcts.probate.model.Constants.GRANT_TYPE_INTESTACY; import static uk.gov.hmcts.probate.model.Constants.GRANT_TYPE_PROBATE; import static uk.gov.hmcts.probate.model.Constants.LATEST_SCHEMA_VERSION; 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.Constants.CHILD; +import static uk.gov.hmcts.probate.model.Constants.CHILD_LABEL; +import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD; +import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD_LABEL; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_NIECE_OR_NEPHEW; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_NIECE_OR_NEPHEW_LABEL; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_SIBLING_LABEL; +import static uk.gov.hmcts.probate.model.Constants.PARENT; +import static uk.gov.hmcts.probate.model.Constants.PARENT_LABEL; +import static uk.gov.hmcts.probate.model.Constants.SIBLING; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.HALF_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_NIECE_OR_NEPHEW; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_NIECE_OR_NEPHEW_LABEL; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_SIBLING_LABEL; 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; @@ -1573,8 +1589,10 @@ private CallbackResponse transformResponse(ResponseCaseData responseCaseData) { .deceasedAdoptedOut(caseData.getDeceasedAdoptedOut()) .deceasedAnyLivingParents(caseData.getDeceasedAnyLivingParents()) .childAlive(caseData.getChildAlive()) + .isApplicantParentDeceasedChild(caseData.getIsApplicantParentDeceasedChild()) .applicantSameParentsAsDeceased(caseData.getApplicantSameParentsAsDeceased()) - .deceasedAliasNameList(caseData.getDeceasedAliasNameList()); + .solsIntestacyExecutorList(caseData.getSolsIntestacyExecutorList()) + .anyLivingWholeBloodSiblings(caseData.getAnyLivingWholeBloodSiblings()); handleDeceasedAliases( builder, @@ -2030,8 +2048,11 @@ private void updateCaseBuilder(CaseData caseData, ResponseCaseDataBuilder } if (!YES.equals(caseData.getOtherExecutorExists())) { - builder - .solsAdditionalExecutorList(null); + if (DocumentCaseType.INTESTACY.getCaseType().equals(caseData.getCaseType())) { + builder.solsIntestacyExecutorList(null); + } else { + builder.solsAdditionalExecutorList(null); + } } if (caseData.getPrimaryApplicantAliasReason() != null) { @@ -2428,4 +2449,81 @@ public CallbackResponse clearSiblingFields(CallbackRequest callbackRequest) { } return transformResponse(responseCaseDataBuilder.build()); } + + public CallbackResponse setupDynamicList(CallbackRequest callbackRequest) { + ResponseCaseDataBuilder responseCaseDataBuilder = + getResponseCaseData(callbackRequest.getCaseDetails(), + callbackRequest.getEventId(), + Optional.empty(), + false); + final var caseDetails = callbackRequest.getCaseDetails(); + final var caseDetailsBefore = callbackRequest.getCaseDetailsBefore(); + String relationshipAfter = caseDetails.getData().getSolsApplicantRelationshipToDeceased(); + String relationshipBefore = caseDetailsBefore.getData().getSolsApplicantRelationshipToDeceased(); + String wholeOrHalfSiblingBefore = caseDetailsBefore.getData().getApplicantSameParentsAsDeceased(); + String wholeOrHalfSiblingAfter = caseDetails.getData().getApplicantSameParentsAsDeceased(); + List> existingExecutorList = caseDetailsBefore.getData() + .getSolsIntestacyExecutorList(); + log.info("Relationship to deceased before for case {}: {}",caseDetails.getId(), relationshipBefore); + final var caseData = caseDetails.getData(); + + DynamicRadioList relationshipList = getAppropriateRelationshipRadioList(caseData, existingExecutorList); + String otherExecutorExists = caseData.getOtherExecutorExists(); + + if (YES.equalsIgnoreCase(otherExecutorExists) && (!relationshipAfter.equals(relationshipBefore) + || (null != wholeOrHalfSiblingBefore && !wholeOrHalfSiblingBefore.equals(wholeOrHalfSiblingAfter)))) { + List> additionalExecutorList = new ArrayList<>(); + IntestacyAdditionalExecutor additionalExecutor = IntestacyAdditionalExecutor.builder() + .solsApplicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .relationship(relationshipList) + .applicantRelationshipToDeceased(caseData.getSolsApplicantRelationshipToDeceased()).build()) + .build(); + additionalExecutorList.add(new CollectionMember<>(additionalExecutor)); + responseCaseDataBuilder.solsIntestacyExecutorList(additionalExecutorList); + } else if (existingExecutorList != null && !existingExecutorList.isEmpty()) { + responseCaseDataBuilder.solsIntestacyExecutorList(existingExecutorList); + } + return transformResponse(responseCaseDataBuilder.build()); + } + + private DynamicRadioList getAppropriateRelationshipRadioList(CaseData caseData, + List> + existingExecutorList) { + List listItems = new ArrayList<>(); + String relationship = StringUtils.defaultString(caseData.getSolsApplicantRelationshipToDeceased()) + .toLowerCase(); + + switch (relationship) { + case CHILD: + case GRAND_CHILD: + listItems.add(buildRadioListItem(CHILD, CHILD_LABEL)); + listItems.add(buildRadioListItem(GRAND_CHILD, GRAND_CHILD_LABEL)); + break; + case PARENT: + listItems.add(buildRadioListItem(PARENT, PARENT_LABEL)); + break; + case SIBLING: + if (WHOLE_SIBLING.equalsIgnoreCase(caseData.getApplicantSameParentsAsDeceased())) { + listItems.add(buildRadioListItem(WHOLE_BLOOD_SIBLING, WHOLE_BLOOD_SIBLING_LABEL)); + listItems.add(buildRadioListItem(WHOLE_BLOOD_NIECE_OR_NEPHEW, WHOLE_BLOOD_NIECE_OR_NEPHEW_LABEL)); + } else { + listItems.add(buildRadioListItem(HALF_BLOOD_SIBLING, HALF_BLOOD_SIBLING_LABEL)); + listItems.add(buildRadioListItem(HALF_BLOOD_NIECE_OR_NEPHEW, HALF_BLOOD_NIECE_OR_NEPHEW_LABEL)); + } + break; + default: + break; + } + + return DynamicRadioList.builder() + .listItems(listItems) + .build(); + } + + private DynamicRadioListElement buildRadioListItem(String code, String label) { + return DynamicRadioListElement.builder() + .code(code) + .label(label) + .build(); + } } diff --git a/src/main/java/uk/gov/hmcts/probate/transformer/CaseDataTransformer.java b/src/main/java/uk/gov/hmcts/probate/transformer/CaseDataTransformer.java index 6b3bf03f1d..9eb4e81d17 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/CaseDataTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/CaseDataTransformer.java @@ -73,6 +73,16 @@ public void transformCaseDataForValidateProbate(CallbackRequest callbackRequest) solicitorApplicationCompletionTransformer.eraseCodicilAddedDateIfWillHasNoCodicils(caseData); } + public void transformCaseDataForValidateIntestacy(CallbackRequest callbackRequest) { + final var caseDetails = callbackRequest.getCaseDetails(); + final var caseData = caseDetails.getData(); + + solicitorApplicationCompletionTransformer + .clearAdditionalExecutorWhenUpdatingIntestacyApplicantDetails(caseDetails); + solicitorApplicationCompletionTransformer.setFieldsIfSolicitorIsNotNamedInWillAsAnExecutor(caseData); + solicitorApplicationCompletionTransformer.mapSolicitorExecutorFieldsOnAppDetailsComplete(caseData); + } + public void transformCaseDataForValidateAdmon(CallbackRequest callbackRequest) { final var caseData = callbackRequest.getCaseDetails().getData(); legalStatementExecutorTransformer.formatFields(caseData); diff --git a/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/ExecutorsTransformer.java b/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/ExecutorsTransformer.java index ba87c460dc..d8bf03445f 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/ExecutorsTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/ExecutorsTransformer.java @@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.model.DocumentCaseType; import uk.gov.hmcts.probate.model.ccd.raw.AdditionalExecutorApplying; import uk.gov.hmcts.probate.model.ccd.raw.AdditionalExecutorNotApplying; import uk.gov.hmcts.probate.model.ccd.raw.CollectionMember; @@ -106,7 +107,7 @@ public void mapSolicitorExecutorFieldsToExecutorNamesLists( builder.solsIdentifiedNotApplyingExecsCcdCopy(execsNotApplyingNames); } - public List> createCaseworkerApplyingList(CaseData caseData) { + public List> createCaseworkerApplyingList(CaseData caseData) { // Initialise executor lists List> execsApplying = getExecsApplying(caseData); @@ -151,6 +152,12 @@ private void mapSolicitorExecutorApplyingListsToCaseworkerApplyingList( // Add main solicitor executor list execsApplying.addAll(executorListMapperService .mapFromSolsAdditionalExecutorListToApplyingExecutors(caseData)); + } else if (DocumentCaseType.INTESTACY.getCaseType().equals(caseData.getCaseType()) + && caseData.getSolsIntestacyExecutorList() != null + && !caseData.getSolsIntestacyExecutorList().isEmpty()) { + // Add intestacy solicitor executor list + execsApplying.addAll(executorListMapperService + .mapFromSolsIntestacyExecutorListToApplyingExecutors(caseData)); } } diff --git a/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/SolicitorApplicationCompletionTransformer.java b/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/SolicitorApplicationCompletionTransformer.java index 419f0aef66..a447ebcfb1 100644 --- a/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/SolicitorApplicationCompletionTransformer.java +++ b/src/main/java/uk/gov/hmcts/probate/transformer/solicitorexecutors/SolicitorApplicationCompletionTransformer.java @@ -98,4 +98,11 @@ public void clearAdditionalExecutorWhenUpdatingApplicantDetails(CaseDetails case caseDetails.getData().clearAdditionalExecutorList(); } } + + public void clearAdditionalExecutorWhenUpdatingIntestacyApplicantDetails(CaseDetails caseDetails) { + if (NO.equals(caseDetails.getData().getOtherExecutorExists()) + && caseDetails.getData().getSolsIntestacyExecutorList() != null) { + caseDetails.getData().clearAdditionalIntestacyExecutorList(); + } + } } diff --git a/src/main/java/uk/gov/hmcts/probate/validator/CheckIntestacyMaritalStatusRule.java b/src/main/java/uk/gov/hmcts/probate/validator/CheckIntestacyMaritalStatusRule.java new file mode 100644 index 0000000000..ea2f05668b --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/validator/CheckIntestacyMaritalStatusRule.java @@ -0,0 +1,39 @@ +package uk.gov.hmcts.probate.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.List; + +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; + +@Component +@RequiredArgsConstructor +public class CheckIntestacyMaritalStatusRule implements ValidationRule { + + private static final String MARITAL_STATUS_MARRIED = "marriedCivilPartnership"; + private static final String RELATIONSHIP_SPOUSE_CIVIL = "SpouseOrCivil"; + private static final String INTESTACY_SPOUSE_INVALID_MARITAL_STATUS = "errorNotPossible"; + private static final String INTESTACY_SPOUSE_INVALID_MARITAL_STATUS_WELSH = "errorNotPossibleWelsh"; + + private final BusinessValidationMessageService businessValidationMessageService; + + public List validate(CCDData ccdData) { + + if (RELATIONSHIP_SPOUSE_CIVIL.equals(ccdData.getSolsApplicantRelationshipToDeceased()) + && !MARITAL_STATUS_MARRIED.equals(ccdData.getDeceasedMaritalStatus())) { + + return List.of( + businessValidationMessageService.generateError( + BUSINESS_ERROR, INTESTACY_SPOUSE_INVALID_MARITAL_STATUS), + businessValidationMessageService.generateError( + BUSINESS_ERROR, INTESTACY_SPOUSE_INVALID_MARITAL_STATUS_WELSH) + ); + } + + return List.of(); + } +} diff --git a/src/main/java/uk/gov/hmcts/probate/validator/CheckIntestacyOtherApplicantRule.java b/src/main/java/uk/gov/hmcts/probate/validator/CheckIntestacyOtherApplicantRule.java new file mode 100644 index 0000000000..01d5264d4d --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/validator/CheckIntestacyOtherApplicantRule.java @@ -0,0 +1,39 @@ +package uk.gov.hmcts.probate.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.Constants; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.List; + +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; + +@Component +@RequiredArgsConstructor +public class CheckIntestacyOtherApplicantRule implements ValidationRule { + + private static final String RELATIONSHIP_SPOUSE_CIVIL = "SpouseOrCivil"; + private static final String INTESTACY_SPOUSE_WITH_OTHER_APPLICANT = "errorCannotProceed"; + private static final String INTESTACY_SPOUSE_WITH_OTHER_APPLICANT_WELSH = "errorCannotProceedWelsh"; + + private final BusinessValidationMessageService businessValidationMessageService; + + public List validate(CCDData ccdData) { + + if (RELATIONSHIP_SPOUSE_CIVIL.equals(ccdData.getSolsApplicantRelationshipToDeceased()) + && Constants.YES.equals(ccdData.getOtherExecutorExists())) { + + return List.of( + businessValidationMessageService.generateError( + BUSINESS_ERROR, INTESTACY_SPOUSE_WITH_OTHER_APPLICANT), + businessValidationMessageService.generateError( + BUSINESS_ERROR, INTESTACY_SPOUSE_WITH_OTHER_APPLICANT_WELSH) + ); + } + + return List.of(); + } +} diff --git a/src/main/java/uk/gov/hmcts/probate/validator/IntestacyApplicantDetailsValidationRule.java b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyApplicantDetailsValidationRule.java new file mode 100644 index 0000000000..29ba040fdc --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyApplicantDetailsValidationRule.java @@ -0,0 +1,82 @@ +package uk.gov.hmcts.probate.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.Applicant; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.ArrayList; +import java.util.List; + +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD; +import static uk.gov.hmcts.probate.model.Constants.NO; +import static uk.gov.hmcts.probate.model.Constants.SIBLING; +import static uk.gov.hmcts.probate.model.Constants.YES; + +@Component +@RequiredArgsConstructor +public class IntestacyApplicantDetailsValidationRule implements ValidationRule { + public static final String ADOPTED_OUTSIDE_ENGLAND_OR_WALES = "adoptedOutsideEnglandOrWales"; + public static final String ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH = "adoptedOutsideEnglandOrWalesWelsh"; + public static final String DECEASED_CHILD_DEAD = "deceasedChildDead"; + public static final String DECEASED_CHILD_DEAD_WELSH = "deceasedChildDeadWelsh"; + public static final String ADOPTED_OUT = "adoptedOut"; + public static final String ADOPTED_OUT_WELSH = "adoptedOutWelsh"; + public static final String SIBLING_NOT_DIED = "siblingNotDied"; + public static final String SIBLING_NOT_DIED_WELSH = "siblingNotDiedWelsh"; + + private final BusinessValidationMessageService businessValidationMessageService; + + public List validate(CCDData ccdData) { + List errors = new ArrayList<>(); + var applicant = ccdData.getApplicant(); + if (applicant != null) { + List codes = new ArrayList<>(); + String relationshipToDeceased = ccdData.getSolsApplicantRelationshipToDeceased(); + + if (SIBLING.equalsIgnoreCase(relationshipToDeceased) && NO + .equalsIgnoreCase(applicant.getAnyLivingWholeBloodSiblings())) { + codes.add(SIBLING_NOT_DIED); + codes.add(SIBLING_NOT_DIED_WELSH); + } + + if (GRAND_CHILD.equalsIgnoreCase(relationshipToDeceased) + && NO.equalsIgnoreCase(applicant.getIsApplicantParentDeceasedChild())) { + codes.add(DECEASED_CHILD_DEAD); + codes.add(DECEASED_CHILD_DEAD_WELSH); + } + + if (isAdoptedOutsideEnglandOrWales(applicant, relationshipToDeceased)) { + codes.add(ADOPTED_OUTSIDE_ENGLAND_OR_WALES); + codes.add(ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH); + } + if (isAdoptedOut(applicant, relationshipToDeceased)) { + codes.add(ADOPTED_OUT); + codes.add(ADOPTED_OUT_WELSH); + } + + codes.forEach(code -> errors.add(businessValidationMessageService + .generateError(BUSINESS_ERROR, code))); + } + return errors; + } + + private boolean isAdoptedOutsideEnglandOrWales(Applicant applicant, String relationshipToDeceased) { + return (YES.equalsIgnoreCase(applicant.getPrimaryApplicantAdoptedIn()) + && NO.equalsIgnoreCase(applicant.getPrimaryApplicantAdoptionInEnglandOrWales())) + || (GRAND_CHILD.equalsIgnoreCase(relationshipToDeceased) + && YES.equalsIgnoreCase(applicant.getPrimaryApplicantParentAdoptedIn()) + && NO.equalsIgnoreCase(applicant.getPrimaryApplicantParentAdoptionInEnglandOrWales())); + } + + private boolean isAdoptedOut(Applicant applicant, String relationshipToDeceased) { + return (NO.equalsIgnoreCase(applicant.getPrimaryApplicantAdoptedIn()) + && YES.equalsIgnoreCase(applicant.getPrimaryApplicantAdoptedOut())) + || (GRAND_CHILD.equalsIgnoreCase(relationshipToDeceased) + && NO.equalsIgnoreCase(applicant.getPrimaryApplicantParentAdoptedIn()) + && YES.equalsIgnoreCase(applicant.getPrimaryApplicantParentAdoptedOut())); + } +} diff --git a/src/main/java/uk/gov/hmcts/probate/validator/IntestacyCoApplicantValidationRule.java b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyCoApplicantValidationRule.java new file mode 100644 index 0000000000..bd01346232 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyCoApplicantValidationRule.java @@ -0,0 +1,112 @@ +package uk.gov.hmcts.probate.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.model.ccd.raw.SolsApplicantFamilyDetails; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +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.CHILD; +import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_NIECE_OR_NEPHEW; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_NIECE_OR_NEPHEW; + +@Component +@RequiredArgsConstructor +public class IntestacyCoApplicantValidationRule implements ValidationRule { + public static final String ADOPTED_OUTSIDE_ENGLAND_OR_WALES = "adoptedOutsideEnglandOrWales"; + public static final String ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH = "adoptedOutsideEnglandOrWalesWelsh"; + public static final String ADOPTED_OUT = "coApplicantAdoptedOut"; + public static final String ADOPTED_OUT_WELSH = "coApplicantAdoptedOutWelsh"; + public static final String PARENT_IS_NOT_DECEASED = "parentIsNotDeceased"; + public static final String PARENT_IS_NOT_DECEASED_WELSH = "parentIsNotDeceasedWelsh"; + public static final String PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES = "coApplicantParentAdoptedOut"; + public static final String PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH = "coApplicantParentAdoptedOutWelsh"; + + private final BusinessValidationMessageService businessValidationMessageService; + + public List validate(CCDData ccdData) { + List errors = new ArrayList<>(); + Optional.ofNullable(ccdData.getExecutors()).ifPresent(executors -> { + for (var executor : executors) { + var details = executor.getApplicantFamilyDetails(); + if (details == null) { + continue; + } + List codes = new ArrayList<>(); + String coApplicantAdoptedOut = details.getCoApplicantAdoptedOut(); + String coApplicantAdoptedIn = details.getCoApplicantAdoptedIn(); + String grandchildParentIsDeceased = details.getGrandchildParentDieBeforeDeceased(); + String wholeNieceOrNephewParentIsDeceased = details.getWholeNieceOrNephewParentDieBeforeDeceased(); + String halfNieceOrNephewParentIsDeceased = details.getHalfNieceOrNephewParentDieBeforeDeceased(); + String relationshipToDeceased = null != details.getRelationship() ? details + .getRelationship().getValueCode() : null; + boolean isNonParentRelation = isNonParentRelation(relationshipToDeceased); + + if (isAdoptedOutsideEnglandOrWales(isNonParentRelation, relationshipToDeceased, details)) { + codes.add(ADOPTED_OUTSIDE_ENGLAND_OR_WALES); + codes.add(ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH); + } + if (isNonParentRelation && NO.equalsIgnoreCase(coApplicantAdoptedIn) + && YES.equalsIgnoreCase(coApplicantAdoptedOut)) { + codes.add(ADOPTED_OUT); + codes.add(ADOPTED_OUT_WELSH); + } + if (isParentNotDeceased(relationshipToDeceased, grandchildParentIsDeceased, + wholeNieceOrNephewParentIsDeceased, halfNieceOrNephewParentIsDeceased)) { + codes.add(PARENT_IS_NOT_DECEASED); + codes.add(PARENT_IS_NOT_DECEASED_WELSH); + } + if (GRAND_CHILD.equalsIgnoreCase(relationshipToDeceased) + && NO.equalsIgnoreCase(details.getGrandchildParentAdoptedIn()) + && YES.equalsIgnoreCase(details.getGrandchildParentAdoptedOut())) { + codes.add(PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES); + codes.add(PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH); + } + + codes.forEach(code -> errors.add(businessValidationMessageService + .generateError(BUSINESS_ERROR, code))); + } + }); + return errors; + } + + private boolean isParentNotDeceased(String relationshipToDeceased, String grandchildParentIsDeceased, + String wholeNieceOrNephewParentIsDeceased, + String halfNieceOrNephewParentIsDeceased) { + return (GRAND_CHILD.equalsIgnoreCase(relationshipToDeceased) && NO.equalsIgnoreCase(grandchildParentIsDeceased)) + || (WHOLE_BLOOD_NIECE_OR_NEPHEW.equalsIgnoreCase(relationshipToDeceased) + && NO.equalsIgnoreCase(wholeNieceOrNephewParentIsDeceased)) + || (HALF_BLOOD_NIECE_OR_NEPHEW.equalsIgnoreCase(relationshipToDeceased) + && NO.equalsIgnoreCase(halfNieceOrNephewParentIsDeceased)); + } + + private boolean isAdoptedOutsideEnglandOrWales(boolean isNonParentRelation, String relationshipToDeceased, + SolsApplicantFamilyDetails details) { + return (isNonParentRelation && YES.equalsIgnoreCase(details.getCoApplicantAdoptedIn()) + && NO.equalsIgnoreCase(details.getCoApplicantAdoptionInEnglandOrWales())) + || (GRAND_CHILD.equalsIgnoreCase(relationshipToDeceased) + && YES.equalsIgnoreCase(details.getGrandchildParentAdoptedIn()) + && NO.equalsIgnoreCase(details.getGrandchildParentAdoptionInEnglandOrWales())); + } + + private static boolean isNonParentRelation(String relationshipToDeceased) { + + return CHILD.equalsIgnoreCase(relationshipToDeceased) + || GRAND_CHILD.equalsIgnoreCase(relationshipToDeceased) + || WHOLE_BLOOD_SIBLING.equalsIgnoreCase(relationshipToDeceased) + || HALF_BLOOD_SIBLING.equalsIgnoreCase(relationshipToDeceased) + || WHOLE_BLOOD_NIECE_OR_NEPHEW.equalsIgnoreCase(relationshipToDeceased) + || HALF_BLOOD_NIECE_OR_NEPHEW.equalsIgnoreCase(relationshipToDeceased); + } +} diff --git a/src/main/java/uk/gov/hmcts/probate/validator/IntestacyDeceasedDetailsValidationRule.java b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyDeceasedDetailsValidationRule.java new file mode 100644 index 0000000000..8035321902 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyDeceasedDetailsValidationRule.java @@ -0,0 +1,65 @@ +package uk.gov.hmcts.probate.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.ArrayList; +import java.util.List; + +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.model.Constants.NO; +import static uk.gov.hmcts.probate.model.Constants.PARENT; +import static uk.gov.hmcts.probate.model.Constants.SIBLING; +import static uk.gov.hmcts.probate.model.Constants.YES; + +@Component +@RequiredArgsConstructor +public class IntestacyDeceasedDetailsValidationRule implements ValidationRule { + public static final String ADOPTED_OUTSIDE_ENGLAND_OR_WALES = "adoptedOutsideEnglandOrWales"; + public static final String ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH = "adoptedOutsideEnglandOrWalesWelsh"; + public static final String DECEASED_ADOPTED_OUT = "deceasedAdoptedOut"; + public static final String DECEASED_ADOPTED_OUT_WELSH = "deceasedAdoptedOutWelsh"; + public static final String LIVING_DESCENDANTS = "livingDescendants"; + public static final String LIVING_DESCENDANTS_WELSH = "livingDescendantsWelsh"; + public static final String LIVING_PARENTS = "livingParents"; + public static final String LIVING_PARENTS_WELSH = "livingParentsWelsh"; + + private final BusinessValidationMessageService businessValidationMessageService; + + public List validate(CCDData ccdData) { + List errors = new ArrayList<>(); + var deceased = ccdData.getDeceased(); + if (deceased != null) { + List codes = new ArrayList<>(); + + String relationship = ccdData.getSolsApplicantRelationshipToDeceased(); + boolean isSibling = SIBLING.equalsIgnoreCase(relationship); + boolean isSiblingOrParent = isSibling || PARENT.equalsIgnoreCase(relationship); + + if (isSiblingOrParent && YES.equalsIgnoreCase(deceased.getDeceasedAnyLivingDescendants())) { + codes.add(LIVING_DESCENDANTS); + codes.add(LIVING_DESCENDANTS_WELSH); + } + if (isSibling && YES.equalsIgnoreCase(deceased.getDeceasedAnyLivingParents())) { + codes.add(LIVING_PARENTS); + codes.add(LIVING_PARENTS_WELSH); + } + if (isSiblingOrParent && YES.equalsIgnoreCase(deceased.getDeceasedAdoptedIn()) + && NO.equalsIgnoreCase(deceased.getDeceasedAdoptionInEnglandOrWales())) { + codes.add(ADOPTED_OUTSIDE_ENGLAND_OR_WALES); + codes.add(ADOPTED_OUTSIDE_ENGLAND_OR_WALES_WELSH); + } + if (isSiblingOrParent && NO.equalsIgnoreCase(deceased.getDeceasedAdoptedIn()) + && YES.equalsIgnoreCase(deceased.getDeceasedAdoptedOut())) { + codes.add(DECEASED_ADOPTED_OUT); + codes.add(DECEASED_ADOPTED_OUT_WELSH); + } + codes.forEach(code -> errors.add(businessValidationMessageService + .generateError(BUSINESS_ERROR, code))); + } + return errors; + } +} diff --git a/src/main/java/uk/gov/hmcts/probate/validator/IntestacyDivorceOrSeparationValidationRule.java b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyDivorceOrSeparationValidationRule.java new file mode 100644 index 0000000000..384a7d9538 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/probate/validator/IntestacyDivorceOrSeparationValidationRule.java @@ -0,0 +1,51 @@ +package uk.gov.hmcts.probate.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; +import static uk.gov.hmcts.reform.probate.model.cases.MaritalStatus.Constants.DIVORCED_VALUE; +import static uk.gov.hmcts.reform.probate.model.cases.MaritalStatus.Constants.JUDICIALLY_SEPARATED_VALUE; + +import java.util.ArrayList; +import java.util.List; + +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.model.Constants.NO; + +@Component +@RequiredArgsConstructor +public class IntestacyDivorceOrSeparationValidationRule implements ValidationRule { + public static final String DIVORCED_OUTSIDE_ENGLAND_OR_WALES = "divorcedOutsideEnglandOrWales"; + public static final String DIVORCED_OUTSIDE_ENGLAND_OR_WALES_WELSH = "divorcedOutsideEnglandOrWalesWelsh"; + public static final String SEPARATED_OUTSIDE_ENGLAND_OR_WALES = "separatedOutsideEnglandOrWales"; + public static final String SEPARATED_OUTSIDE_ENGLAND_OR_WALES_WELSH = "separatedOutsideEnglandOrWalesWelsh"; + + private final BusinessValidationMessageService businessValidationMessageService; + + public List validate(CCDData ccdData) { + List errors = new ArrayList<>(); + var deceased = ccdData.getDeceased(); + if (deceased != null) { + List codes = new ArrayList<>(); + String deceasedMaritalStatus = deceased.getDeceasedMaritalStatus(); + String deceasedDivorcedInEnglandOrWales = deceased.getDeceasedDivorcedInEnglandOrWales(); + + if (DIVORCED_VALUE.equals(deceasedMaritalStatus) + && NO.equalsIgnoreCase(deceasedDivorcedInEnglandOrWales)) { + codes.add(DIVORCED_OUTSIDE_ENGLAND_OR_WALES); + codes.add(DIVORCED_OUTSIDE_ENGLAND_OR_WALES_WELSH); + } else if (JUDICIALLY_SEPARATED_VALUE.equals(deceasedMaritalStatus) + && NO.equalsIgnoreCase(deceasedDivorcedInEnglandOrWales)) { + codes.add(SEPARATED_OUTSIDE_ENGLAND_OR_WALES); + codes.add(SEPARATED_OUTSIDE_ENGLAND_OR_WALES_WELSH); + } + + for (String code : codes) { + errors.add(businessValidationMessageService.generateError(BUSINESS_ERROR, code)); + } + } + return errors; + } +} diff --git a/src/main/resources/ValidationMessages.properties b/src/main/resources/ValidationMessages.properties index 609e0664ca..46f02dd22c 100644 --- a/src/main/resources/ValidationMessages.properties +++ b/src/main/resources/ValidationMessages.properties @@ -204,3 +204,30 @@ caveatNotificationEvent=If you need to inform the applicant of a caveat stop, yo 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 notAllowedStopReason=You cannot use stop reason **NOT TO BE USED (Other)**. You must select a specific stop reason from the case stop reason list +errorCannotProceed=A joint application is not possible if the main applicant is the deceased's husband, wife or civil partner.\nIn some cases, the deceased's child can be a joint applicant. Use Form PA1A to apply by post instead. +errorCannotProceedWelsh=Nid yw cais ar y cyd yn bosibl os yw''r prif geisydd yn \u0175r, gwraig neu bartner sifil yr ymadawedig.\nMewn rhai achosion, gall plentyn yr ymadawedig fod yn geisydd ar y cyd. Yn hytrach, bydd angen ichi wneud cais drwy'r post drwy ddefnyddio Ffurflen PA1A. +errorNotPossible=The selected marital status is not possible if the applicant is the deceased's husband, wife or civil partner. +errorNotPossibleWelsh=Nid yw'r statws priodasol a ddewiswyd yn bosibl os yw'r ceisydd yn \u0175r, gwraig neu bartner sifil yr ymadawedig. +adoptedOutsideEnglandOrWales=You cannot use the online service if the adoption took place outside of England and Wales. You should apply by post using Form PA1A instead. +adoptedOutsideEnglandOrWalesWelsh=Ni allwch ddefnyddio''r gwasanaeth ar-lein os digwyddodd y mabwysiadu y tu allan i Gymru a Lloegr. Yn hytrach, dylech wneud cais drwy''r post trwy lenwi Ffurflen PA1A. +adoptedOut=You cannot use the online service if the applicant was adopted out of the family. You should apply by post using Form PA1A instead. +adoptedOutWelsh=Ni allwch ddefnyddio''r gwasanaeth ar-lein os cafodd y ceisydd eu mabwysiadu allan o''r teulu. Yn hytrach, dylech wneud cais drwy''r post trwy lenwi Ffurflen PA1A. +coApplicantAdoptedOut=You cannot use the online service if the co-applicant was adopted out of the family. You should apply by post using Form PA1A instead. +coApplicantAdoptedOutWelsh=Ni allwch ddefnyddio''r gwasanaeth ar-lein os cafodd y cyd-geisydd eu mabwysiadu allan o''r teulu. Yn hytrach, dylech wneud cais drwy''r post trwy lenwi Ffurflen PA1A. +deceasedAdoptedOut=You cannot use the online service if the deceased was adopted out of the family. You should apply by post using Form PA1A instead. +deceasedAdoptedOutWelsh=Ni allwch ddefnyddio''r gwasanaeth ar-lein os cafodd yr ymadawedig eu mabwysiadu allan o''r teulu. Yn hytrach, dylech wneud cais drwy''r post trwy lenwi Ffurflen PA1A. +parentIsNotDeceased=This co-applicant is not entitled to apply. Remove this co-applicant to proceed with the application. +parentIsNotDeceasedWelsh=Nid oes gan y cyd-geisydd hawl i wneud cais. Dylech ddileu'r cyd-geisydd hwn i barhau �''r cais. +divorcedOutsideEnglandOrWales=You cannot use the online service if the divorce or dissolution took place outside of England and Wales. You should apply by post using Form PA1A instead. +divorcedOutsideEnglandOrWalesWelsh=Ni allwch ddefnyddio''r gwasanaeth ar-lein os digwyddodd yr ysgariad neu''r diddymiad y tu allan i Gymru a Lloegr. Yn hytrach, dylech wneud cais drwy''r post trwy lenwi Ffurflen PA1A. +separatedOutsideEnglandOrWales=You cannot use the online service if the judicial separation took place outside of England and Wales. You should apply by post using Form PA1A instead. +separatedOutsideEnglandOrWalesWelsh=Ni allwch ddefnyddio''r gwasanaeth ar-lein os digwyddodd yr ymwahaniad barnwrol y tu allan i Gymru a Lloegr. Yn hytrach, dylech wneud cais drwy''r post trwy lenwi Ffurflen PA1A. +deceasedChildDead=The applicant is not entitled to apply if their parent is not a deceased child of the deceased. +deceasedChildDeadWelsh=Nid oes gan y ceisydd hawl i wneud cais os nad yw eu rhiant yn blentyn sydd wedi marw i''r ymadawedig. +siblingNotDied=The applicant is not entitled to apply if there are any living whole blood siblings of the deceased. +siblingNotDiedWelsh=Nid oes gan y ceisydd hawl i wneud cais os oes yna frawd neu chwaer gwaed cyfan yr ymadawedig yn fyw. +livingDescendants=The applicant is not entitled to apply if there are any living children, grandchildren or great-grandchildren of the deceased. +livingDescendantsWelsh=Nid oes gan y ceisydd hawl gwneud cais os oes yna unrhyw blant, wyrion neu orwyrion yr ymadawedig yn fyw. +livingParents=The applicant is not entitled to apply if there are any living parents of the deceased. +livingParentsWelsh=Nid oes gan y ceisydd hawl i wneud cais os oes yna unrhyw rieni''r ymadawedig yn fyw. + diff --git a/src/main/resources/templates/printService/caseDetailsSOL.html b/src/main/resources/templates/printService/caseDetailsSOL.html index 190c081c00..ef41847145 100644 --- a/src/main/resources/templates/printService/caseDetailsSOL.html +++ b/src/main/resources/templates/printService/caseDetailsSOL.html @@ -320,7 +320,19 @@

Application for probate for {{ names(case_data.deceasedForenames,case_data.d   {% endif %} - {% if case_data.executorsApplying | length == 0 %} + {% if case_data.executorsApplying | length == 0 && case_data.caseType == 'intestacy' %} + {% for additionalExecutor in case_data.solsIntestacyExecutorList %} + {% if additionalExecutor.value.additionalApplying == "Yes" %}{% set applying = applying + 1 %} + + Executor {{ applying }} name: + {{ names(additionalExecutor.value.additionalExecForenames,additionalExecutor.value.additionalExecLastname) }} + + {% if additionalExecutor.value.additionalExecAddress %} + {{address(additionalExecutor.value.additionalExecAddress)}} + {% endif %} +   + {% endif %}{% endfor %} + {% elseif case_data.executorsApplying | length == 0 && case_data.caseType != 'intestacy' %} {% for additionalExecutor in case_data.solsAdditionalExecutorList %} {% if additionalExecutor.value.additionalApplying == "Yes" %}{% set applying = applying + 1 %} @@ -346,7 +358,6 @@

Application for probate for {{ names(case_data.deceasedForenames,case_data.d   {% endfor %} {% endif %} - {% if case_data.executorsApplying | length >= 1 %} Primary Applicant Alias diff --git a/src/test/PlaywrightTest/Path/caseworker/caveatPath.spec.js b/src/test/PlaywrightTest/Path/caseworker/caveatPath.spec.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/PlaywrightTest/Path/caseworker/caveatPath3.spec.js b/src/test/PlaywrightTest/Path/caseworker/caveatPath3.spec.js new file mode 100644 index 0000000000..e69de29bb2 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 7f510eab6e..0c87cdefc5 100644 --- a/src/test/java/uk/gov/hmcts/probate/controller/BusinessValidationUnitTest.java +++ b/src/test/java/uk/gov/hmcts/probate/controller/BusinessValidationUnitTest.java @@ -46,6 +46,8 @@ 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.CheckIntestacyMaritalStatusRule; +import uk.gov.hmcts.probate.validator.CheckIntestacyOtherApplicantRule; import uk.gov.hmcts.probate.validator.CheckListAmendCaseValidationRule; import uk.gov.hmcts.probate.validator.ChangeToSameStateValidationRule; import uk.gov.hmcts.probate.validator.CodicilDateValidationRule; @@ -55,6 +57,10 @@ import uk.gov.hmcts.probate.validator.IHTFourHundredDateValidationRule; import uk.gov.hmcts.probate.validator.IHTValidationRule; import uk.gov.hmcts.probate.validator.IhtEstateValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyApplicantDetailsValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyDeceasedDetailsValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyCoApplicantValidationRule; +import uk.gov.hmcts.probate.validator.IntestacyDivorceOrSeparationValidationRule; import uk.gov.hmcts.probate.validator.NaValidationRule; import uk.gov.hmcts.probate.validator.NumberOfApplyingExecutorsValidationRule; import uk.gov.hmcts.probate.validator.OriginalWillSignedDateValidationRule; @@ -205,12 +211,24 @@ class BusinessValidationUnitTest { @Mock private IHTFormIDValidationRule ihtFormIDValidationRule; @Mock + private IntestacyDeceasedDetailsValidationRule intestacyDeceasedDetailsValidationRule; + @Mock + private IntestacyApplicantDetailsValidationRule intestacyApplicantDetailsValidationRule; + @Mock + private IntestacyCoApplicantValidationRule intestacyCoApplicantValidationRule; + @Mock + private IntestacyDivorceOrSeparationValidationRule intestacyDivorceOrSeparationValidationRule; + @Mock private Pre1900DOBValidationRule pre1900DOBValidationRuleMock; @Mock private BusinessValidationMessageService businessValidationMessageServiceMock; @Mock private AdColligendaBonaCaseTypeValidationRule adColligendaBonaCaseTypeValidationRule; @Mock + private CheckIntestacyMaritalStatusRule checkIntestacyMaritalStatusRule; + @Mock + private CheckIntestacyOtherApplicantRule checkIntestacyOtherApplicantRule; + @Mock private UserInfoService userInfoServiceMock; @Mock private ZeroApplyingExecutorsValidationRule zeroApplyingExecutorsValidationRule; @@ -260,6 +278,12 @@ public void setUp() { pre1900DOBValidationRuleMock, adColligendaBonaCaseTypeValidationRule, zeroApplyingExecutorsValidationRule, + checkIntestacyOtherApplicantRule, + checkIntestacyMaritalStatusRule, + intestacyDeceasedDetailsValidationRule, + intestacyApplicantDetailsValidationRule, + intestacyDivorceOrSeparationValidationRule, + intestacyCoApplicantValidationRule, businessValidationMessageServiceMock, userInfoServiceMock, documentTransformerMock); @@ -1419,4 +1443,65 @@ void shouldClearSiblingFields() { .clearFieldsBasedOnRelationships(callbackRequestMock); assertThat(response.getStatusCode(), is(HttpStatus.OK)); } + + @Test + void shouldValidateIntestacyApplicantAndSetupDynamicListWithNoErrors() { + when(callbackRequestMock.getCaseDetails()).thenReturn(caseDetailsMock); + when(eventValidationServiceMock.validateRequest(eq(callbackRequestMock), any())) + .thenReturn(callbackResponseMock); + when(callbackResponseMock.getErrors()).thenReturn(Collections.emptyList()); + CallbackResponse transformedResponse = mock(CallbackResponse.class); + when(callbackResponseTransformerMock.setupDynamicList(callbackRequestMock)) + .thenReturn(transformedResponse); + + ResponseEntity response = underTest + .validateIntestacyApplicantAndSetupDynamicList(callbackRequestMock, httpServletRequest); + + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals(transformedResponse, response.getBody()); + } + + @Test + void shouldValidateIntestacyApplicantAndSetupDynamicListWithErrors() { + when(callbackRequestMock.getCaseDetails()).thenReturn(caseDetailsMock); + when(eventValidationServiceMock.validateRequest(eq(callbackRequestMock), any())) + .thenReturn(callbackResponseMock); + when(callbackResponseMock.getErrors()).thenReturn(List.of("error")); + + ResponseEntity response = underTest + .validateIntestacyApplicantAndSetupDynamicList(callbackRequestMock, httpServletRequest); + + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals(callbackResponseMock, response.getBody()); + } + + @Test + void shouldValidateIntestacyCoApplicantWithNoErrors() { + when(callbackRequestMock.getCaseDetails()).thenReturn(caseDetailsMock); + when(eventValidationServiceMock.validateRequest(eq(callbackRequestMock), any())) + .thenReturn(callbackResponseMock); + when(callbackResponseMock.getErrors()).thenReturn(Collections.emptyList()); + CallbackResponse transformedResponse = mock(CallbackResponse.class); + when(callbackResponseTransformerMock.setupDynamicList(callbackRequestMock)) + .thenReturn(transformedResponse); + + ResponseEntity response = underTest + .validateIntestacyCoApplicants(callbackRequestMock, httpServletRequest); + + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(callbackResponseTransformerMock).transformCase(callbackRequestMock, Optional.empty()); + } + + @Test + void shouldValidateIntestacyCoApplicantWithErrors() { + when(callbackRequestMock.getCaseDetails()).thenReturn(caseDetailsMock); + when(eventValidationServiceMock.validateRequest(eq(callbackRequestMock), any())) + .thenReturn(callbackResponseMock); + when(callbackResponseMock.getErrors()).thenReturn(List.of("error")); + + ResponseEntity response = underTest + .validateIntestacyCoApplicants(callbackRequestMock, httpServletRequest); + + assertEquals(HttpStatus.OK, response.getStatusCode()); + } } 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 495efc7f5b..3c5d7d007d 100644 --- a/src/test/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformerTest.java +++ b/src/test/java/uk/gov/hmcts/probate/transformer/CallbackResponseTransformerTest.java @@ -37,12 +37,16 @@ import uk.gov.hmcts.probate.model.ccd.raw.DocumentLink; import uk.gov.hmcts.probate.model.ccd.raw.DynamicList; import uk.gov.hmcts.probate.model.ccd.raw.DynamicListItem; +import uk.gov.hmcts.probate.model.ccd.raw.DynamicRadioList; +import uk.gov.hmcts.probate.model.ccd.raw.DynamicRadioListElement; import uk.gov.hmcts.probate.model.ccd.raw.EstateItem; +import uk.gov.hmcts.probate.model.ccd.raw.IntestacyAdditionalExecutor; import uk.gov.hmcts.probate.model.ccd.raw.Payment; import uk.gov.hmcts.probate.model.ccd.raw.ProbateAliasName; import uk.gov.hmcts.probate.model.ccd.raw.RegistrarDirection; import uk.gov.hmcts.probate.model.ccd.raw.ScannedDocument; import uk.gov.hmcts.probate.model.ccd.raw.SolsAddress; +import uk.gov.hmcts.probate.model.ccd.raw.SolsApplicantFamilyDetails; import uk.gov.hmcts.probate.model.ccd.raw.StopReason; import uk.gov.hmcts.probate.model.ccd.raw.UploadDocument; import uk.gov.hmcts.probate.model.ccd.raw.request.CallbackRequest; @@ -134,6 +138,7 @@ 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.Constants.PARENT; 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; @@ -5189,6 +5194,69 @@ void shouldNotClearFieldsWhenSameParentsOptionIsUnchanged() { assertNotNull(callbackResponse.getData().getOtherHalfBloodSiblings()); } + @Test + void shouldSetupNewDynamicListForParentRelationship() { + caseDataBuilder.solsApplicantRelationshipToDeceased("parent") + .otherExecutorExists("Yes"); + caseDataBuilderBefore.solsApplicantRelationshipToDeceased("child"); + + when(callbackRequestMock.getCaseDetails()).thenReturn(caseDetailsMock); + when(callbackRequestMock.getCaseDetailsBefore()).thenReturn(caseDetailsBeforeMock); + when(caseDetailsMock.getData()).thenReturn(caseDataBuilder.build()); + when(caseDetailsBeforeMock.getData()).thenReturn(caseDataBuilderBefore.build()); + + CallbackResponse response = underTest.setupDynamicList(callbackRequestMock); + + List> executorList = + response.getData().getSolsIntestacyExecutorList(); + assertNotNull(executorList); + assertEquals(1, executorList.size()); + IntestacyAdditionalExecutor executor = executorList.get(0).getValue(); + assertNotNull(executor.getSolsApplicantFamilyDetails()); + DynamicRadioList relationshipList = executor.getSolsApplicantFamilyDetails().getRelationship(); + assertNotNull(relationshipList); + assertEquals(1, relationshipList.getListItems().size()); + assertEquals(PARENT, relationshipList.getListItems().getFirst().getCode()); + } + + @Test + void shouldSetupDynamicListWithExistingExecutorList() { + DynamicRadioListElement radioListElement = DynamicRadioListElement.builder() + .code("child") + .label("Child") + .build(); + DynamicRadioList radioList = DynamicRadioList.builder() + .listItems(List.of(radioListElement)) + .value(radioListElement) + .build(); + SolsApplicantFamilyDetails familyDetails = SolsApplicantFamilyDetails.builder() + .relationship(radioList) + .build(); + IntestacyAdditionalExecutor existingExecutor = IntestacyAdditionalExecutor.builder() + .solsApplicantFamilyDetails(familyDetails) + .build(); + List> existingExecutorList = + List.of(new CollectionMember<>(existingExecutor)); + + caseDataBuilder.solsApplicantRelationshipToDeceased("child") + .otherExecutorExists("Yes"); + caseDataBuilderBefore.solsApplicantRelationshipToDeceased("child") + .solsIntestacyExecutorList(existingExecutorList); + + when(callbackRequestMock.getCaseDetails()).thenReturn(caseDetailsMock); + when(callbackRequestMock.getCaseDetailsBefore()).thenReturn(caseDetailsBeforeMock); + when(caseDetailsMock.getData()).thenReturn(caseDataBuilder.build()); + when(caseDetailsBeforeMock.getData()).thenReturn(caseDataBuilderBefore.build()); + + CallbackResponse response = underTest.setupDynamicList(callbackRequestMock); + + List> executorList = + response.getData().getSolsIntestacyExecutorList(); + assertNotNull(executorList); + assertEquals(1, executorList.size()); + assertEquals(existingExecutor, executorList.getFirst().getValue()); + } + private String format(DateTimeFormatter formatter, ResponseCaseData caseData, int ind) { return formatter.format(caseData.getRegistrarDirections().get(ind).getValue().getAddedDateTime()); } diff --git a/src/test/java/uk/gov/hmcts/probate/transformer/CaseDataTransformerTest.java b/src/test/java/uk/gov/hmcts/probate/transformer/CaseDataTransformerTest.java index 8639916646..410f75eb95 100644 --- a/src/test/java/uk/gov/hmcts/probate/transformer/CaseDataTransformerTest.java +++ b/src/test/java/uk/gov/hmcts/probate/transformer/CaseDataTransformerTest.java @@ -100,6 +100,15 @@ void shouldTransformForValidateProbate() { verify(solicitorApplicationCompletionTransformer).eraseCodicilAddedDateIfWillHasNoCodicils(caseDataMock); } + @Test + void shouldTransformForValidateIntestacy() { + caseDataTransformer.transformCaseDataForValidateIntestacy(callbackRequestMock); + + verify(solicitorApplicationCompletionTransformer) + .setFieldsIfSolicitorIsNotNamedInWillAsAnExecutor(caseDataMock); + verify(solicitorApplicationCompletionTransformer).mapSolicitorExecutorFieldsOnAppDetailsComplete(caseDataMock); + } + @Test void shouldTransformCaseDataForSolicitorExecutorNames() { caseDataTransformer.transformCaseDataForSolicitorExecutorNames(callbackRequestMock); diff --git a/src/test/java/uk/gov/hmcts/probate/validator/CheckIntestacyMaritalStatusRuleTest.java b/src/test/java/uk/gov/hmcts/probate/validator/CheckIntestacyMaritalStatusRuleTest.java new file mode 100644 index 0000000000..ae9ac1e433 --- /dev/null +++ b/src/test/java/uk/gov/hmcts/probate/validator/CheckIntestacyMaritalStatusRuleTest.java @@ -0,0 +1,73 @@ +package uk.gov.hmcts.probate.validator; + +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.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.when; +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; + + +class CheckIntestacyMaritalStatusRuleTest { + + @InjectMocks + private CheckIntestacyMaritalStatusRule underTest; + + @Mock + private BusinessValidationMessageService businessValidationMessageServiceMock; + + private FieldErrorResponse errorEnglish; + private FieldErrorResponse errorWelsh; + + @BeforeEach + public void setUp() { + MockitoAnnotations.openMocks(this); + + errorEnglish = FieldErrorResponse.builder().message("errorNotPossible").build(); + errorWelsh = FieldErrorResponse.builder().message("errorNotPossibleWelsh").build(); + + when(businessValidationMessageServiceMock.generateError(eq(BUSINESS_ERROR), + eq("errorNotPossible"))).thenReturn(errorEnglish); + when(businessValidationMessageServiceMock.generateError(eq(BUSINESS_ERROR), + eq("errorNotPossibleWelsh"))).thenReturn(errorWelsh); + + } + + @Test + void shouldReturnErrors_whenApplicantIsSpouseAndDeceasedDivorced() { + CCDData ccdData = CCDData.builder() + .solsApplicantRelationshipToDeceased("SpouseOrCivil") + .deceasedMaritalStatus("divorcedCivilPartnership") + .build(); + List errors = underTest.validate(ccdData); + + assertEquals(2, errors.size()); + assertEquals("errorNotPossible", errors.get(0).getMessage()); + assertEquals("errorNotPossibleWelsh", errors.get(1).getMessage()); + } + + @Test + void shouldReturnEmptyList_whenApplicantIsSpouseAndDeceasedMarried() { + CCDData ccdData = CCDData.builder() + .solsApplicantRelationshipToDeceased("SpouseOrCivil") + .deceasedMaritalStatus("marriedCivilPartnership") + .build(); + List errors = underTest.validate(ccdData); + + assertTrue(errors.isEmpty()); + verifyNoInteractions(businessValidationMessageServiceMock); + } + +} + diff --git a/src/test/java/uk/gov/hmcts/probate/validator/CheckIntestacyOtherApplicantRuleTest.java b/src/test/java/uk/gov/hmcts/probate/validator/CheckIntestacyOtherApplicantRuleTest.java new file mode 100644 index 0000000000..8256a267cc --- /dev/null +++ b/src/test/java/uk/gov/hmcts/probate/validator/CheckIntestacyOtherApplicantRuleTest.java @@ -0,0 +1,73 @@ +package uk.gov.hmcts.probate.validator; + +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.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.when; +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; + + +class CheckIntestacyOtherApplicantRuleTest { + + @InjectMocks + private CheckIntestacyOtherApplicantRule underTest; + + @Mock + private BusinessValidationMessageService businessValidationMessageServiceMock; + + private FieldErrorResponse errorEnglish; + private FieldErrorResponse errorWelsh; + + @BeforeEach + public void setUp() { + MockitoAnnotations.openMocks(this); + + errorEnglish = FieldErrorResponse.builder().message("errorCannotProceed").build(); + errorWelsh = FieldErrorResponse.builder().message("errorCannotProceedWelsh").build(); + + when(businessValidationMessageServiceMock.generateError(eq(BUSINESS_ERROR), + eq("errorCannotProceed"))).thenReturn(errorEnglish); + when(businessValidationMessageServiceMock.generateError(eq(BUSINESS_ERROR), + eq("errorCannotProceedWelsh"))).thenReturn(errorWelsh); + + } + + @Test + void shouldReturnErrorWhenSpouseApplicationWithOtherApplicant() { + CCDData ccdData = CCDData.builder() + .solsApplicantRelationshipToDeceased("SpouseOrCivil") + .otherExecutorExists("Yes") + .build(); + List errors = underTest.validate(ccdData); + + assertEquals(2, errors.size()); + assertEquals("errorCannotProceed", errors.get(0).getMessage()); + assertEquals("errorCannotProceedWelsh", errors.get(1).getMessage()); + } + + @Test + void shouldNoErrorWhenSpouseApplicationWithoutOtherApplicant() { + CCDData ccdData = CCDData.builder() + .solsApplicantRelationshipToDeceased("SpouseOrCivil") + .otherExecutorExists("No") + .build(); + List errors = underTest.validate(ccdData); + + assertTrue(errors.isEmpty()); + verifyNoInteractions(businessValidationMessageServiceMock); + } + +} + diff --git a/src/test/java/uk/gov/hmcts/probate/validator/IntestacyApplicantDetailsValidationRuleTest.java b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyApplicantDetailsValidationRuleTest.java new file mode 100644 index 0000000000..d0880aa8c2 --- /dev/null +++ b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyApplicantDetailsValidationRuleTest.java @@ -0,0 +1,202 @@ +package uk.gov.hmcts.probate.validator; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.Mock; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.model.ccd.Applicant; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; +import java.util.List; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.never; +import static uk.gov.hmcts.probate.model.Constants.CHILD; +import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD; +import static uk.gov.hmcts.probate.model.Constants.NO; +import static uk.gov.hmcts.probate.model.Constants.SIBLING; +import static uk.gov.hmcts.probate.model.Constants.YES; +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.validator.IntestacyApplicantDetailsValidationRule.ADOPTED_OUTSIDE_ENGLAND_OR_WALES; +import static uk.gov.hmcts.probate.validator.IntestacyApplicantDetailsValidationRule.ADOPTED_OUT; +import static uk.gov.hmcts.probate.validator.IntestacyApplicantDetailsValidationRule.SIBLING_NOT_DIED; +import static uk.gov.hmcts.probate.validator.IntestacyApplicantDetailsValidationRule.DECEASED_CHILD_DEAD; + + + +@ExtendWith(SpringExtension.class) +class IntestacyApplicantDetailsValidationRuleTest { + + @Mock + private BusinessValidationMessageService businessValidationMessageService; + + @Mock + private CCDData ccdDataMock; + + @Mock + private Applicant applicantMock; + + private IntestacyApplicantDetailsValidationRule underTest; + + @BeforeEach + public void setUp() { + underTest = new IntestacyApplicantDetailsValidationRule(businessValidationMessageService); + when(ccdDataMock.getApplicant()).thenReturn(applicantMock); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, DECEASED_CHILD_DEAD)) + .thenReturn(FieldErrorResponse.builder().code(DECEASED_CHILD_DEAD).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, ADOPTED_OUTSIDE_ENGLAND_OR_WALES)) + .thenReturn(FieldErrorResponse.builder().code(ADOPTED_OUTSIDE_ENGLAND_OR_WALES).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, ADOPTED_OUT)) + .thenReturn(FieldErrorResponse.builder().code(ADOPTED_OUT).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, SIBLING_NOT_DIED)) + .thenReturn(FieldErrorResponse.builder().code(SIBLING_NOT_DIED).build()); + } + + private static Stream relationship() { + return Stream.of(CHILD, GRAND_CHILD, SIBLING); + } + + @Test + void testValidateWithSuccessWhenApplicantIsNull() { + when(ccdDataMock.getApplicant()).thenReturn(null); + + List validationError = underTest.validate(ccdDataMock); + + verify(businessValidationMessageService, never()).generateError(any(String.class), any(String.class)); + assertTrue(validationError.isEmpty()); + } + + @Test + void shouldValidateFailureIfDeceasedChildDead() { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(GRAND_CHILD); + when(applicantMock.getIsApplicantParentDeceasedChild()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(DECEASED_CHILD_DEAD, validationErrors.getFirst().getCode()); + } + + + @Test + void shouldValidateSuccessIfApplicantParentAdoptedInEnglandOrWales() { + when(applicantMock.getPrimaryApplicantParentAdoptedIn()).thenReturn(YES); + when(applicantMock.getPrimaryApplicantParentAdoptionInEnglandOrWales()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfApplicantParentAdoptedOutsideEnglandOrWales() { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(GRAND_CHILD); + when(applicantMock.getPrimaryApplicantParentAdoptedIn()).thenReturn(YES); + when(applicantMock.getPrimaryApplicantParentAdoptionInEnglandOrWales()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateSuccessIfApplicantAdoptedInEnglandOrWales(final String relationship) { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(relationship); + when(applicantMock.getPrimaryApplicantAdoptedIn()).thenReturn(YES); + when(applicantMock.getPrimaryApplicantAdoptionInEnglandOrWales()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateFailureIfApplicantAdoptedOutsideEnglandOrWales(final String relationship) { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(relationship); + when(applicantMock.getPrimaryApplicantAdoptedIn()).thenReturn(YES); + when(applicantMock.getPrimaryApplicantAdoptionInEnglandOrWales()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfApplicantParentIsNotAdoptedOut() { + when(applicantMock.getPrimaryApplicantParentAdoptedIn()).thenReturn(NO); + when(applicantMock.getPrimaryApplicantParentAdoptedOut()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfApplicantParentIsAdoptedOut() { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(GRAND_CHILD); + when(applicantMock.getPrimaryApplicantParentAdoptedIn()).thenReturn(NO); + when(applicantMock.getPrimaryApplicantParentAdoptedOut()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUT, validationErrors.getFirst().getCode()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateSuccessIfApplicantIsNotAdoptedOut(final String relationship) { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(relationship); + when(applicantMock.getPrimaryApplicantAdoptedIn()).thenReturn(NO); + when(applicantMock.getPrimaryApplicantAdoptedOut()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateFailureIfApplicantIsAdoptedOut(final String relationship) { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(relationship); + when(applicantMock.getPrimaryApplicantAdoptedIn()).thenReturn(NO); + when(applicantMock.getPrimaryApplicantAdoptedOut()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUT, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfWholeSiblingIsDied() { + when(applicantMock.getAnyLivingWholeBloodSiblings()).thenReturn(YES); + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(SIBLING); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfWholeSiblingIsNotDied() { + when(applicantMock.getAnyLivingWholeBloodSiblings()).thenReturn(NO); + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(SIBLING); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(SIBLING_NOT_DIED, validationErrors.getFirst().getCode()); + } +} diff --git a/src/test/java/uk/gov/hmcts/probate/validator/IntestacyCoApplicantValidationRuleTest.java b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyCoApplicantValidationRuleTest.java new file mode 100644 index 0000000000..3ecd7475bd --- /dev/null +++ b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyCoApplicantValidationRuleTest.java @@ -0,0 +1,362 @@ +package uk.gov.hmcts.probate.validator; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.Mock; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.model.ccd.Executor; +import uk.gov.hmcts.probate.model.ccd.raw.DynamicRadioList; +import uk.gov.hmcts.probate.model.ccd.raw.DynamicRadioListElement; +import uk.gov.hmcts.probate.model.ccd.raw.SolsApplicantFamilyDetails; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.List; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.never; +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.model.Constants.CHILD; +import static uk.gov.hmcts.probate.model.Constants.GRAND_CHILD; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.HALF_BLOOD_NIECE_OR_NEPHEW; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_SIBLING; +import static uk.gov.hmcts.probate.model.Constants.WHOLE_BLOOD_NIECE_OR_NEPHEW; +import static uk.gov.hmcts.probate.model.Constants.NO; +import static uk.gov.hmcts.probate.model.Constants.YES; +import static uk.gov.hmcts.probate.validator.IntestacyCoApplicantValidationRule.ADOPTED_OUT; +import static uk.gov.hmcts.probate.validator.IntestacyCoApplicantValidationRule.ADOPTED_OUTSIDE_ENGLAND_OR_WALES; +import static uk.gov.hmcts.probate.validator.IntestacyCoApplicantValidationRule.PARENT_IS_NOT_DECEASED; +import static uk.gov.hmcts.probate.validator.IntestacyCoApplicantValidationRule.PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES; + +@ExtendWith(SpringExtension.class) +class IntestacyCoApplicantValidationRuleTest { + + @Mock + private BusinessValidationMessageService businessValidationMessageService; + + @Mock + private CCDData ccdDataMock; + + @Mock + private List executorMock; + + private IntestacyCoApplicantValidationRule underTest; + + private static Stream relationship() { + return Stream.of(CHILD, GRAND_CHILD, WHOLE_BLOOD_SIBLING, HALF_BLOOD_SIBLING, + WHOLE_BLOOD_NIECE_OR_NEPHEW, HALF_BLOOD_NIECE_OR_NEPHEW); + } + + @BeforeEach + public void setUp() { + underTest = new IntestacyCoApplicantValidationRule(businessValidationMessageService); + when(ccdDataMock.getExecutors()).thenReturn(executorMock); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, ADOPTED_OUTSIDE_ENGLAND_OR_WALES)) + .thenReturn(FieldErrorResponse.builder().code(ADOPTED_OUTSIDE_ENGLAND_OR_WALES).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, ADOPTED_OUT)) + .thenReturn(FieldErrorResponse.builder().code(ADOPTED_OUT).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, PARENT_IS_NOT_DECEASED)) + .thenReturn(FieldErrorResponse.builder().code(PARENT_IS_NOT_DECEASED).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES)) + .thenReturn(FieldErrorResponse.builder().code(PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES).build()); + + } + + @Test + void testValidateWithSuccessWhenCoApplicantIsNull() { + when(ccdDataMock.getExecutors()).thenReturn(null); + + List validationError = underTest.validate(ccdDataMock); + + verify(businessValidationMessageService, never()).generateError(any(String.class), any(String.class)); + assertTrue(validationError.isEmpty()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateSuccessIfCoApplicantAdoptedInEnglandOrWales(final String relationship) { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(YES) + .coApplicantAdoptionInEnglandOrWales(YES) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(relationship) + .label(relationship) + .build()) + .build() + ) + .build() + ).build()); + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateFailureIfCoApplicantAdoptedOutsideEnglandOrWales(final String relationship) { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(YES) + .coApplicantAdoptionInEnglandOrWales(NO) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(relationship) + .label(relationship) + .build()) + .build() + ) + .build() + ).build()); + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateSuccessIfCoApplicantIsNotAdoptedOut(final String relationship) { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(relationship) + .label(relationship) + .build()) + .build() + ) + .build() + ).build()); + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @ParameterizedTest + @MethodSource("relationship") + void shouldValidateFailureIfCoApplicantIsAdoptedOut(final String relationship) { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(YES) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(relationship) + .label(relationship) + .build()) + .build() + ) + .build() + ).build()); + + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUT, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateFailureIfCoApplicantIsGrandchildAndTheirParentIsAdoptedOutsideEngWales() { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .grandchildParentAdoptedIn(YES) + .grandchildParentAdoptionInEnglandOrWales(NO) + .grandchildParentDieBeforeDeceased(YES) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(GRAND_CHILD) + .label("Grandchild") + .build()) + .build() + ) + .build() + ).build()); + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfCoApplicantIsGrandchildAndTheirParentIsNotAdoptedOut() { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .grandchildParentAdoptedIn(NO) + .grandchildParentAdoptedOut(NO) + .grandchildParentDieBeforeDeceased(YES) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(GRAND_CHILD) + .label("Grandchild") + .build()) + .build() + ) + .build() + ).build()); + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfCoApplicantIsGrandchildAndTheirParentIsAdoptedOut() { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .grandchildParentAdoptedIn(NO) + .grandchildParentAdoptedOut(YES) + .grandchildParentDieBeforeDeceased(YES) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(GRAND_CHILD) + .label("Grandchild") + .build()) + .build() + ) + .build() + ).build()); + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(PARENT_ADOPTED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfCoApplicantIsGrandchildAndTheirParentIsDeceased() { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .grandchildParentDieBeforeDeceased(YES) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(GRAND_CHILD) + .label("Grandchild") + .build()) + .build() + ) + .build() + ).build()); + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfCoApplicantIsGrandchildAndTheirParentIsNotDeceased() { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .grandchildParentDieBeforeDeceased(NO) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(GRAND_CHILD) + .label("Grandchild") + .build()) + .build() + ) + .build() + ).build()); + + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(PARENT_IS_NOT_DECEASED, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateFailureIfCoApplicantIsWholeNieceOrNephewAndTheirParentIsNotDeceased() { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .wholeNieceOrNephewParentDieBeforeDeceased(NO) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(WHOLE_BLOOD_NIECE_OR_NEPHEW) + .label("wholeBloodNieceOrNephew") + .build()) + .build() + ) + .build() + ).build()); + + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(PARENT_IS_NOT_DECEASED, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateFailureIfCoApplicantIsHalfNieceOrNephewAndTheirParentIsNotDeceased() { + List executor = List.of( + Executor.builder() + .applicantFamilyDetails(SolsApplicantFamilyDetails.builder() + .coApplicantAdoptedIn(NO) + .coApplicantAdoptedOut(NO) + .halfNieceOrNephewParentDieBeforeDeceased(NO) + .relationship(DynamicRadioList.builder() + .value(DynamicRadioListElement.builder() + .code(HALF_BLOOD_NIECE_OR_NEPHEW) + .label("halfBloodNieceOrNephew") + .build()) + .build() + ) + .build() + ).build()); + + when(ccdDataMock.getExecutors()).thenReturn(executor); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(PARENT_IS_NOT_DECEASED, validationErrors.getFirst().getCode()); + } +} diff --git a/src/test/java/uk/gov/hmcts/probate/validator/IntestacyDeceasedDetailsValidationRuleTest.java b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyDeceasedDetailsValidationRuleTest.java new file mode 100644 index 0000000000..618cccad4b --- /dev/null +++ b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyDeceasedDetailsValidationRuleTest.java @@ -0,0 +1,181 @@ +package uk.gov.hmcts.probate.validator; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.Deceased; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.never; +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.model.Constants.NO; +import static uk.gov.hmcts.probate.model.Constants.PARENT; +import static uk.gov.hmcts.probate.model.Constants.SIBLING; +import static uk.gov.hmcts.probate.model.Constants.YES; +import static uk.gov.hmcts.probate.validator.IntestacyDeceasedDetailsValidationRule.DECEASED_ADOPTED_OUT; +import static uk.gov.hmcts.probate.validator.IntestacyDeceasedDetailsValidationRule.ADOPTED_OUTSIDE_ENGLAND_OR_WALES; +import static uk.gov.hmcts.probate.validator.IntestacyDeceasedDetailsValidationRule.LIVING_DESCENDANTS; +import static uk.gov.hmcts.probate.validator.IntestacyDeceasedDetailsValidationRule.LIVING_PARENTS; + +@ExtendWith(SpringExtension.class) +class IntestacyDeceasedDetailsValidationRuleTest { + + @Mock + private BusinessValidationMessageService businessValidationMessageService; + + @Mock + private CCDData ccdDataMock; + + @Mock + private Deceased deceasedMock; + + private IntestacyDeceasedDetailsValidationRule underTest; + + @BeforeEach + public void setUp() { + underTest = new IntestacyDeceasedDetailsValidationRule(businessValidationMessageService); + when(ccdDataMock.getDeceased()).thenReturn(deceasedMock); + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(SIBLING); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, ADOPTED_OUTSIDE_ENGLAND_OR_WALES)) + .thenReturn(FieldErrorResponse.builder().code(ADOPTED_OUTSIDE_ENGLAND_OR_WALES).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, DECEASED_ADOPTED_OUT)) + .thenReturn(FieldErrorResponse.builder().code(DECEASED_ADOPTED_OUT).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, LIVING_DESCENDANTS)) + .thenReturn(FieldErrorResponse.builder().code(LIVING_DESCENDANTS).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, LIVING_PARENTS)) + .thenReturn(FieldErrorResponse.builder().code(LIVING_PARENTS).build()); + } + + @Test + void testValidateWithSuccessWhenDeceasedIsNull() { + when(ccdDataMock.getDeceased()).thenReturn(null); + + List validationError = underTest.validate(ccdDataMock); + + verify(businessValidationMessageService, never()).generateError(any(String.class), any(String.class)); + assertTrue(validationError.isEmpty()); + } + + @Test + void shouldValidateSuccessIfDeceasedAdoptedInEnglandOrWalesAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAdoptedIn()).thenReturn(YES); + when(deceasedMock.getDeceasedAdoptionInEnglandOrWales()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfDeceasedAdoptedOutsideEnglandOrWalesAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAdoptedIn()).thenReturn(YES); + when(deceasedMock.getDeceasedAdoptionInEnglandOrWales()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateFailureIfDeceasedAdoptedOutsideEnglandOrWalesAndApplicantIsParent() { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(PARENT); + when(deceasedMock.getDeceasedAdoptedIn()).thenReturn(YES); + when(deceasedMock.getDeceasedAdoptionInEnglandOrWales()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(ADOPTED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfDeceasedIsNotAdoptedOutAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAdoptedIn()).thenReturn(NO); + when(deceasedMock.getDeceasedAdoptedOut()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfDeceasedIsAdoptedOutAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAdoptedIn()).thenReturn(NO); + when(deceasedMock.getDeceasedAdoptedOut()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(DECEASED_ADOPTED_OUT, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateFailureIfDeceasedIsAdoptedOutAndApplicantIsParent() { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(PARENT); + when(deceasedMock.getDeceasedAdoptedIn()).thenReturn(NO); + when(deceasedMock.getDeceasedAdoptedOut()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(DECEASED_ADOPTED_OUT, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfDeceasedHasNoDescendantsAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAnyLivingDescendants()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfDeceasedHasDescendantsAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAnyLivingDescendants()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(LIVING_DESCENDANTS, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfDeceasedHasNoParentsAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAnyLivingParents()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfDeceasedHasParentsAndApplicantIsSibling() { + when(deceasedMock.getDeceasedAnyLivingParents()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(LIVING_PARENTS, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateFailureIfDeceasedHasDescendantsAndApplicantIsParent() { + when(ccdDataMock.getSolsApplicantRelationshipToDeceased()).thenReturn(PARENT); + when(deceasedMock.getDeceasedAnyLivingDescendants()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(LIVING_DESCENDANTS, validationErrors.getFirst().getCode()); + } +} diff --git a/src/test/java/uk/gov/hmcts/probate/validator/IntestacyDivorceOrSeparationValidationRuleTest.java b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyDivorceOrSeparationValidationRuleTest.java new file mode 100644 index 0000000000..b98f10937e --- /dev/null +++ b/src/test/java/uk/gov/hmcts/probate/validator/IntestacyDivorceOrSeparationValidationRuleTest.java @@ -0,0 +1,104 @@ +package uk.gov.hmcts.probate.validator; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import uk.gov.hmcts.probate.exception.model.FieldErrorResponse; +import uk.gov.hmcts.probate.model.ccd.Deceased; +import uk.gov.hmcts.probate.model.ccd.CCDData; +import uk.gov.hmcts.probate.service.BusinessValidationMessageService; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.never; +import static uk.gov.hmcts.probate.model.Constants.BUSINESS_ERROR; +import static uk.gov.hmcts.probate.model.Constants.YES; +import static uk.gov.hmcts.probate.model.Constants.NO; +import static uk.gov.hmcts.probate.validator.IntestacyDivorceOrSeparationValidationRule.DIVORCED_OUTSIDE_ENGLAND_OR_WALES; +import static uk.gov.hmcts.probate.validator.IntestacyDivorceOrSeparationValidationRule.SEPARATED_OUTSIDE_ENGLAND_OR_WALES; +import static uk.gov.hmcts.reform.probate.model.cases.MaritalStatus.Constants.DIVORCED_VALUE; +import static uk.gov.hmcts.reform.probate.model.cases.MaritalStatus.Constants.JUDICIALLY_SEPARATED_VALUE; + +@ExtendWith(SpringExtension.class) +class IntestacyDivorceOrSeparationValidationRuleTest { + + @Mock + private BusinessValidationMessageService businessValidationMessageService; + + @Mock + private CCDData ccdDataMock; + + @Mock + private Deceased deceasedMock; + + private IntestacyDivorceOrSeparationValidationRule underTest; + + @BeforeEach + public void setUp() { + underTest = new IntestacyDivorceOrSeparationValidationRule(businessValidationMessageService); + when(ccdDataMock.getDeceased()).thenReturn(deceasedMock); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, DIVORCED_OUTSIDE_ENGLAND_OR_WALES)) + .thenReturn(FieldErrorResponse.builder().code(DIVORCED_OUTSIDE_ENGLAND_OR_WALES).build()); + + when(businessValidationMessageService.generateError(BUSINESS_ERROR, SEPARATED_OUTSIDE_ENGLAND_OR_WALES)) + .thenReturn(FieldErrorResponse.builder().code(SEPARATED_OUTSIDE_ENGLAND_OR_WALES).build()); + } + + @Test + void testValidateWithSuccessWhenDeceasedIsNull() { + when(ccdDataMock.getDeceased()).thenReturn(null); + + List validationError = underTest.validate(ccdDataMock); + + verify(businessValidationMessageService, never()).generateError(any(String.class), any(String.class)); + assertTrue(validationError.isEmpty()); + } + + @Test + void shouldValidateSuccessIfApplicantDivorcedInEnglandOrWales() { + when(deceasedMock.getDeceasedMaritalStatus()).thenReturn(DIVORCED_VALUE); + when(deceasedMock.getDeceasedDivorcedInEnglandOrWales()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfApplicantDivorcedOutsideEnglandOrWales() { + when(deceasedMock.getDeceasedMaritalStatus()).thenReturn(DIVORCED_VALUE); + when(deceasedMock.getDeceasedDivorcedInEnglandOrWales()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(DIVORCED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } + + @Test + void shouldValidateSuccessIfApplicantSeparatedInEnglandOrWales() { + when(deceasedMock.getDeceasedMaritalStatus()).thenReturn(JUDICIALLY_SEPARATED_VALUE); + when(deceasedMock.getDeceasedDivorcedInEnglandOrWales()).thenReturn(YES); + + List validationErrors = underTest.validate(ccdDataMock); + + assertTrue(validationErrors.isEmpty()); + } + + @Test + void shouldValidateFailureIfApplicantSeparatedOutsideEnglandOrWales() { + when(deceasedMock.getDeceasedMaritalStatus()).thenReturn(JUDICIALLY_SEPARATED_VALUE); + when(deceasedMock.getDeceasedDivorcedInEnglandOrWales()).thenReturn(NO); + + List validationErrors = underTest.validate(ccdDataMock); + + assertEquals(SEPARATED_OUTSIDE_ENGLAND_OR_WALES, validationErrors.getFirst().getCode()); + } +}