From 4352de73e5d5483173d5f32f2357bc6f3b4c17c4 Mon Sep 17 00:00:00 2001 From: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Date: Tue, 23 Jul 2024 19:04:52 +0100 Subject: [PATCH] RIA-7875 Merge SNL -> Master (DO NOT MERGE) (#609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * RIA-7416 Split witness names to capture first and last names in LR journey (#592) * RIA-7416: Update 'witnessDetails' with witness family name * RIA-7416: Use Junit 5 features in functional tests * RIA-7416: Temporarily address dependency vulnerability * RIA-7416: Disable an existing failing functional test to progress PR in pipeline - This functional test fails because of some authorisation issue. - It has been esatablished that the update in this PR is not the cause of the failing test. - Not sure how it passed successfully through the pipeline --------- Co-authored-by: Augustine Onubeze * RIA-7574: Appeal submission summary document displays Legal Rep full Name (#603) Co-authored-by: Augustine Onubeze * RIA-TASK Merged master changes to SNL - documents-api (#646) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) --------- Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti * RIA-7567 appellant and witness interpreter requirement are available (#645) * RIA-7567 appellant and witness interpreter requirement are available #1220 * fix the problem of "exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61" * fix the problem of "Failed to apply plugin 'net.serenity-bdd.aggregator'." * fix the problem of "Could not set unknown property 'configDir' for extension 'checkstyle' of type org.gradle.api.plugins.quality.CheckstyleExtension." * revert the changes for fixing the build problem * add the functional test for RIA-7567 * add the functional test for RIA-7567 for updateHearingRequirements event * update the witness name of the functional test for draftHearingRequirements event updateHearingRequirements event * extract some logic to private method for setting interpreter information of appellant and witness * RIA-7750 party ID generation LR journey (#662) * RIA-7875 updates to resolve conflicts (#689) * Updates to fix FT failures * updates to fix build issues * RIA-7860 Hearings Tab setup * Update renovate.json * RIA-7879 map epims ids to ccd hearing locations (#710) * RIA-7879 map epims ids to ccd hearing locations * Added the unit test and functional test * renovate json patch * update functional test * RIA-7881 list the case system user (#726) * RIA-7860 Hearings Tab setup * RIA-7881 Authorization for system user for listCase * Update suppressions.xml * RIA-7195 remove listing reference number from notification template when hearing list assist hearing v2 (#750) * RIA-7195 remove listing reference number from notification template when hearing list assist hearing v2 * update the unit test, functional test and temporarily suppress CVE problem * update the unit test * update the unit test for isIntegrated flag * RIA-7792 Remove witness list element from logic (#753) * RIA-7860 Hearings Tab setup * RIA-7792 Refactor logic to forgo witnessListElement * RIA-7792 Upgrade chart version * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7922 Improve test coverage (#756) * RIA-7860 Hearings Tab setup * RIA-7792 Improve WitnessDetailsTest * RIA-7792 Improve HearingRequirementsTemplateTest * RIA-7792 Delete DynamicMultiSelectList * RIA-7792 Delete DynamicMultiSelectList * RIA-7792 Undo stale change that got lumped in with the rest * RIA-7922 update witness details class (#757) * RIA-7860 Hearings Tab setup * RIA-7792 Add field to WitnessDetails * RIA-7882 Add editCaseListing permission for caseworker-ia-system (#758) * RIA-7882 Add editCaseListing permission for caseworker-ia-system * RIA-7882 Increase temporary suppression * Update AuthorizationHeadersProvider.java * Update CcdScenarioRunnerTest.java * Update CcdScenarioRunnerTest.java * RIA-7973 Updated Bail application details template (#765) * RIA-7973 Updated Bail application details template * RIA-7973 Added Bail FT scenarios pattern * RIA-7973 Fixed Ft * Update CcdScenarioRunnerTest.java * RIA-8119 Bail application document changes with added interpreter fields (#778) * RIA-8119 Bail application document changes with added interpreter fields * RIA-8119 Suppressing CVE-2023-6481 and CVE-2023-34055 * RIA-8119 Suppressing CVE-2023-33202, CVE-2023-46589, CVE-2023-6378 * RIA-8364 Bail template change 01134 -> 01144 (#789) * RIA-8489 Refactored interpreter language (#798) * RIA-8410 RIA-8409 Generate and store hearing notice on case (initial listing and relisting) (#794) * RIA-8410: Generate hearing documents - Create Handler, Template and configuration classes to generate notice of hearing for case relisting. * RIA-8409: Generate hearing documents - Create handler, template and configuration classes to generate notice of hearing for initial listing event. * RIA-8410: Some code refactoring * RIA-8508 Fix appeals refactored interpreter language (#803) * RIA-8415 record adjournment details (#801) * RIA-7860 Hearings Tab setup * RIA-8415 Add recordAdjournmentDetails event * RIA-8415 Add noticeOfAdjournedHearing document tag * RIA-8415 Add classes and config to handle RecordAdjournmentDetails * RIA-8415 Functional test for RecordAdjournmentDetails * RIA-8415 Update test * RIA-8507 Fix the field type for fcs_has_passport in BailCaseFieldDefinition (#810) * RIA-8554 Fix detention location on hearing-notice template (#817) * RIA-8554 Using enums for Field definition comparison (#819) * Update BailDocumentCreatorConfiguration.java * Update BailSubmissionTemplate.java * updates to fix rebasing issues * Updates to fix sonar issue * Updates to fix sonar issue * Updates to fix rebase issue * Fix issues in functional tests (#861) * Update suppressions.xml * RIA-8802 bails notice of hearing displays the correct location information snl (#885) * RIA-8935: Fix issue in Exception management (#893) * RIA-8916 To resolve merge conflicts with master branch (#889) * DIAC-123 cdam download change fix (#806) * DIAC-123 trying cdam download auth change * DIAC-123 trying cdam download auth change * DIAC-123 trying cdam download auth change * DIAC-123 * DIAC-123 removing logging --------- Co-authored-by: KleoG * RIA-8726 - Merge SNL (BAILS) - > Master (DO NOT MERGE) (#841) * RIA-7973 * RIA-7973 Updated Bail application details template * RIA-7973 Added Bail FT scenarios pattern * RIA-7973 Fixed Ft * RIA-8119 * RIA-8119 Bail application document changes with added interpreter fields * RIA-8364 * RIA-8364 Bail template change 01134 -> 01144 * RIA-8489 * RIA-8489 Refactored interpreter language * RIA-8410 RIA-8409 Generate and store hearing notice on case (initial listing and relisting) * RIA-8410: Generate hearing documents - Create Handler, Template and configuration classes to generate notice of hearing for case relisting * RIA-8409: Generate hearing documents - Create handler, template and configuration classes to generate notice of hearing for initial listing event * RIA-8410: Some code refactoring * RIA-8508 * RIA-8508 Fix appeals refactored interpreter language * RIA-8507 * RIA-8507 Fix the field type for fcs_has_passport in BailCaseFieldDefinition * RIA-8554 * RIA-8554 Fix detention location on hearing-notice template * RIA-8554 * RIA-8554 Using enums for Field definition comparison * Update BailSubmissionTemplateProvider.java * RIA-8738: IMA - Rebasing docmosis template (#845) * Updates to fix build failure * RIA-8773: Add missing hearing centres in the hearing location to hearing address mapping document (#858) * RIA-8773 Fix rebasing of CcdScenarioRunnerTest * RIA-8774 Add logging (#862) * RIA-8774 Add logging * RIA-8770 Run functional tests on pipeline * RIA-8774 Enable logging on functional tests * RIA-8774 Enable logging on functional tests * Update DocumentTagTest.java --------- Co-authored-by: Marcellofabbri Co-authored-by: Augustine Onubeze Co-authored-by: Marcello Fabbri <56549133+Marcellofabbri@users.noreply.github.com> * RIA-TASK NABA -> Master : DO NOT MERGE (#520) * RIA-6455: Added new Hearing centre - Harmondsworth (#518) * RIA-6455: Added new Hearing centre - Harmondsworth * Fix vulnerabilities * Added Location (#519) * Added Location * Suppressions Co-authored-by: Jamie * RIA-6491: Give admin officer access to edit appeal post submission (#521) * RIA-6491: Give admin officer access to edit appeal post submission * RIA-6491: Address dependency vulnerabilities * RIA-6529: Generate Hearing Notice after listing for ADA cases (#522) * RIA-6529: Generate Hearing Notice after listing for ADA cases * Suppress vulnerabilities * Added Yarls Wood as hearing centre and also its address (#524) * Ria 6424 appeal submission summary (#527) * Added some defs to extract case data Added some puts to copy case data to field values which docmosis can use to generate the appeal submission summary * Modified tests * Formatted for sonar scan * Final changes * Refactored AppealSubmissionTemplate and added logic for displaying removal order date and time * Added tests for detained fields and removal order date * Formatted import and method line seperations for serenity checks * Added CVE suppression * Changed where appelantInDetention defaults to YesOrNo.NO * Moved the parsing of complex asylum case fields (nomsNumber, dateCustodialSentence & otherDetentionFacilityName, to a dedicated method. Modified tests to cover more scenarios and make the tests more robust by checking all other relevant fields in the same flow. * Added assertion to check size of templateFieldValues * Bundled common fields together and setting Mockito strictness to lenient * Added suppressions * RIA-6424: Fix the TypeReference class for the field - 'hasPendingBailApplications' (#528) - Changed from YesOrNo type to BailApplicationStatus type. - update relevant unit tests. * Added guards in event nomsNumber, releaseDate & removalOrderDate are empty strings (#530) * Added guards in event nomsNumber and releaseDate are empty strings * Adding suppression * Ria 6424 (#531) * Added guards in event nomsNumber and releaseDate are empty strings * Adding suppression * Added check for custodial sentence release date as it is not always guaranteed to be provided * Modified test to allow mock for containsKey method of asylumCase * Added check for custodial sentence release date as it is not always guaranteed to be provided * Modified test to allow mock for containsKey method of asylumCase * Ria 6564 hearing notice edited ada (#532) * RIA-6564 - Adding hearing notice document generation for ADA cases * RIA-6564 - Checkstyle * RIA-6564 - Adding suppression * Ria 6685 date decision letter (#545) * RIA-6685 Added logic for Date decision letter to appear in Appeal template * Formatting changes and tests * Fixed tests * added decisionLetterReceivedDate test Co-authored-by: Jamie * RIA-6685-fixed-test (#546) Co-authored-by: Jamie * Ria 6605 ada suitability document api (#547) * Saving work * Saving changes * Saving work before a forced update * Latest changes * latest changes * Added new template * Rebased * Added ADASuitabilityReviewDecision entity. Added suitability review, reason and judge to AsylumCaseDefinition. Added AdaSuitability document tag. Added suitability review event. Created pre-submit handler to generate ada suitability document. Added AdaSuitability to bundleOrder. Created new AdaSuitabilityTemplate. Added Adasuitability bean to DocumentCreatorConfiguration. Added AdaSuitabilityDocument metadata to application.yml. Created AdaSuitabilityTemplateTest. * Resolved comments in PR specifically regarding extra line seperations and variable name formatting * Added functional test for ADA suitability document generation * Adding system credentials and appropriate method to generate headers for pipeline build failures. * Fix for failing functional test: RIA-5778-end-appeal-automatically-notice-document.json * RIA-6612: Update Bundling events to include Ada suitability review do… (#549) * RIA-6612: Update Bundling events to include Ada suitability review document - new document added under section of Tribunal Documents. - added functional and unit tests. * Update owasp.dependencyCheck * Updated 'after' method call in Jenkinfile* * RIA-6694-Admin-Submit-Appeal (#551) * RIA-6694-Admin-Submit-Appeal * fixed state test --------- Co-authored-by: Jamie Co-authored-by: Dbarnes-v1 <99024336+Dbarnes-v1@users.noreply.github.com> * RIA-6700 - Allowing access to editAppeal for Admin users (#552) * RIA-6721 Added isAdmin field to templateFieldValues in appeal submission summary template. (#554) Added isAdmin field to AsylumCaseDefinition. Updated unit tests. * RIA-6702 - Internal case creation adding access to the following even… (#553) * RIA-6702 - Internal case creation adding access to the following events for Admins: 1. makeAnApplication 2. draftHearingRequirements 3. buildCase 4. submitCase 5. uploadAdditionalEvidence 6. applyForFTPAAppellant 7. requestFeeRemission * RIA-6702 - Updating unit test * RIA-6702 - Suppression * RIA-6873 appeal summary changes (#555) * RIA-6873_appeal_summary_changes * Charts java version upgraded * Adding new suppression * Change HAS_OTHER_APPEALS field type with new object class * Ria 6844 Add date to ADA suitability document (#556) * RIA-6844 Added date to ADA suitability document. Updated unit test. * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-6560 - Functional tests improvements (#568) * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Suppress CVE-2023-20863 (#570) * Rebase from Master (#571) * fix for refactoring DocumentUploadClientApi with CaseDocumentClient. … (#502) * fix for refactoring DocumentUploadClientApi with CaseDocumentClient. DocumentManagementUploader is updated but this class is not used or ex tended by any other class * update scanbase packages * update gradle for test * suppressing org.yaml:snakeyaml:1.26 * update tvtStringProvider * update tvtStringProvider * fix build failures * fix build failures * fix build failures * Updates to fix build failures * Updates to fix secure doc store client * Bumping chart version/ fixing aliases * Updates to fix build failures * Updates to fix build failures * Updates to fix test failures * Updates to fix test failures * Updates to fix test failures * Updates to fix test failures * Updates to suppress cves to allow build to happen * fix for failing gradle build * RIA-5804: reload jenkins build * Bumping chart version/ fixing aliases * RIA-5804: fixed vulnerabilities * RIA-5804: upgraded java chart version --------- Co-authored-by: rajeshthuraiyur Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Javier Marin * Update suppressions.xml (#557) * To update azurerm version for terraform (#558) * Update state.tf * Update .terraform-version * Update variables.tf * Update main.tf * Update main.tf * Revert "To update azurerm version for terraform (#558)" (#559) This reverts commit a90efa41ddaa7b71f143c038f2355c4100e8a152. * Revert "Update suppressions.xml (#557)" (#560) This reverts commit 247256adf152dd85bd2f0dc3b3eb216478ff77a5. * Revert "fix for refactoring DocumentUploadClientApi with CaseDocumentClient. … (#502)" (#561) This reverts commit 52eab14c22caa2398868bf623ffef1c9de6540bc. * To revert cdam changes from production (#562) * Update .terraform-version * Update main.tf * Update state.tf * Update variables.tf * Update suppressions.xml * Update Chart.yaml * Update suppressions.xml * Bumping chart version/ fixing aliases * Update Chart.yaml * Update suppressions.xml --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * Update Dockerfile (#565) * Update Dockerfile * Update Dockerfile * Update suppressions.xml * Updated suppressions --------- Co-authored-by: addison-jephtah <108927648+addison-jephtah@users.noreply.github.com> Co-authored-by: rajeshthuraiyur Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Javier Marin Co-authored-by: mokainos <72137340+mokainos@users.noreply.github.com> * Updated dependencies to remove suppressed CVEs (#564) (#573) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> Co-authored-by: mcareyma Co-authored-by: Filippo Possenti * RIA-7043 add NOTICE_OF_DECISION_UT_TRANSFER document tag (#576) * RIA-7043 * Added NOTICE_OF_DECISION_UT_TRANSFER enum to DocumentTag.java * RIA-7043 * Updated DocumentTagTest.java * RIA-7043 * Updated document bundle configs * Supressed CVE-2023-28709 (#580) * Added new line character to kick off new build on pipeline (#582) * RIA-7158 request case building notification attachment letter (#583) * * Added powermock to build.gradle which is used in testing * Added template for internal cases for FTs * Added requestCaseBuilding event to enums * Added NOTIFICATION_ATTACHMENT_DOCUMENTS to asylumCase to store new AIP notification attachment docs * Added AdaListCase direction tag to fix bug where the direction cannot be parsed as it's not in the list of DirectionTag enums * Added requestCaseBuilding Doc tag * Updated bundleOrder with the new DocTag * Added holidaydates service * Added DueDateService * Added new handler/docGenerator for requestCaseBuilding event for internal ADA cases * Created new template for the new handler/docGenerator * Added asylumcaseutils * Added internalAdaBuildCase bean to DocumentCreatorConfiguration for the above new handler/template * Updated CustomerServicesProvider with new email/telephone for internal ADA cases * Added internalAdaBuildCaseDocument metadata to application.yml. Also gave CO permission for requestCaseBuilding event and added internal ADA contact details * Added unit tests for above * Added FT for LO requestCaseBuilding to verify doc generated * RIA-7158 * Moved the deconstruction of directions to AsylumCaseUtils to make it generalised for future use * Added utility class to format dates * Updated tests * Added comment as per PR review feedback * Added suppression to make CI/CD pipeline pass (#584) * RIA-7158 (#585) * Formatted date * Update suppressions.xml force build * Update minimal-aip-appeal-submitted.json * Update minimal-appeal-submitted.json * Update suppressions.xml * Update suppressions.xml * RIA-7175 Internal ADA suitability document - unsuitable (#593) * RIA-7175 Internal ADA suitability document - unsuitable * RIA-7175 Suppress CVE-2023-35116 and CVE-2023-2976 * Revert "RIA-7175 Internal ADA suitability document - unsuitable (#593)" (#594) This reverts commit 8d9236e8d0b9c89ac23bee6c4279d4d07b9c8c96. * RIA-7174 ADA suitability document - suitable (#596) * RIA-7174 ADA suitability notification doc for suitable decision * RIA-7174 Suppressing CVE-2023-35116 * RIA-7174 Changes from code review, some refactoring work also * RIA-7174 * Removed common method and put it back into the template as a private method. * RIA-7174 Added empty line at end of functional test --------- Co-authored-by: FarukH Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7175 internal ada suitability unsuitable document (#595) * RIA-7175 Internal ADA suitability document - unsuitable * RIA-7175 Fixed formatting issues after rebase branch * RIA-7172: Generate letter when 'HO Request Review' event is triggered (#597) * RIA-7172: Generate letter when 'HO Request Review' ebent is triggered - add the new letter in the Notification_letter collection. - new tag added. * RIA-7172: Fix Functional test * RIA-7172: Trigger letter generation only for ADA * RIA-7212 Internal ADA Appeal decided, allowed document generation (#598) * RIA-7212 Internal ADA Appeal decided, allowed document generation * RIA-7212 Fixed unit tests after rebase * RIA-7212 Tidying up code using common methods * RIA-7212 Refactor packages * Ria 7540 dynamic internal email/tel (#599) * RIA-7540 Updated customer service provider to return internal case dynamic email/tel * RIA-7540 updated HoReviewEvidenceLetterTemplate to get fetch dynamic email and tel * RIA-7540 updated InternalAdaDecisionsAndReasonsAllowedLetterTemplate to get fetch dynamic email and tel --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7174 Refactor package location (#600) * RIA-7175 Refactor of package (#601) * RIA-7198: Generate letter when HO maintains decision in 'Upload Appea… (#605) * RIA-7198: Generate letter when HO maintains decision in 'Upload Appeal Response' event - added new user for functional test - HomeOfficeLart - added new entity - AppealReviewOutcome. * RIA-7198: Fix customer services contact info methods * RIA-7198: Fix unit tests * RIA-7198: Fix functional test for 'end appeal automatically' event * RIA-7198: Added system env variable to secret mapping for the lart user credentials * RIA-7213_internal_ada_appeal_decided_dismissed_document: Add Dismisse… (#604) * RIA-7213_internal_ada_appeal_decided_dismissed_document: Add Dismissed - ADA (Letter) template generation, tests * RIA-7213_internal_ada_appeal_decided_dismissed_document: Fixed code styles * RIA-7213_internal_ada_appeal_decided_dismissed_document: RIA-7212 FT disabled:true * RIA-7213_internal_ada_appeal_decided_dismissed_document: RIA-7212 FT disabled:true * RIA-7213_internal_ada_appeal_decided_dismissed_document: InternalAdaDecisionsReasonsLetterAllowedGenerator(and Dismissed) refactored into one generic class with conditions, tests fixed as well * RIA-7213_internal_ada_appeal_decided_dismissed_document: InternalAdaDecisionsAndReasonsDismissedLetterTemplate refactored dueDate code lines * RIA-7200 (#602) * Added new template for hearing bundle ready letter * Added new handlers and functionality to generate this letter AFTER generate hearing bundle event when async stitching bundle event is implicitly called and is successful * Added unit/functional tests * RIA-7174 Adding new template vars to template (#607) * RIA-7174 Adding new template vars to template * RIA-7174 Functional test reworked to add directions * RIA-7174 Another functional test rework * RIA-7538 Updated config and handler to handle internal case detained non ADA document generation (#610) * RIA-7606_change_customer_service_mail (#611) * RIA-7606_change_customer_service_mail: Fix customer service mail in application.yml * RIA-7606_change_customer_service_mail: Fix customer service mail in InternalDetGenerateHearingBundleTemplateTest * RIA-7215 Updated template to handle detained non-ada letter (#612) * RIA-7200 Fix hearing centre name (#613) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7218 Allow document generation for all detained cases (#615) * RIA-7218 Allow document generation for all detained cases * RIA-7218 Functional test fixed * RIA-7159 Request case building detained letter generation (#616) * RIA-7159: WIP - Used one generator for for both detained and non-detained letter generations * RIA-7159 Final changes. tests and checkstyle changes * RIA-7159 Removing redundant unit tests --------- Co-authored-by: Neha Aggarwal Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7159 Rework of Non-ADA template to reduce duplication (#619) * RIA-7548_internal_appeal_submission_non_ada (#618) * RIA-7548_internal_appeal_submission_non_ada: Add appeal submission template for internal, non ada, detained only cases * RIA-7548_internal_appeal_submission_non_ada: styles fix * RIA-7548_internal_appeal_submission_non_ada: Add document tag, fix tests for this tag * RIA-7548_internal_appeal_submission_non_ada: Rename template, properties, configuration qualifier * RIA-7548_internal_appeal_submission_non_ada: Rename template, properties, configuration qualifier * RIA-7548_internal_appeal_submission_non_ada: Fix condition AsylumCase definition in AppealSubmissionCreator * RIA-7548_internal_appeal_submission_non_ada: Bundle sort tests fix * RIA-7216 Added appeal decided dismissed detained non ADA document templates (#622) * Update suppressions.xml * Update suppressions.xml * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record ou… (#623) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7552_appeal_can_proceed: Fix test EventTest * RIA-7552_appeal_can_proceed: Fix checkstyle * RIA-7552_appeal_can_proceed (#624) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7552_appeal_can_proceed: Fix test EventTest * RIA-7552_appeal_can_proceed: Fix checkstyle * RIA-7552_appeal_can_proceed: Reduce code duplications * Ria 7552 appeal can proceed (#626) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7552_appeal_can_proceed: Fix test EventTest * RIA-7552_appeal_can_proceed: Fix checkstyle * RIA-7552_appeal_can_proceed: Reduce code duplications * RIA-7552_appeal_can_proceed: Reduce code duplications * RIA-7552_appeal_can_proceed: Reduce code duplications * RIA-7552_appeal_can_proceed: Reduce code duplications * Ria 7554 directed to upload bundle (#628) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * Ria 7554 directed to upload bundle (#629) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * Ria 7554 directed to upload bundle (#630) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * Ria 7554 directed to upload bundle (#631) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-TASK Merged master changes to Naba - documents-api (#614) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * Fixed tests --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti * RIA-7582 non_payment_end_appeal (#637) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7582_non_payment_end_appeal: Add template, generator, configuration, Asylum definitions for remission type, tests * RIA-7582_non_payment_end_appeal: Add RemissionType test * RIA-7582_non_payment_end_appeal: Fix application properties document fileName and functional test 7582 * RIA-7580 (#638) * Added new handler, template and bean config for internal detained non-ada appeal fee letter with no remissions * Imported AppealType class from case-api * Updated existing unit tests (State, BundleOrder & DocumentTag) * Added unit tests and FT * RIA-7581 Added internal detained mark as paid letter (#639) * RIA-7618 document remission partially approved rejected (#641) * RIA-7618 Initial document changes before rebase * RIA-7618 Final refactored changes after rebasing * RIA-7618 Utils method change * RIA-7618 Adding unit test for RemissionDecision class * RIA-7618 checkstyle test fix * RIA-7556 internal det ho review maintained (#640) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7556 init commit * RIA-7556_internal_det_ho_review_maintaned: Add tests unit/functional, update application.yml for new event and fix document extension in application.yml * RIA-7556_internal_det_ho_review_maintaned: Add tests for new event * RIA-7556_internal_det_ho_review_maintaned: Fix on dueDate in template and test for this template * RIA-7556_internal_det_ho_review_maintaned: Fix on functional test * RIA-7556_internal_det_ho_review_maintaned: Fix on functional test * RIA-7556_internal_det_ho_review_maintaned: Adding detenction --------- Co-authored-by: ThomasKKC * RIA-7559 DET letter case listing detained (#642) * RIA-7559 Generator and template for doc generation * RIA-7559 internal detained list case letter generation * RIA-7559 document creator values updated to correct document * RIA-7559 functional test added * RIA-7559 append document to notifications attachments group * RIA-7559 functional test fix * RIA-7559 Checkstyle and unit test fixes for pipeline * RIA-7557 Internal detained review HO response decision withdrawn letter generation (#643) * RIA-7557 * Added functionality for new letter generation when LO requests AIP to review HO response * Added new doc tag for the new letter * Refactored RIA-7556 * Added/updated unit/FTs * Rebasing * RIA-7557 * Updated FT * RIA-7561 - Added handler to generate letter when 'Request Hearing Requ… (#644) * RIA-7561: Added handler to generate letter when 'Request Hearing Requirements' Event is triggered * RIA-7561: Remove local testing code. * RIA-7561: Remove unused import. * RIA-7561: Fix BundleOrderTest after rebase. * RIA-7561: Fix PMD violations. * Update suppressions.xml * RIA-7556/RIA-7557 (#648) * Renamed document file names for home office response review decision maintained and withdrawn * RIA-7372 appeal_ended_aip_journey (#647) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7372_appeal_ended_aip_journey: Add Document tag for internal cases, generator, template, configuration, application.yml links and tests * RIA-7372_appeal_ended_aip_journey: Add functional test and bundle tests * RIA-7372_appeal_ended_aip_journey: Add functional test and bundle tests * RIA-7372_appeal_ended_aip_journey: Add functional test and bundle tests * RIA-7561: Allow LF for Request Hearing Requirements Feature (#649) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7281 Added internal detained edit case listing letter (#650) * RIA-7281 Added internal detained edit case listing letter * RIA-7281 Added extra unit tests for thrown exceptions * RIA-7374 mark_appeal_as_ada (#651) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7374_mark_appeal_as_ada: Add for internal journey mark as ada, configuration, template, document Tag, event, Bundler order tag. Populate application props with link to letter, add functional tests * RIA-7374_mark_appeal_as_ada: Fix merge conflicts * RIA-7374_mark_appeal_as_ada: Remove condition check if appeal is Ada, as well remove from tests functional and junit * RIA-7364 internal decideAnApplication letter generation (#653) * RIA-7364 * Added functionality for decideAnApplication letter generation for internal cases * Copied across makeAnApplication logic and its parsing/extraction from case data * Added new doc tag * Added/updated unit and FTs * RIA-7364 * Updated FTs * RIA-7364 Made some changes for sonar cloud failures (#655) * Added isPresent() check * Updated assertion for default case in enhanced switch statement * Update suppressions.xml * RIA-7328 ho_ftpa_submitted (#657) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7328_ho_ftpa_submitted: Add DocumentTag, Populate BundlerOrder, DocumentCreatorConfiguration for APPLY_FOR_FTPA_RESPONDENT. Add roles, junit/functional tests for APPLY_FOR_FTPA_RESPONDENT * RIA-7328_ho_ftpa_submitted: Fix FT credentials for FTPA respondent apply * RIA-7328_ho_ftpa_submitted: Fix FT credentials for FTPA respondent apply * RIA-7328_ho_ftpa_submitted: Fix jenkins roles mappings * RIA-7328_ho_ftpa_submitted: Fix jenkins roles mappings * RIA-7365 (#660) * Added new template for internal decide an application where decision is refused * Refactored 7364 so granted+refused use a single handler with independent DocumentCreatorConfiguration beans and seperate templates. * Added/updated unit/FTs. Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7701 Added transfer out of ADA letter (#661) * RIA-7326 (#663) * Added functionality to generate letter when admin officer applies for ftpa for internal cases * Added/updated tests * RIA-7326 (#665) * Updated doc tag * RIA-7330 Internal appellant FTPA decided granted document (#670) * RIA-7330 Internal appellant FTPA decided granted document * RIA-7330 Checkstyle and unit test fixes * Update suppressions.xml * Update suppressions.xml * RIA-7360 ho_ftpa_decided_granted (#671) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7360_ho_ftpa_decided_granted: Add Letter, Configuration, changes to InternalFtpaDecidedLetterGenerator for HO FTPA decided granted. Add Tests and functional test, Document.tag, Definitions. * RIA-7361 ho_ftpa_decided_partially_granted (#672) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7361_ho_ftpa_decided_partially_granted: Add Letter, Configuration, changes to InternalFtpaDecidedLetterGenerator for HO FTPA decided partially granted. Add Tests and functional test * RIA-7326 (#673) * Give LR permission for applyForFTPAAppellant event doc generation * RIA-7362 ho_ftpa_decided_refused (#675) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7362_ho_ftpa_decided_refused: Add Letter, Configuration, changes to InternalFtpaDecidedLetterGenerator for HO FTPA decided refused. Add Tests and functional test * RIA-7362_ho_ftpa_decided_refused: Fix typo * RIA-7331 Internal appellant ftpa decided - partially granted document (#676) * RIA-7331 Internal appellant ftpa decided - partially granted document * RIA-7331 Corrected deadline date values for ada and non-ada * RIA-7332 Document for Appellant ftp decided - refused (#677) * RIA-7332 Document for Appellant ftp decided - refused * RIA-7332 Suppressing CVE-2023-41080 * RIA-7332 Split functional test into ADA and non-ADA scenarios * RIA-7332 Functional test file rename * RIA-7331 Further changes to ADA working days scenario (#678) * RIA-7330 Split functional tests into ADA and non-ADA scenarios (#679) * RIA-7330 Split functional tests into ADA and non-ADA scenarios * RIA-7330 rename FT title for non-ADA FT * RIA-TASK - Merged Master changes to NABA case-documents (#669) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * Merged Master changes to NABA * Merged Master changes to NABA * Merged Master changes to NABA * Merged Master changes to NABA * Merged Master changes to NABA * Update suppressions.xml * Merged Master changes to NABA --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: Matthew Carey Co-authored-by: Matthew Carey Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> * RIA-7844 (#682) * Added content for application type - reinstate to InternalDecideAnApplicationDecisionGrantedLetterTemplate.getWhatHappensNextContent() * Added reinstate content test * Added FTs for reinstate application type when decided * RIA-7844 (#684) * Adding full stop to String * RIA-7322 Internal hearing requirements updated letter generation (#686) * RIA-7367 (#685) * Refactored internal appellant application decided (refused+granted) * Updated internalApplicationDecided handler to pick correct DocumentCreatorCongif bean based on granted/refused and appellant/respondent application * Added new bean for HO decide application * Added/updated unit tests * Refactored 7364 FTs to include Admin Officer as application applicant * Added new FTs * RIA-7368 (#690) * Addedn functionality to generate letter when HO application decided * Refactored RIA-7365 * Added/updated unit/FTs * RIA-7372 appeal_ended (#688) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7372_appeal_ended: change decisionMaker to fetch from END_APPEAL_APPROVER_TYPE, fix endAppealDate fortmat, fix tests * RIA-7372_appeal_ended: remove unused import --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7322 hearingDate removed from template (#691) * RIA-7561: Fix the deadline date in the 'Request Hearing Requirements' letter (#687) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7378 unlink_appeal (#693) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: Add new Document letter generation for Maintain Case Link event. * RIA-7378_unlink_appeal: Change tag name * RIA-7378_unlink_appeal: Change tag name * RIA-7378_unlink_appeal: remove unused import * RIA-7378 unlink case (#694) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: refactor test method name * RIA-7427 Internal upload additional evidence doc generation (#695) * RIA-7427 Internal upload additional evidence doc generation * RIA-7427 Test and checkstyle fixes * RIA-7378 unlink_case (#696) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: refactor test method name * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378 unlink_case (#697) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: refactor test method name * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7378 unlink_appeal (#698) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7378 unlink_appeal (#699) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7895 bug_fix_rule3235 (#700) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7895_bug_fix_rule3235: Populate FtpaDecisionOutcomeType with values of 23 and 35 rules --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7279 (#705) * Added handler and template for generating letter when LO requests HO to amend appeal response * Imported isValidUserDirection from notifications-api. * Added/updated unit and FTs * RIA-7376 link_case (#704) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7376_link_case_det: Add Event create case link. Template, configurations, tests * RIA-7376_link_case_det: Fix unit test * RIA-7376_link_case_det: Fix intends * RIA-7376_link_case_det: populate FT with more values, AsylumCase object mapper populated with dateTime module * RIA-7376_link_case_det: merge conflicts * RIA-7437 internal non standard direction letter (#706) * RIA-7437 Non standard direction to appellant - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, second time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, third time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, third time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, Fourth time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating functional tests - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating functional tests, try two - ADA & NonADA (Letter) * RIA-7437 - Renamed bean * RIA-7437 - fixed functional tests * RIA-7437 Non standard direction to appellant, resolving comments (Letter) * RIA-7437 Non standard direction to appellant, fixing checkstyle error (Letter) --------- Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> Co-authored-by: colmlynch60 * RIA-7376 link_cases (#711) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7376_link_cases: fix dates serialization mechanism * RIA-7376_link_cases: fix styles * RIA-7437 Generate letter when party is APPELLANT_AND_RESPONDENT in 'S… (#714) * RIA-7437 Generate letter when party is APPELLANT_AND_RESPONDENT in 'Send Direction' event * Update renovate.json --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7433 Generate letter when LO changes hearing centre for detained… (#702) * RIA-7433: Generate letter when LO changes hearing centre for detained internal appeals * RIA-7433 updated functional test description * RIA-7433: Added FT for non-ADA appeal * Fix checkstyle errors * RIA-7418 Appeal edited - ADA & Non ADA (Letter) (#717) * RIA-7418: added new edit template letter and logic behind * RIA-7418: fixed BundleOrderTest.java * RIA-7432: Fix template to reflect old and new hearing centres (#721) * RIA-7370 (#719) * Refactored implementation of RIA-7427 to make InternalUploadAdditionalEvidenceGenerator generic for all users * Imported HasDocument interface and made current implementation of DocumentWithMetadata implement it * Imported events from case-api * Added 2 new doc tags (LO additional evidence upload and HO additional evidence upload) * Created 2 new templates for HO and LO additional evidence upload * Added new methods in AsylumCaseUtils to extract addendum evidence documents and to fetch most recent addendum evidence added * Created 2 new beans in DocumentCreatorConfiguration (LO/HO additional evidence upload) * 2 new application.yaml entries for document templates * Updated existing tests and added new unit/FTs * RIA-7370 Provide home office apc permission for uploadAdditionalEvidenceHomeOffice and uploadAddendumEvidenceHomeOffice (#725) * RIA-7370 * Provide home office apc permission for uploadAdditionalEvidenceHomeOffice and uploadAddendumEvidenceHomeOffice * RIA-7370 * Fixed sonar check. Performing isEmpty() check on optional var before a .get() * RIA-7370 (#727) * Added a null check on addendum metadata * Suppress CVE (#728) * RIA-7471 letter generation direction due date changed (#715) * RIA-7471 Letter generation when 'Change Direction due date' is triggered - for ADA and non ADA internal cases - when recipient party is either APPELLANT or APPELLANT AND RESPONDENT. * Fix naming of a variable * RIA-7471 - fixed unit test * RIA-7471 Fix functional tests * Fix unit test * Fix template personalisations * Fix name for template env variable --------- Co-authored-by: colmlynch60 * RIA-7435 Home_office_non-Standard_direction_letter (#730) Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> * RIA-7439 ho_change_direction_due_date (#729) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7439_ho_direction_due_date: Add Ho change direction due date letter, configurations, tests for internal DET cases * RIA-7439_ho_direction_due_date: Move method isPartyIsRespondent ot Utils * RIA-7439_ho_direction_due_date: remove spaces * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: merge tests fix * RIA-7439_ho_direction_due_date: merge conflicts resolve * RIA-7439 ho_change_direction_due_date (#731) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7439_ho_direction_due_date: Add Ho change direction due date letter, configurations, tests for internal DET cases * RIA-7439_ho_direction_due_date: Move method isPartyIsRespondent ot Utils * RIA-7439_ho_direction_due_date: remove spaces * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: merge tests fix * RIA-7439_ho_direction_due_date: merge conflicts resolve * RIA-7439_ho_direction_due_date: resolving code duplication Sonar Cloud issue * RIA-7439 ho_change_direction_due_date (#735) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7439_ho_direction_due_date: Add Ho change direction due date letter, configurations, tests for internal DET cases * RIA-7439_ho_direction_due_date: Move method isPartyIsRespondent ot Utils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: resolving code duplication Sonar Cloud issue * RIA-7439_ho_direction_due_date: resolving code duplication Sonar Cloud issue * RIA-7429 Letter generation for Internal Reinstate Appeal (#722) * RIA-7435 Rename the letter generator class and corresponding unit tests (#737) * RIA-7435 Rename the letter generator class and corresponding unit tests * Fix checkstyle error * Fix functional tests * Fixing functional test * RIA-7911 Update hearing adjustments (#739) * RIA-7911_Update_hearing_adjustments * RIA-7911 Update hearing adjustments functional tests --------- Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> * Update suppressions.xml * Update suppressions.xml * RIA-7537 EJP Adding new roles for legal officer (#746) Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> * RIA-8888 Upgraded chart version (#751) * RIA-8888 Upgraded chart version * RIA-8888 revert version because it is auto bumped * RIA-8888 added suppressions * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7411 Removing OOC feature flag fields (#743) (#754) * RIA-7411 Removing OOC feature flag fields * RIA-7411 Suppressing CVE-2023-42794, CVE-2023-42795, CVE-2023-45648 Co-authored-by: Ryan-Nesbitt <95298094+Ryan-Nesbitt@users.noreply.github.com> * RIA-TASK - Merge master changes to NABA - ia-case-documents-api (#760) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-5679 Updating suppressions (#681) * RIA-5679 Updated suppression for CVE-2023-35116 * RIA-5679 Adding suppression for CVE 2023-41080 * RIA-5679, Changed suppression to fixed dependency (#683) * RIA-5679 nightly fixes (#708) * RIA-5679 nightly fixes * DIAC-2 Updated Renovate config file, added automerge, scheduling and package… (#732) * Updated Renovate config file, added automerge, scheduling and package types. Also backdated restAssured from 5.3.1 to 5.3.0 to test Renovate * Updating extends in renovate json * Extending suppresion of CVE-2023-35116 due to no solution yet * DIAC-2 updating renovate schedule (#734) * DIAC-2 updating renovate schedule * DIAC-2 updating renovate schedule london timezone * RIA-1234 swagger workflow run fix (#736) * Update all non-major dependencies (#738) * Update all non-major dependencies * Fixing dependency for spring bootstrap. Added TODO for an upgrade * Reverting ccd-case-document-am-client to older version * Updating renovate config to no longer check for cdam upgrade --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * DIAC-2 changing deprecated config option (#742) * DIAC-2 changing deprecated config option * DIAC-2 adding config option for exluding major updates * DIAC-000 Dependency fix (#749) * dependency fix * updating pr validation --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: Matthew Carey Co-authored-by: Matthew Carey Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: Jake Cohen <101183561+JakeCohenSol@users.noreply.github.com> Co-authored-by: Nilay Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * Removed print line that causes issues on windows (#762) * RIA-7950 upgrade_fix (#767) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7950_upgrade_fix: trigger rebuild * RIA-2023 rebuild_pipelines (#775) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-20231212_rebuild_pipelines: Restart pipelines * RIA-20231212_rebuild_pipelines: Add supressions * Update suppressions.xml * RIA-7324 Hearing adjourned without a date - ADA & Non ADA (Letter) (#788) * RIA-7324: added adjourn hearing without date letter template * RIA-7324: small fix on DocumentTag applied * RIA-8214 Add a new screen to Bails start application - UT appeal pending (#791) * RIA-8214: bail application submission template fixed with new fields * RIA-8214: small refactor name on definitions * Revert "RIA-8214 Add a new screen to Bails start application - UT appeal pending" (#793) * RIA-TASK - Merge master changes to NABA - ia-case-documents-api (#792) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-5679 Updating suppressions (#681) * RIA-5679 Updated suppression for CVE-2023-35116 * RIA-5679 Adding suppression for CVE 2023-41080 * RIA-5679, Changed suppression to fixed dependency (#683) * RIA-5679 nightly fixes (#708) * RIA-5679 nightly fixes * DIAC-2 Updated Renovate config file, added automerge, scheduling and package… (#732) * Updated Renovate config file, added automerge, scheduling and package types. Also backdated restAssured from 5.3.1 to 5.3.0 to test Renovate * Updating extends in renovate json * Extending suppresion of CVE-2023-35116 due to no solution yet * DIAC-2 updating renovate schedule (#734) * DIAC-2 updating renovate schedule * DIAC-2 updating renovate schedule london timezone * RIA-1234 swagger workflow run fix (#736) * Update all non-major dependencies (#738) * Update all non-major dependencies * Fixing dependency for spring bootstrap. Added TODO for an upgrade * Reverting ccd-case-document-am-client to older version * Updating renovate config to no longer check for cdam upgrade --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * DIAC-2 changing deprecated config option (#742) * DIAC-2 changing deprecated config option * DIAC-2 adding config option for exluding major updates * DIAC-000 Dependency fix (#749) * dependency fix * updating pr validation * DIAC-66 getting all functionals to run (#747) * DIAC-66 getting all functionals to run * DIAC-66 dependency update * DIAC-66 dependency update * DIAC-70 adding integration, smoke and unit testing and report to nightly runs * DIAC-70 removing integration * DIAC-70 adding secrets * DIAC-70 adding mutation test reporting * DIAC-70 adding mutation test reporting * DIAC-66 integration tests * DIAC-66 dependency upgrade * DIAC-66 checkstyle fix * DIAC-66 java chart upgrade * DIAC-00 Revert pact dependency upgrade (#759) * DIAC-84 Disable Decision and reasons document PDF conversion (#752) * DIAC-84 Disable Decision and reasons document PDF conversion * Remove PDF conversion * upgrade java helm chart * Delete Decision and reasons document PDF conversion files * suppress CVE-2023-35116 * Update test names and add test for document null check * fix test * Update final decision and document name * rename pdf service to file rename service * update ia-case-api url * Fix functional tests * test * Bumping chart version/ fixing aliases * cleanup --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * Update all non-major dependencies (#740) * Update all non-major dependencies * renovate dependency fix * functional flakiness workaround --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: nilay * Update all non-major dependencies (#768) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-123 suppressions update 04/12/23 (#771) * Update all non-major dependencies (#769) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-123 dependency 07/12/23 (#773) * DIAC-002 updating renovate JSON to exclude certain packages (#776) * DIAC-78 - Remove logs containing case data (#766) Co-authored-by: KleoG * Update all non-major dependencies (#774) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-002 reverting terraform updates as requires more work (#777) * DIAC-184 build fix 18-12-23 (#783) * Update all non-major dependencies (#779) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update all non-major dependencies (#784) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update all non-major dependencies (#785) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update all non-major dependencies (#786) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-110 turning on fortify (#787) * Update Terraform azurerm to ~> 3.87.0 (#790) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Merge master changes to NABA * Merge master changes to NABA --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: Matthew Carey Co-authored-by: Matthew Carey Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: Jake Cohen <101183561+JakeCohenSol@users.noreply.github.com> Co-authored-by: Nilay Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol Co-authored-by: alivenichoppa <97441560+alivenichoppa@users.noreply.github.com> Co-authored-by: nilay Co-authored-by: KleoG * RIA-8023 QA Fix: generate appeal summary for internal detained non-ADA appeals (#814) * RIA-7957 Adding event authorisation for Upload Appeal Response for respondent user (#829) * Update suppressions.xml * RIA-TASK - Fix for missing document tags when end appeal for EJP non DE case (#869) * Fix for missing document tags when end appeal for EJP non DE case * Remove unused import * Update bundle order and test * RIA-8609 - Cherry picked from commit 1e61307a 18/01/2024 to bc61a18b 23/02/2024 (#836) * RIA-8609 - Cherry picked from commit 1e61307a 18/01/2024 to bc61a18b 23/02/2024 * Cherry picked the commits from 401580ae 29/02/24 to c19c3e9b 29/03/24 * Temporarily disable FTs * Add double quotes as required * Fix failed functional tests (#870) --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-8609 - Cherry picked from 11/04/2024 a9dc2e9b to 16/04/2024 1be1d489 (#876) * Cherry picked from 11/04/2024 a9dc2e9b to 16/04/2024 1be1d489 * Fix test * RIA-TASK - Resolve conflicts (#878) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-5679 Updating suppressions (#681) * RIA-5679 Updated suppression for CVE-2023-35116 * RIA-5679 Adding suppression for CVE 2023-41080 * RIA-5679, Changed suppression to fixed dependency (#683) * RIA-5679 nightly fixes (#708) * RIA-5679 nightly fixes * DIAC-2 Updated Renovate config file, added automerge, scheduling and package… (#732) * Updated Renovate config file, added automerge, scheduling and package types. Also backdated restAssured from 5.3.1 to 5.3.0 to test Renovate * Updating extends in renovate json * Extending suppresion of CVE-2023-35116 due to no solution yet * DIAC-2 updating renovate schedule (#734) * DIAC-2 updating renovate schedule * DIAC-2 updating renovate schedule london timezone * RIA-1234 swagger workflow run fix (#736) * Update all non-major dependencies (#738) * Update all non-major dependencies * Fixing dependency for spring bootstrap. Added TODO for an upgrade * Reverting ccd-case-document-am-client to older version * Updating renovate config to no longer check for cdam upgrade --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * DIAC-2 changing deprecated config option (#742) * DIAC-2 changing deprecated config option… * RIA-0000 to rebase snl branch with remitted changes on master (#897) * DIAC-123 cdam download change fix (#806) * DIAC-123 trying cdam download auth change * DIAC-123 trying cdam download auth change * DIAC-123 trying cdam download auth change * DIAC-123 * DIAC-123 removing logging --------- Co-authored-by: KleoG * RIA-8726 - Merge SNL (BAILS) - > Master (DO NOT MERGE) (#841) * RIA-7973 * RIA-7973 Updated Bail application details template * RIA-7973 Added Bail FT scenarios pattern * RIA-7973 Fixed Ft * RIA-8119 * RIA-8119 Bail application document changes with added interpreter fields * RIA-8364 * RIA-8364 Bail template change 01134 -> 01144 * RIA-8489 * RIA-8489 Refactored interpreter language * RIA-8410 RIA-8409 Generate and store hearing notice on case (initial listing and relisting) * RIA-8410: Generate hearing documents - Create Handler, Template and configuration classes to generate notice of hearing for case relisting * RIA-8409: Generate hearing documents - Create handler, template and configuration classes to generate notice of hearing for initial listing event * RIA-8410: Some code refactoring * RIA-8508 * RIA-8508 Fix appeals refactored interpreter language * RIA-8507 * RIA-8507 Fix the field type for fcs_has_passport in BailCaseFieldDefinition * RIA-8554 * RIA-8554 Fix detention location on hearing-notice template * RIA-8554 * RIA-8554 Using enums for Field definition comparison * Update BailSubmissionTemplateProvider.java * RIA-8738: IMA - Rebasing docmosis template (#845) * Updates to fix build failure * RIA-8773: Add missing hearing centres in the hearing location to hearing address mapping document (#858) * RIA-8773 Fix rebasing of CcdScenarioRunnerTest * RIA-8774 Add logging (#862) * RIA-8774 Add logging * RIA-8770 Run functional tests on pipeline * RIA-8774 Enable logging on functional tests * RIA-8774 Enable logging on functional tests * Update DocumentTagTest.java --------- Co-authored-by: Marcellofabbri Co-authored-by: Augustine Onubeze Co-authored-by: Marcello Fabbri <56549133+Marcellofabbri@users.noreply.github.com> * RIA-TASK NABA -> Master : DO NOT MERGE (#520) * RIA-6455: Added new Hearing centre - Harmondsworth (#518) * RIA-6455: Added new Hearing centre - Harmondsworth * Fix vulnerabilities * Added Location (#519) * Added Location * Suppressions Co-authored-by: Jamie * RIA-6491: Give admin officer access to edit appeal post submission (#521) * RIA-6491: Give admin officer access to edit appeal post submission * RIA-6491: Address dependency vulnerabilities * RIA-6529: Generate Hearing Notice after listing for ADA cases (#522) * RIA-6529: Generate Hearing Notice after listing for ADA cases * Suppress vulnerabilities * Added Yarls Wood as hearing centre and also its address (#524) * Ria 6424 appeal submission summary (#527) * Added some defs to extract case data Added some puts to copy case data to field values which docmosis can use to generate the appeal submission summary * Modified tests * Formatted for sonar scan * Final changes * Refactored AppealSubmissionTemplate and added logic for displaying removal order date and time * Added tests for detained fields and removal order date * Formatted import and method line seperations for serenity checks * Added CVE suppression * Changed where appelantInDetention defaults to YesOrNo.NO * Moved the parsing of complex asylum case fields (nomsNumber, dateCustodialSentence & otherDetentionFacilityName, to a dedicated method. Modified tests to cover more scenarios and make the tests more robust by checking all other relevant fields in the same flow. * Added assertion to check size of templateFieldValues * Bundled common fields together and setting Mockito strictness to lenient * Added suppressions * RIA-6424: Fix the TypeReference class for the field - 'hasPendingBailApplications' (#528) - Changed from YesOrNo type to BailApplicationStatus type. - update relevant unit tests. * Added guards in event nomsNumber, releaseDate & removalOrderDate are empty strings (#530) * Added guards in event nomsNumber and releaseDate are empty strings * Adding suppression * Ria 6424 (#531) * Added guards in event nomsNumber and releaseDate are empty strings * Adding suppression * Added check for custodial sentence release date as it is not always guaranteed to be provided * Modified test to allow mock for containsKey method of asylumCase * Added check for custodial sentence release date as it is not always guaranteed to be provided * Modified test to allow mock for containsKey method of asylumCase * Ria 6564 hearing notice edited ada (#532) * RIA-6564 - Adding hearing notice document generation for ADA cases * RIA-6564 - Checkstyle * RIA-6564 - Adding suppression * Ria 6685 date decision letter (#545) * RIA-6685 Added logic for Date decision letter to appear in Appeal template * Formatting changes and tests * Fixed tests * added decisionLetterReceivedDate test Co-authored-by: Jamie * RIA-6685-fixed-test (#546) Co-authored-by: Jamie * Ria 6605 ada suitability document api (#547) * Saving work * Saving changes * Saving work before a forced update * Latest changes * latest changes * Added new template * Rebased * Added ADASuitabilityReviewDecision entity. Added suitability review, reason and judge to AsylumCaseDefinition. Added AdaSuitability document tag. Added suitability review event. Created pre-submit handler to generate ada suitability document. Added AdaSuitability to bundleOrder. Created new AdaSuitabilityTemplate. Added Adasuitability bean to DocumentCreatorConfiguration. Added AdaSuitabilityDocument metadata to application.yml. Created AdaSuitabilityTemplateTest. * Resolved comments in PR specifically regarding extra line seperations and variable name formatting * Added functional test for ADA suitability document generation * Adding system credentials and appropriate method to generate headers for pipeline build failures. * Fix for failing functional test: RIA-5778-end-appeal-automatically-notice-document.json * RIA-6612: Update Bundling events to include Ada suitability review do… (#549) * RIA-6612: Update Bundling events to include Ada suitability review document - new document added under section of Tribunal Documents. - added functional and unit tests. * Update owasp.dependencyCheck * Updated 'after' method call in Jenkinfile* * RIA-6694-Admin-Submit-Appeal (#551) * RIA-6694-Admin-Submit-Appeal * fixed state test --------- Co-authored-by: Jamie Co-authored-by: Dbarnes-v1 <99024336+Dbarnes-v1@users.noreply.github.com> * RIA-6700 - Allowing access to editAppeal for Admin users (#552) * RIA-6721 Added isAdmin field to templateFieldValues in appeal submission summary template. (#554) Added isAdmin field to AsylumCaseDefinition. Updated unit tests. * RIA-6702 - Internal case creation adding access to the following even… (#553) * RIA-6702 - Internal case creation adding access to the following events for Admins: 1. makeAnApplication 2. draftHearingRequirements 3. buildCase 4. submitCase 5. uploadAdditionalEvidence 6. applyForFTPAAppellant 7. requestFeeRemission * RIA-6702 - Updating unit test * RIA-6702 - Suppression * RIA-6873 appeal summary changes (#555) * RIA-6873_appeal_summary_changes * Charts java version upgraded * Adding new suppression * Change HAS_OTHER_APPEALS field type with new object class * Ria 6844 Add date to ADA suitability document (#556) * RIA-6844 Added date to ADA suitability document. Updated unit test. * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-6560 - Functional tests improvements (#568) * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Functional tests improvements * RIA-6560 - Suppress CVE-2023-20863 (#570) * Rebase from Master (#571) * fix for refactoring DocumentUploadClientApi with CaseDocumentClient. … (#502) * fix for refactoring DocumentUploadClientApi with CaseDocumentClient. DocumentManagementUploader is updated but this class is not used or ex tended by any other class * update scanbase packages * update gradle for test * suppressing org.yaml:snakeyaml:1.26 * update tvtStringProvider * update tvtStringProvider * fix build failures * fix build failures * fix build failures * Updates to fix build failures * Updates to fix secure doc store client * Bumping chart version/ fixing aliases * Updates to fix build failures * Updates to fix build failures * Updates to fix test failures * Updates to fix test failures * Updates to fix test failures * Updates to fix test failures * Updates to suppress cves to allow build to happen * fix for failing gradle build * RIA-5804: reload jenkins build * Bumping chart version/ fixing aliases * RIA-5804: fixed vulnerabilities * RIA-5804: upgraded java chart version --------- Co-authored-by: rajeshthuraiyur Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Javier Marin * Update suppressions.xml (#557) * To update azurerm version for terraform (#558) * Update state.tf * Update .terraform-version * Update variables.tf * Update main.tf * Update main.tf * Revert "To update azurerm version for terraform (#558)" (#559) This reverts commit a90efa41ddaa7b71f143c038f2355c4100e8a152. * Revert "Update suppressions.xml (#557)" (#560) This reverts commit 247256adf152dd85bd2f0dc3b3eb216478ff77a5. * Revert "fix for refactoring DocumentUploadClientApi with CaseDocumentClient. … (#502)" (#561) This reverts commit 52eab14c22caa2398868bf623ffef1c9de6540bc. * To revert cdam changes from production (#562) * Update .terraform-version * Update main.tf * Update state.tf * Update variables.tf * Update suppressions.xml * Update Chart.yaml * Update suppressions.xml * Bumping chart version/ fixing aliases * Update Chart.yaml * Update suppressions.xml --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * Update Dockerfile (#565) * Update Dockerfile * Update Dockerfile * Update suppressions.xml * Updated suppressions --------- Co-authored-by: addison-jephtah <108927648+addison-jephtah@users.noreply.github.com> Co-authored-by: rajeshthuraiyur Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Javier Marin Co-authored-by: mokainos <72137340+mokainos@users.noreply.github.com> * Updated dependencies to remove suppressed CVEs (#564) (#573) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> Co-authored-by: mcareyma Co-authored-by: Filippo Possenti * RIA-7043 add NOTICE_OF_DECISION_UT_TRANSFER document tag (#576) * RIA-7043 * Added NOTICE_OF_DECISION_UT_TRANSFER enum to DocumentTag.java * RIA-7043 * Updated DocumentTagTest.java * RIA-7043 * Updated document bundle configs * Supressed CVE-2023-28709 (#580) * Added new line character to kick off new build on pipeline (#582) * RIA-7158 request case building notification attachment letter (#583) * * Added powermock to build.gradle which is used in testing * Added template for internal cases for FTs * Added requestCaseBuilding event to enums * Added NOTIFICATION_ATTACHMENT_DOCUMENTS to asylumCase to store new AIP notification attachment docs * Added AdaListCase direction tag to fix bug where the direction cannot be parsed as it's not in the list of DirectionTag enums * Added requestCaseBuilding Doc tag * Updated bundleOrder with the new DocTag * Added holidaydates service * Added DueDateService * Added new handler/docGenerator for requestCaseBuilding event for internal ADA cases * Created new template for the new handler/docGenerator * Added asylumcaseutils * Added internalAdaBuildCase bean to DocumentCreatorConfiguration for the above new handler/template * Updated CustomerServicesProvider with new email/telephone for internal ADA cases * Added internalAdaBuildCaseDocument metadata to application.yml. Also gave CO permission for requestCaseBuilding event and added internal ADA contact details * Added unit tests for above * Added FT for LO requestCaseBuilding to verify doc generated * RIA-7158 * Moved the deconstruction of directions to AsylumCaseUtils to make it generalised for future use * Added utility class to format dates * Updated tests * Added comment as per PR review feedback * Added suppression to make CI/CD pipeline pass (#584) * RIA-7158 (#585) * Formatted date * Update suppressions.xml force build * Update minimal-aip-appeal-submitted.json * Update minimal-appeal-submitted.json * Update suppressions.xml * Update suppressions.xml * RIA-7175 Internal ADA suitability document - unsuitable (#593) * RIA-7175 Internal ADA suitability document - unsuitable * RIA-7175 Suppress CVE-2023-35116 and CVE-2023-2976 * Revert "RIA-7175 Internal ADA suitability document - unsuitable (#593)" (#594) This reverts commit 8d9236e8d0b9c89ac23bee6c4279d4d07b9c8c96. * RIA-7174 ADA suitability document - suitable (#596) * RIA-7174 ADA suitability notification doc for suitable decision * RIA-7174 Suppressing CVE-2023-35116 * RIA-7174 Changes from code review, some refactoring work also * RIA-7174 * Removed common method and put it back into the template as a private method. * RIA-7174 Added empty line at end of functional test --------- Co-authored-by: FarukH Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7175 internal ada suitability unsuitable document (#595) * RIA-7175 Internal ADA suitability document - unsuitable * RIA-7175 Fixed formatting issues after rebase branch * RIA-7172: Generate letter when 'HO Request Review' event is triggered (#597) * RIA-7172: Generate letter when 'HO Request Review' ebent is triggered - add the new letter in the Notification_letter collection. - new tag added. * RIA-7172: Fix Functional test * RIA-7172: Trigger letter generation only for ADA * RIA-7212 Internal ADA Appeal decided, allowed document generation (#598) * RIA-7212 Internal ADA Appeal decided, allowed document generation * RIA-7212 Fixed unit tests after rebase * RIA-7212 Tidying up code using common methods * RIA-7212 Refactor packages * Ria 7540 dynamic internal email/tel (#599) * RIA-7540 Updated customer service provider to return internal case dynamic email/tel * RIA-7540 updated HoReviewEvidenceLetterTemplate to get fetch dynamic email and tel * RIA-7540 updated InternalAdaDecisionsAndReasonsAllowedLetterTemplate to get fetch dynamic email and tel --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7174 Refactor package location (#600) * RIA-7175 Refactor of package (#601) * RIA-7198: Generate letter when HO maintains decision in 'Upload Appea… (#605) * RIA-7198: Generate letter when HO maintains decision in 'Upload Appeal Response' event - added new user for functional test - HomeOfficeLart - added new entity - AppealReviewOutcome. * RIA-7198: Fix customer services contact info methods * RIA-7198: Fix unit tests * RIA-7198: Fix functional test for 'end appeal automatically' event * RIA-7198: Added system env variable to secret mapping for the lart user credentials * RIA-7213_internal_ada_appeal_decided_dismissed_document: Add Dismisse… (#604) * RIA-7213_internal_ada_appeal_decided_dismissed_document: Add Dismissed - ADA (Letter) template generation, tests * RIA-7213_internal_ada_appeal_decided_dismissed_document: Fixed code styles * RIA-7213_internal_ada_appeal_decided_dismissed_document: RIA-7212 FT disabled:true * RIA-7213_internal_ada_appeal_decided_dismissed_document: RIA-7212 FT disabled:true * RIA-7213_internal_ada_appeal_decided_dismissed_document: InternalAdaDecisionsReasonsLetterAllowedGenerator(and Dismissed) refactored into one generic class with conditions, tests fixed as well * RIA-7213_internal_ada_appeal_decided_dismissed_document: InternalAdaDecisionsAndReasonsDismissedLetterTemplate refactored dueDate code lines * RIA-7200 (#602) * Added new template for hearing bundle ready letter * Added new handlers and functionality to generate this letter AFTER generate hearing bundle event when async stitching bundle event is implicitly called and is successful * Added unit/functional tests * RIA-7174 Adding new template vars to template (#607) * RIA-7174 Adding new template vars to template * RIA-7174 Functional test reworked to add directions * RIA-7174 Another functional test rework * RIA-7538 Updated config and handler to handle internal case detained non ADA document generation (#610) * RIA-7606_change_customer_service_mail (#611) * RIA-7606_change_customer_service_mail: Fix customer service mail in application.yml * RIA-7606_change_customer_service_mail: Fix customer service mail in InternalDetGenerateHearingBundleTemplateTest * RIA-7215 Updated template to handle detained non-ada letter (#612) * RIA-7200 Fix hearing centre name (#613) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7218 Allow document generation for all detained cases (#615) * RIA-7218 Allow document generation for all detained cases * RIA-7218 Functional test fixed * RIA-7159 Request case building detained letter generation (#616) * RIA-7159: WIP - Used one generator for for both detained and non-detained letter generations * RIA-7159 Final changes. tests and checkstyle changes * RIA-7159 Removing redundant unit tests --------- Co-authored-by: Neha Aggarwal Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7159 Rework of Non-ADA template to reduce duplication (#619) * RIA-7548_internal_appeal_submission_non_ada (#618) * RIA-7548_internal_appeal_submission_non_ada: Add appeal submission template for internal, non ada, detained only cases * RIA-7548_internal_appeal_submission_non_ada: styles fix * RIA-7548_internal_appeal_submission_non_ada: Add document tag, fix tests for this tag * RIA-7548_internal_appeal_submission_non_ada: Rename template, properties, configuration qualifier * RIA-7548_internal_appeal_submission_non_ada: Rename template, properties, configuration qualifier * RIA-7548_internal_appeal_submission_non_ada: Fix condition AsylumCase definition in AppealSubmissionCreator * RIA-7548_internal_appeal_submission_non_ada: Bundle sort tests fix * RIA-7216 Added appeal decided dismissed detained non ADA document templates (#622) * Update suppressions.xml * Update suppressions.xml * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record ou… (#623) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7552_appeal_can_proceed: Fix test EventTest * RIA-7552_appeal_can_proceed: Fix checkstyle * RIA-7552_appeal_can_proceed (#624) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7552_appeal_can_proceed: Fix test EventTest * RIA-7552_appeal_can_proceed: Fix checkstyle * RIA-7552_appeal_can_proceed: Reduce code duplications * Ria 7552 appeal can proceed (#626) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7552_appeal_can_proceed: Fix test EventTest * RIA-7552_appeal_can_proceed: Fix checkstyle * RIA-7552_appeal_can_proceed: Reduce code duplications * RIA-7552_appeal_can_proceed: Reduce code duplications * RIA-7552_appeal_can_proceed: Reduce code duplications * RIA-7552_appeal_can_proceed: Reduce code duplications * Ria 7554 directed to upload bundle (#628) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * Ria 7554 directed to upload bundle (#629) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * Ria 7554 directed to upload bundle (#630) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * Ria 7554 directed to upload bundle (#631) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7554_directed_to_upload_bundle: Add Doctag, configurationm generator, template for request respondent evidence letter * RIA-7554_directed_to_upload_bundle: Test fixes * RIA-7554_directed_to_upload_bundle: code review fix * RIA-7554_directed_to_upload_bundle: remove unused import * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-7554_directed_to_upload_bundle: reduce code duplications * RIA-TASK Merged master changes to Naba - documents-api (#614) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * Fixed tests --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti * RIA-7582 non_payment_end_appeal (#637) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7582_non_payment_end_appeal: Add template, generator, configuration, Asylum definitions for remission type, tests * RIA-7582_non_payment_end_appeal: Add RemissionType test * RIA-7582_non_payment_end_appeal: Fix application properties document fileName and functional test 7582 * RIA-7580 (#638) * Added new handler, template and bean config for internal detained non-ada appeal fee letter with no remissions * Imported AppealType class from case-api * Updated existing unit tests (State, BundleOrder & DocumentTag) * Added unit tests and FT * RIA-7581 Added internal detained mark as paid letter (#639) * RIA-7618 document remission partially approved rejected (#641) * RIA-7618 Initial document changes before rebase * RIA-7618 Final refactored changes after rebasing * RIA-7618 Utils method change * RIA-7618 Adding unit test for RemissionDecision class * RIA-7618 checkstyle test fix * RIA-7556 internal det ho review maintained (#640) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7556 init commit * RIA-7556_internal_det_ho_review_maintaned: Add tests unit/functional, update application.yml for new event and fix document extension in application.yml * RIA-7556_internal_det_ho_review_maintaned: Add tests for new event * RIA-7556_internal_det_ho_review_maintaned: Fix on dueDate in template and test for this template * RIA-7556_internal_det_ho_review_maintaned: Fix on functional test * RIA-7556_internal_det_ho_review_maintaned: Fix on functional test * RIA-7556_internal_det_ho_review_maintaned: Adding detenction --------- Co-authored-by: ThomasKKC * RIA-7559 DET letter case listing detained (#642) * RIA-7559 Generator and template for doc generation * RIA-7559 internal detained list case letter generation * RIA-7559 document creator values updated to correct document * RIA-7559 functional test added * RIA-7559 append document to notifications attachments group * RIA-7559 functional test fix * RIA-7559 Checkstyle and unit test fixes for pipeline * RIA-7557 Internal detained review HO response decision withdrawn letter generation (#643) * RIA-7557 * Added functionality for new letter generation when LO requests AIP to review HO response * Added new doc tag for the new letter * Refactored RIA-7556 * Added/updated unit/FTs * Rebasing * RIA-7557 * Updated FT * RIA-7561 - Added handler to generate letter when 'Request Hearing Requ… (#644) * RIA-7561: Added handler to generate letter when 'Request Hearing Requirements' Event is triggered * RIA-7561: Remove local testing code. * RIA-7561: Remove unused import. * RIA-7561: Fix BundleOrderTest after rebase. * RIA-7561: Fix PMD violations. * Update suppressions.xml * RIA-7556/RIA-7557 (#648) * Renamed document file names for home office response review decision maintained and withdrawn * RIA-7372 appeal_ended_aip_journey (#647) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7372_appeal_ended_aip_journey: Add Document tag for internal cases, generator, template, configuration, application.yml links and tests * RIA-7372_appeal_ended_aip_journey: Add functional test and bundle tests * RIA-7372_appeal_ended_aip_journey: Add functional test and bundle tests * RIA-7372_appeal_ended_aip_journey: Add functional test and bundle tests * RIA-7561: Allow LF for Request Hearing Requirements Feature (#649) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7281 Added internal detained edit case listing letter (#650) * RIA-7281 Added internal detained edit case listing letter * RIA-7281 Added extra unit tests for thrown exceptions * RIA-7374 mark_appeal_as_ada (#651) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7374_mark_appeal_as_ada: Add for internal journey mark as ada, configuration, template, document Tag, event, Bundler order tag. Populate application props with link to letter, add functional tests * RIA-7374_mark_appeal_as_ada: Fix merge conflicts * RIA-7374_mark_appeal_as_ada: Remove condition check if appeal is Ada, as well remove from tests functional and junit * RIA-7364 internal decideAnApplication letter generation (#653) * RIA-7364 * Added functionality for decideAnApplication letter generation for internal cases * Copied across makeAnApplication logic and its parsing/extraction from case data * Added new doc tag * Added/updated unit and FTs * RIA-7364 * Updated FTs * RIA-7364 Made some changes for sonar cloud failures (#655) * Added isPresent() check * Updated assertion for default case in enhanced switch statement * Update suppressions.xml * RIA-7328 ho_ftpa_submitted (#657) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7328_ho_ftpa_submitted: Add DocumentTag, Populate BundlerOrder, DocumentCreatorConfiguration for APPLY_FOR_FTPA_RESPONDENT. Add roles, junit/functional tests for APPLY_FOR_FTPA_RESPONDENT * RIA-7328_ho_ftpa_submitted: Fix FT credentials for FTPA respondent apply * RIA-7328_ho_ftpa_submitted: Fix FT credentials for FTPA respondent apply * RIA-7328_ho_ftpa_submitted: Fix jenkins roles mappings * RIA-7328_ho_ftpa_submitted: Fix jenkins roles mappings * RIA-7365 (#660) * Added new template for internal decide an application where decision is refused * Refactored 7364 so granted+refused use a single handler with independent DocumentCreatorConfiguration beans and seperate templates. * Added/updated unit/FTs. Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7701 Added transfer out of ADA letter (#661) * RIA-7326 (#663) * Added functionality to generate letter when admin officer applies for ftpa for internal cases * Added/updated tests * RIA-7326 (#665) * Updated doc tag * RIA-7330 Internal appellant FTPA decided granted document (#670) * RIA-7330 Internal appellant FTPA decided granted document * RIA-7330 Checkstyle and unit test fixes * Update suppressions.xml * Update suppressions.xml * RIA-7360 ho_ftpa_decided_granted (#671) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7360_ho_ftpa_decided_granted: Add Letter, Configuration, changes to InternalFtpaDecidedLetterGenerator for HO FTPA decided granted. Add Tests and functional test, Document.tag, Definitions. * RIA-7361 ho_ftpa_decided_partially_granted (#672) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7361_ho_ftpa_decided_partially_granted: Add Letter, Configuration, changes to InternalFtpaDecidedLetterGenerator for HO FTPA decided partially granted. Add Tests and functional test * RIA-7326 (#673) * Give LR permission for applyForFTPAAppellant event doc generation * RIA-7362 ho_ftpa_decided_refused (#675) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7362_ho_ftpa_decided_refused: Add Letter, Configuration, changes to InternalFtpaDecidedLetterGenerator for HO FTPA decided refused. Add Tests and functional test * RIA-7362_ho_ftpa_decided_refused: Fix typo * RIA-7331 Internal appellant ftpa decided - partially granted document (#676) * RIA-7331 Internal appellant ftpa decided - partially granted document * RIA-7331 Corrected deadline date values for ada and non-ada * RIA-7332 Document for Appellant ftp decided - refused (#677) * RIA-7332 Document for Appellant ftp decided - refused * RIA-7332 Suppressing CVE-2023-41080 * RIA-7332 Split functional test into ADA and non-ADA scenarios * RIA-7332 Functional test file rename * RIA-7331 Further changes to ADA working days scenario (#678) * RIA-7330 Split functional tests into ADA and non-ADA scenarios (#679) * RIA-7330 Split functional tests into ADA and non-ADA scenarios * RIA-7330 rename FT title for non-ADA FT * RIA-TASK - Merged Master changes to NABA case-documents (#669) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * Merged Master changes to NABA * Merged Master changes to NABA * Merged Master changes to NABA * Merged Master changes to NABA * Merged Master changes to NABA * Update suppressions.xml * Merged Master changes to NABA --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: Matthew Carey Co-authored-by: Matthew Carey Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> * RIA-7844 (#682) * Added content for application type - reinstate to InternalDecideAnApplicationDecisionGrantedLetterTemplate.getWhatHappensNextContent() * Added reinstate content test * Added FTs for reinstate application type when decided * RIA-7844 (#684) * Adding full stop to String * RIA-7322 Internal hearing requirements updated letter generation (#686) * RIA-7367 (#685) * Refactored internal appellant application decided (refused+granted) * Updated internalApplicationDecided handler to pick correct DocumentCreatorCongif bean based on granted/refused and appellant/respondent application * Added new bean for HO decide application * Added/updated unit tests * Refactored 7364 FTs to include Admin Officer as application applicant * Added new FTs * RIA-7368 (#690) * Addedn functionality to generate letter when HO application decided * Refactored RIA-7365 * Added/updated unit/FTs * RIA-7372 appeal_ended (#688) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7372_appeal_ended: change decisionMaker to fetch from END_APPEAL_APPROVER_TYPE, fix endAppealDate fortmat, fix tests * RIA-7372_appeal_ended: remove unused import --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7322 hearingDate removed from template (#691) * RIA-7561: Fix the deadline date in the 'Request Hearing Requirements' letter (#687) Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7378 unlink_appeal (#693) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: Add new Document letter generation for Maintain Case Link event. * RIA-7378_unlink_appeal: Change tag name * RIA-7378_unlink_appeal: Change tag name * RIA-7378_unlink_appeal: remove unused import * RIA-7378 unlink case (#694) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: refactor test method name * RIA-7427 Internal upload additional evidence doc generation (#695) * RIA-7427 Internal upload additional evidence doc generation * RIA-7427 Test and checkstyle fixes * RIA-7378 unlink_case (#696) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: refactor test method name * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378 unlink_case (#697) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: refactor test method name * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378_unlink_appeal: Rename classes, tags to 'Maintain case unlink appeal' * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7378 unlink_appeal (#698) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7378 unlink_appeal (#699) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7378_unlink_appeal: Fix the code duplication issue on Sonar Cloud * RIA-7895 bug_fix_rule3235 (#700) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7895_bug_fix_rule3235: Populate FtpaDecisionOutcomeType with values of 23 and 35 rules --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7279 (#705) * Added handler and template for generating letter when LO requests HO to amend appeal response * Imported isValidUserDirection from notifications-api. * Added/updated unit and FTs * RIA-7376 link_case (#704) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7376_link_case_det: Add Event create case link. Template, configurations, tests * RIA-7376_link_case_det: Fix unit test * RIA-7376_link_case_det: Fix intends * RIA-7376_link_case_det: populate FT with more values, AsylumCase object mapper populated with dateTime module * RIA-7376_link_case_det: merge conflicts * RIA-7437 internal non standard direction letter (#706) * RIA-7437 Non standard direction to appellant - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, second time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, third time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, third time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating tests, Fourth time - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating functional tests - ADA & NonADA (Letter) * RIA-7437 Non standard direction to appellant, updating functional tests, try two - ADA & NonADA (Letter) * RIA-7437 - Renamed bean * RIA-7437 - fixed functional tests * RIA-7437 Non standard direction to appellant, resolving comments (Letter) * RIA-7437 Non standard direction to appellant, fixing checkstyle error (Letter) --------- Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> Co-authored-by: colmlynch60 * RIA-7376 link_cases (#711) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7376_link_cases: fix dates serialization mechanism * RIA-7376_link_cases: fix styles * RIA-7437 Generate letter when party is APPELLANT_AND_RESPONDENT in 'S… (#714) * RIA-7437 Generate letter when party is APPELLANT_AND_RESPONDENT in 'Send Direction' event * Update renovate.json --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-7433 Generate letter when LO changes hearing centre for detained… (#702) * RIA-7433: Generate letter when LO changes hearing centre for detained internal appeals * RIA-7433 updated functional test description * RIA-7433: Added FT for non-ADA appeal * Fix checkstyle errors * RIA-7418 Appeal edited - ADA & Non ADA (Letter) (#717) * RIA-7418: added new edit template letter and logic behind * RIA-7418: fixed BundleOrderTest.java * RIA-7432: Fix template to reflect old and new hearing centres (#721) * RIA-7370 (#719) * Refactored implementation of RIA-7427 to make InternalUploadAdditionalEvidenceGenerator generic for all users * Imported HasDocument interface and made current implementation of DocumentWithMetadata implement it * Imported events from case-api * Added 2 new doc tags (LO additional evidence upload and HO additional evidence upload) * Created 2 new templates for HO and LO additional evidence upload * Added new methods in AsylumCaseUtils to extract addendum evidence documents and to fetch most recent addendum evidence added * Created 2 new beans in DocumentCreatorConfiguration (LO/HO additional evidence upload) * 2 new application.yaml entries for document templates * Updated existing tests and added new unit/FTs * RIA-7370 Provide home office apc permission for uploadAdditionalEvidenceHomeOffice and uploadAddendumEvidenceHomeOffice (#725) * RIA-7370 * Provide home office apc permission for uploadAdditionalEvidenceHomeOffice and uploadAddendumEvidenceHomeOffice * RIA-7370 * Fixed sonar check. Performing isEmpty() check on optional var before a .get() * RIA-7370 (#727) * Added a null check on addendum metadata * Suppress CVE (#728) * RIA-7471 letter generation direction due date changed (#715) * RIA-7471 Letter generation when 'Change Direction due date' is triggered - for ADA and non ADA internal cases - when recipient party is either APPELLANT or APPELLANT AND RESPONDENT. * Fix naming of a variable * RIA-7471 - fixed unit test * RIA-7471 Fix functional tests * Fix unit test * Fix template personalisations * Fix name for template env variable --------- Co-authored-by: colmlynch60 * RIA-7435 Home_office_non-Standard_direction_letter (#730) Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> * RIA-7439 ho_change_direction_due_date (#729) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7439_ho_direction_due_date: Add Ho change direction due date letter, configurations, tests for internal DET cases * RIA-7439_ho_direction_due_date: Move method isPartyIsRespondent ot Utils * RIA-7439_ho_direction_due_date: remove spaces * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: merge tests fix * RIA-7439_ho_direction_due_date: merge conflicts resolve * RIA-7439 ho_change_direction_due_date (#731) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7439_ho_direction_due_date: Add Ho change direction due date letter, configurations, tests for internal DET cases * RIA-7439_ho_direction_due_date: Move method isPartyIsRespondent ot Utils * RIA-7439_ho_direction_due_date: remove spaces * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: merge tests fix * RIA-7439_ho_direction_due_date: merge conflicts resolve * RIA-7439_ho_direction_due_date: resolving code duplication Sonar Cloud issue * RIA-7439 ho_change_direction_due_date (#735) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7439_ho_direction_due_date: Add Ho change direction due date letter, configurations, tests for internal DET cases * RIA-7439_ho_direction_due_date: Move method isPartyIsRespondent ot Utils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: Add test for AsylumUtils * RIA-7439_ho_direction_due_date: resolving code duplication Sonar Cloud issue * RIA-7439_ho_direction_due_date: resolving code duplication Sonar Cloud issue * RIA-7429 Letter generation for Internal Reinstate Appeal (#722) * RIA-7435 Rename the letter generator class and corresponding unit tests (#737) * RIA-7435 Rename the letter generator class and corresponding unit tests * Fix checkstyle error * Fix functional tests * Fixing functional test * RIA-7911 Update hearing adjustments (#739) * RIA-7911_Update_hearing_adjustments * RIA-7911 Update hearing adjustments functional tests --------- Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> * Update suppressions.xml * Update suppressions.xml * RIA-7537 EJP Adding new roles for legal officer (#746) Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> * RIA-8888 Upgraded chart version (#751) * RIA-8888 Upgraded chart version * RIA-8888 revert version because it is auto bumped * RIA-8888 added suppressions * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7411 Removing OOC feature flag fields (#743) (#754) * RIA-7411 Removing OOC feature flag fields * RIA-7411 Suppressing CVE-2023-42794, CVE-2023-42795, CVE-2023-45648 Co-authored-by: Ryan-Nesbitt <95298094+Ryan-Nesbitt@users.noreply.github.com> * RIA-TASK - Merge master changes to NABA - ia-case-documents-api (#760) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-5679 Updating suppressions (#681) * RIA-5679 Updated suppression for CVE-2023-35116 * RIA-5679 Adding suppression for CVE 2023-41080 * RIA-5679, Changed suppression to fixed dependency (#683) * RIA-5679 nightly fixes (#708) * RIA-5679 nightly fixes * DIAC-2 Updated Renovate config file, added automerge, scheduling and package… (#732) * Updated Renovate config file, added automerge, scheduling and package types. Also backdated restAssured from 5.3.1 to 5.3.0 to test Renovate * Updating extends in renovate json * Extending suppresion of CVE-2023-35116 due to no solution yet * DIAC-2 updating renovate schedule (#734) * DIAC-2 updating renovate schedule * DIAC-2 updating renovate schedule london timezone * RIA-1234 swagger workflow run fix (#736) * Update all non-major dependencies (#738) * Update all non-major dependencies * Fixing dependency for spring bootstrap. Added TODO for an upgrade * Reverting ccd-case-document-am-client to older version * Updating renovate config to no longer check for cdam upgrade --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * DIAC-2 changing deprecated config option (#742) * DIAC-2 changing deprecated config option * DIAC-2 adding config option for exluding major updates * DIAC-000 Dependency fix (#749) * dependency fix * updating pr validation --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: Matthew Carey Co-authored-by: Matthew Carey Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: Jake Cohen <101183561+JakeCohenSol@users.noreply.github.com> Co-authored-by: Nilay Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * Removed print line that causes issues on windows (#762) * RIA-7950 upgrade_fix (#767) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-7950_upgrade_fix: trigger rebuild * RIA-2023 rebuild_pipelines (#775) * RIA-7552_appeal_can_proceed: Add Asylum case definition for Record out of time decision, Letter template, Letter generator and configuration, tests * RIA-20231212_rebuild_pipelines: Restart pipelines * RIA-20231212_rebuild_pipelines: Add supressions * Update suppressions.xml * RIA-7324 Hearing adjourned without a date - ADA & Non ADA (Letter) (#788) * RIA-7324: added adjourn hearing without date letter template * RIA-7324: small fix on DocumentTag applied * RIA-8214 Add a new screen to Bails start application - UT appeal pending (#791) * RIA-8214: bail application submission template fixed with new fields * RIA-8214: small refactor name on definitions * Revert "RIA-8214 Add a new screen to Bails start application - UT appeal pending" (#793) * RIA-TASK - Merge master changes to NABA - ia-case-documents-api (#792) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-5679 Updating suppressions (#681) * RIA-5679 Updated suppression for CVE-2023-35116 * RIA-5679 Adding suppression for CVE 2023-41080 * RIA-5679, Changed suppression to fixed dependency (#683) * RIA-5679 nightly fixes (#708) * RIA-5679 nightly fixes * DIAC-2 Updated Renovate config file, added automerge, scheduling and package… (#732) * Updated Renovate config file, added automerge, scheduling and package types. Also backdated restAssured from 5.3.1 to 5.3.0 to test Renovate * Updating extends in renovate json * Extending suppresion of CVE-2023-35116 due to no solution yet * DIAC-2 updating renovate schedule (#734) * DIAC-2 updating renovate schedule * DIAC-2 updating renovate schedule london timezone * RIA-1234 swagger workflow run fix (#736) * Update all non-major dependencies (#738) * Update all non-major dependencies * Fixing dependency for spring bootstrap. Added TODO for an upgrade * Reverting ccd-case-document-am-client to older version * Updating renovate config to no longer check for cdam upgrade --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * DIAC-2 changing deprecated config option (#742) * DIAC-2 changing deprecated config option * DIAC-2 adding config option for exluding major updates * DIAC-000 Dependency fix (#749) * dependency fix * updating pr validation * DIAC-66 getting all functionals to run (#747) * DIAC-66 getting all functionals to run * DIAC-66 dependency update * DIAC-66 dependency update * DIAC-70 adding integration, smoke and unit testing and report to nightly runs * DIAC-70 removing integration * DIAC-70 adding secrets * DIAC-70 adding mutation test reporting * DIAC-70 adding mutation test reporting * DIAC-66 integration tests * DIAC-66 dependency upgrade * DIAC-66 checkstyle fix * DIAC-66 java chart upgrade * DIAC-00 Revert pact dependency upgrade (#759) * DIAC-84 Disable Decision and reasons document PDF conversion (#752) * DIAC-84 Disable Decision and reasons document PDF conversion * Remove PDF conversion * upgrade java helm chart * Delete Decision and reasons document PDF conversion files * suppress CVE-2023-35116 * Update test names and add test for document null check * fix test * Update final decision and document name * rename pdf service to file rename service * update ia-case-api url * Fix functional tests * test * Bumping chart version/ fixing aliases * cleanup --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * Update all non-major dependencies (#740) * Update all non-major dependencies * renovate dependency fix * functional flakiness workaround --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: nilay * Update all non-major dependencies (#768) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-123 suppressions update 04/12/23 (#771) * Update all non-major dependencies (#769) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-123 dependency 07/12/23 (#773) * DIAC-002 updating renovate JSON to exclude certain packages (#776) * DIAC-78 - Remove logs containing case data (#766) Co-authored-by: KleoG * Update all non-major dependencies (#774) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-002 reverting terraform updates as requires more work (#777) * DIAC-184 build fix 18-12-23 (#783) * Update all non-major dependencies (#779) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update all non-major dependencies (#784) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update all non-major dependencies (#785) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update all non-major dependencies (#786) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * DIAC-110 turning on fortify (#787) * Update Terraform azurerm to ~> 3.87.0 (#790) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Merge master changes to NABA * Merge master changes to NABA --------- Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: Matthew Carey Co-authored-by: Matthew Carey Co-authored-by: rajeshthuraiyur <48379561+rajeshthuraiyur@users.noreply.github.com> Co-authored-by: Jake Cohen <101183561+JakeCohenSol@users.noreply.github.com> Co-authored-by: Nilay Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol Co-authored-by: alivenichoppa <97441560+alivenichoppa@users.noreply.github.com> Co-authored-by: nilay Co-authored-by: KleoG * RIA-8023 QA Fix: generate appeal summary for internal detained non-ADA appeals (#814) * RIA-7957 Adding event authorisation for Upload Appeal Response for respondent user (#829) * Update suppressions.xml * RIA-TASK - Fix for missing document tags when end appeal for EJP non DE case (#869) * Fix for missing document tags when end appeal for EJP non DE case * Remove unused import * Update bundle order and test * RIA-8609 - Cherry picked from commit 1e61307a 18/01/2024 to bc61a18b 23/02/2024 (#836) * RIA-8609 - Cherry picked from commit 1e61307a 18/01/2024 to bc61a18b 23/02/2024 * Cherry picked the commits from 401580ae 29/02/24 to c19c3e9b 29/03/24 * Temporarily disable FTs * Add double quotes as required * Fix failed functional tests (#870) --------- Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> * RIA-8609 - Cherry picked from 11/04/2024 a9dc2e9b to 16/04/2024 1be1d489 (#876) * Cherry picked from 11/04/2024 a9dc2e9b to 16/04/2024 1be1d489 * Fix test * RIA-TASK - Resolve conflicts (#878) * Fix functional tests (#588) * Fix functional tests * Fix functional tests * RIA-7385 Removed pedantic checkstyle rules (#589) * RIA-7384 Enforce conventions on commit messages and branches (#591) * RIA-7378 - preventing application startup if secrets can't be found (#608) * RIA-7378 - added ConfigValidatorAppListener + test * RIA-7378 - update * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7319 - Gradle + Java 17 + AppInsights Upgrade (#587) Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-7722 Solve suppressions (#632) * RIA-5804 using feature flag (#586) Co-authored-by: Matthew Carey Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> * RIA-7802 To fix incorrect env value for PROD (#656) * Update values.yaml * Bumping chart version/ fixing aliases --------- Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> * RIA-5679 Updating suppressions (#681) * RIA-5679 Updated suppression for CVE-2023-35116 * RIA-5679 Adding suppression for CVE 2023-41080 * RIA-5679, Changed suppression to fixed dependency (#683) * RIA-5679 nightly fixes (#708) * RIA-5679 nightly fixes * DIAC-2 Updated Renovate config file, added automerge, scheduling and package… (#732) * Updated Renovate config file, added automerge, scheduling and package types. Also backdated restAssured from 5.3.1 to 5.3.0 to test Renovate * Updating extends in renovate json * Extending suppresion of CVE-2023-35116 due to no solution yet * DIAC-2 updating renovate schedule (#734) * DIAC-2 updating renovate schedule * DIAC-2 updating renovate schedule london timezone * RIA-1234 swagger workflow run fix (#736) * Update all non-major dependencies (#738) * Update all non-major dependencies * Fixing dependency for spring bootstrap. Added TODO for an upgrade * Reverting ccd-case-document-am-client to older version * Updating renovate config to no longer check for cdam upgrade --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol * DIAC-2 changing deprecated config option (#742) * DIAC-2 changing deprecated config… * RIA-8856 appeals notice of hearing displays the correct location information 2 (#899) * RIA-8856 appeals notice of hearing displays the correct location information * fix the unit test problem * RIA-8839: Refactor the handling of 'decisionWithoutHearing' appeals (#901) * Update suppressions.xml * Update values.yaml * Update application.yaml * Update build.gradle * Bumping chart version/ fixing aliases --------- Co-authored-by: Augustine Onubeze Co-authored-by: Augustine Onubeze Co-authored-by: DennisHoV1 <106669367+DennisHoV1@users.noreply.github.com> Co-authored-by: burnstHMCTS <134689347+burnstHMCTS@users.noreply.github.com> Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com> Co-authored-by: filippo-possenti-version1 <109352283+filippo-possenti-version1@users.noreply.github.com> Co-authored-by: Filippo Possenti Co-authored-by: Marcellofabbri Co-authored-by: Marcello Fabbri <56549133+Marcellofabbri@users.noreply.github.com> Co-authored-by: Miguel Martin Co-authored-by: ThomasKKC <99262639+ThomasKKC@users.noreply.github.com> Co-authored-by: Ryan-Nesbitt <95298094+Ryan-Nesbitt@users.noreply.github.com> Co-authored-by: robin-ieong <101253854+robin-ieong@users.noreply.github.com> Co-authored-by: NehaAggarwal Co-authored-by: Nilay Co-authored-by: KleoG Co-authored-by: colmlynch60 <113999496+colmlynch60@users.noreply.github.com> Co-authored-by: JamieHMCTS <100787551+JamieHMCTS@users.noreply.github.com> Co-authored-by: Jamie Co-authored-by: hussain-faruk <118450580+hussain-faruk@users.noreply.github.com> Co-authored-by: Dbarnes-v1 <99024336+Dbarnes-v1@users.noreply.github.com> Co-authored-by: addison-jephtah <108927648+addison-jephtah@users.noreply.github.com> Co-authored-by: Javier Marin Co-authored-by: mokainos <72137340+mokainos@users.noreply.github.com> Co-authored-by: mcareyma Co-authored-by: FarukH Co-authored-by: ikirsanov <105438011+ikirsanov@users.noreply.github.com> Co-authored-by: ThomasKKC Co-authored-by: Matthew Carey Co-authored-by: jamieclarkeHMCTS <128475668+jamieclarkeHMCTS@users.noreply.github.com> Co-authored-by: JamieClarkeV1 <120718578+JamieClarkeV1@users.noreply.github.com> Co-authored-by: Javier Marin <44240533+javimarinc96@users.noreply.github.com> Co-authored-by: Jake Cohen <101183561+JakeCohenSol@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JakeCohenSol Co-authored-by: Javier Marin <113532520+javierhmcts@users.noreply.github.com> Co-authored-by: alivenichoppa <97441560+alivenichoppa@users.noreply.github.com> Co-authored-by: nilay Co-authored-by: kalachandrasekar1 <114995593+kalachandrasekar1@users.noreply.github.com> Co-authored-by: Andrey Pereverzin Co-authored-by: robin-ieong --- .github/renovate.json | 2 +- build.gradle | 3 +- charts/ia-case-documents-api/Chart.yaml | 2 +- charts/ia-case-documents-api/values.yaml | 66 ++++-- config/owasp/suppressions.xml | 20 +- .../CcdScenarioRunnerTest.java | 27 +-- .../util/AuthorizationHeadersProvider.java | 17 +- ...g-requirements-document-judge-reheard.json | 6 +- ...e-hearing-requirements-document-judge.json | 6 +- ...ing-requirements-document-tcw-reheard.json | 6 +- ...ate-hearing-requirements-document-tcw.json | 6 +- ...it-giving-evidence-in-country-reheard.json | 6 +- ...nts-submit-giving-evidence-in-country.json | 6 +- ...ts-submit-giving-evidence-ooc-reheard.json | 6 +- ...quirements-submit-giving-evidence-ooc.json | 6 +- ...te-giving-evidence-in-country-reheard.json | 6 +- ...nts-update-giving-evidence-in-country.json | 6 +- ...ts-update-giving-evidence-ooc-reheard.json | 6 +- ...quirements-update-giving-evidence-ooc.json | 6 +- ...-appeal-automatically-notice-document.json | 1 + ...-requirements-interpreter-information.json | 208 ++++++++++++++++++ ...-requirements-interpreter-information.json | 208 ++++++++++++++++++ ...ined_legal_rep_first_and_family_names.json | 45 ++++ ...ing-notice-document-iac-harmondsworth.json | 55 +++++ .../RIA-8514-record-adjournment-details.json | 53 +++++ .../infrastructure/TsvStringProviderTest.java | 100 +++++++++ .../domain/entities/AsylumCaseDefinition.java | 149 +++++++++++++ .../entities/BailCaseFieldDefinition.java | 22 +- .../domain/entities/DocumentTag.java | 3 + .../domain/entities/DynamicList.java | 2 +- .../domain/entities/HearingCentre.java | 12 +- .../entities/InterpreterLanguageCategory.java | 3 +- .../entities/InterpreterLanguageRefData.java | 3 +- .../entities/InterpreterLanguagesUtils.java | 64 ++++++ .../domain/entities/ListingEvent.java | 5 +- .../domain/entities/Value.java | 3 +- ...WitnessInterpreterLanguageInformation.java | 15 ++ .../domain/entities/ccd/Event.java | 3 + .../entities/ccd/field/WitnessDetails.java | 26 +++ .../presubmit/HearingNoticeCreator.java | 8 +- .../presubmit/HearingNoticeEditedCreator.java | 7 +- .../RecordAdjournmentDetailsCreator.java | 61 +++++ .../domain/service/BundleOrder.java | 6 +- .../service/HearingNoticeFieldMapper.java | 17 +- .../templates/AppealSubmissionTemplate.java | 12 +- .../HearingRequirementsTemplate.java | 104 ++++++++- ...NoticeOfHearingInitialListingTemplate.java | 3 +- .../BailNoticeOfHearingRelistingTemplate.java | 2 +- .../bail/BailNoticeOfHearingTemplate.java | 41 +++- .../infrastructure/HearingDetailsFinder.java | 86 +++----- .../clients/model/refdata/CourtVenue.java | 22 ++ .../config/DocumentCreatorConfiguration.java | 21 ++ .../HearingNoticeTemplateConfiguration.java | 6 + .../advice/CallbackControllerAdvice.java | 2 +- src/main/resources/application.yaml | 15 +- src/main/resources/strings.tsv | 2 +- .../entities/BailCaseFieldDefinitionTest.java | 2 +- .../domain/entities/DocumentTagTest.java | 3 +- .../domain/entities/DynamicListTest.java | 34 +++ .../domain/entities/HearingCentreTest.java | 22 +- .../domain/entities/ccd/EventTest.java | 3 +- .../ccd/field/WitnessDetailsTest.java | 31 ++- .../presubmit/HearingNoticeCreatorTest.java | 29 ++- .../HearingNoticeEditedCreatorTest.java | 32 ++- .../RecordAdjournmentDetailsCreatorTest.java | 130 +++++++++++ .../domain/service/BundleOrderTest.java | 3 +- .../service/HearingNoticeFieldMapperTest.java | 50 ++++- .../AppealSubmissionTemplateTest.java | 39 ++++ .../BailSubmissionTemplateProviderTest.java | 3 +- .../templates/BailSubmissionTemplateTest.java | 1 - .../CmaAppointmentNoticeTemplateTest.java | 13 +- .../templates/HearingNoticeTemplateTest.java | 11 +- ...ringNoticeUpdatedTemplateProviderTest.java | 11 +- .../HearingRequirementsTemplateTest.java | 134 ++++++++++- ...ceOfHearingInitialListingTemplateTest.java | 52 ++++- ...lNoticeOfHearingRelistingTemplateTest.java | 55 +++++ .../HearingDetailsFinderTest.java | 9 + 77 files changed, 2060 insertions(+), 211 deletions(-) create mode 100644 src/functionalTest/resources/scenarios/RIA-7567-draft-hearing-requirements-interpreter-information.json create mode 100644 src/functionalTest/resources/scenarios/RIA-7567-update-hearing-requirements-interpreter-information.json create mode 100644 src/functionalTest/resources/scenarios/RIA-7574-appeal-submission-document_with_combined_legal_rep_first_and_family_names.json create mode 100644 src/functionalTest/resources/scenarios/RIA-7879-hearing-notice-document-iac-harmondsworth.json create mode 100644 src/functionalTest/resources/scenarios/RIA-8514-record-adjournment-details.json create mode 100644 src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguagesUtils.java create mode 100644 src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/WitnessInterpreterLanguageInformation.java create mode 100644 src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreator.java create mode 100644 src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/clients/model/refdata/CourtVenue.java create mode 100644 src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicListTest.java create mode 100644 src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreatorTest.java diff --git a/.github/renovate.json b/.github/renovate.json index a84337d9a..2fc57fbfd 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -37,4 +37,4 @@ "schedule": [ "before 3am every weekday" ] -} \ No newline at end of file +} diff --git a/build.gradle b/build.gradle index 773609c65..5d107f8ae 100644 --- a/build.gradle +++ b/build.gradle @@ -349,7 +349,7 @@ dependencies { implementation group: 'uk.gov.hmcts.reform', name: 'logging', version: versions.reformLogging implementation group: 'uk.gov.hmcts.reform', name: 'logging-appinsights', version: versions.reformLogging implementation group: 'uk.gov.hmcts.reform', name: 'service-auth-provider-client', version: '3.1.4' - implementation group: 'uk.gov.hmcts.reform', name: 'properties-volume-spring-boot-starter', version: '0.1.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0' implementation group: 'commons-io', name: 'commons-io', version: '2.16.0' @@ -381,6 +381,7 @@ dependencies { testImplementation group: 'net.serenity-bdd', name: 'serenity-junit', version: versions.serenity testImplementation group: 'net.serenity-bdd', name: 'serenity-rest-assured', version: versions.serenity testImplementation group: 'net.serenity-bdd', name: 'serenity-spring', version: versions.serenity + testImplementation group: 'com.github.hmcts', name: 'ccd-case-document-am-client', version: '1.7.3' testImplementation group: 'com.github.hmcts', name: 'fortify-client', version: '1.4.1', classifier: 'all', { diff --git a/charts/ia-case-documents-api/Chart.yaml b/charts/ia-case-documents-api/Chart.yaml index 6cf09edf3..58d257360 100644 --- a/charts/ia-case-documents-api/Chart.yaml +++ b/charts/ia-case-documents-api/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: ia-case-documents-api home: https://github.com/hmcts/ia-case-documents-api -version: 0.0.40 +version: 0.0.41 description: Immigration & Asylum Case Documents Service maintainers: - name: HMCTS Immigration & Asylum Team diff --git a/charts/ia-case-documents-api/values.yaml b/charts/ia-case-documents-api/values.yaml index 32a20ccf7..4d5baa11c 100644 --- a/charts/ia-case-documents-api/values.yaml +++ b/charts/ia-case-documents-api/values.yaml @@ -20,25 +20,47 @@ java: ia: resourceGroup: ia secrets: - - system-username - - system-password - - idam-client-id - - idam-secret - - s2s-secret - - s2s-microservice - - em-stitching-enabled - - docmosis-access-key - - launch-darkly-sdk-key - - ia-config-validator-secret - - AppInsightsInstrumentationKey - - customer-services-telephone - - customer-services-email - - hearing-centre-bradford-email - - hearing-centre-manchester-email - - hearing-centre-newport-email - - hearing-centre-taylor-house-email - - hearing-centre-north-shields-email - - hearing-centre-birmingham-email - - hearing-centre-hatton-cross-email - - hearing-centre-glasgow-email - - app-insights-connection-string + - name: system-username + alias: IA_SYSTEM_USERNAME + - name: system-password + alias: IA_SYSTEM_PASSWORD + - name: idam-client-id + alias: IA_IDAM_CLIENT_ID + - name: idam-secret + alias: IA_IDAM_SECRET + - name: s2s-secret + alias: idam.s2s-auth.totp_secret + - name: s2s-microservice + alias: IA_S2S_MICROSERVICE + - name: em-stitching-enabled + alias: IA_EM_STITCHING_ENABLED + - name: docmosis-access-key + alias: DOCMOSIS_ACCESS_KEY + - name: launch-darkly-sdk-key + alias: LAUNCH_DARKLY_SDK_KEY + - name: ia-config-validator-secret + alias: IA_CONFIG_VALIDATOR_SECRET + - name: AppInsightsInstrumentationKey + alias: azure.application-insights.instrumentation-key + - name: customer-services-telephone + alias: IA_CUSTOMER_SERVICES_TELEPHONE + - name: customer-services-email + alias: IA_CUSTOMER_SERVICES_EMAIL + - name: hearing-centre-bradford-email + alias: IA_HEARING_CENTRE_BRADFORD_EMAIL + - name: hearing-centre-manchester-email + alias: IA_HEARING_CENTRE_MANCHESTER_EMAIL + - name: hearing-centre-newport-email + alias: IA_HEARING_CENTRE_NEWPORT_EMAIL + - name: hearing-centre-taylor-house-email + alias: IA_HEARING_CENTRE_TAYLOR_HOUSE_EMAIL + - name: hearing-centre-north-shields-email + alias: IA_HEARING_CENTRE_NORTH_SHIELDS_EMAIL + - name: hearing-centre-birmingham-email + alias: IA_HEARING_CENTRE_BIRMINGHAM_EMAIL + - name: hearing-centre-hatton-cross-email + alias: IA_HEARING_CENTRE_HATTON_CROSS_EMAIL + - name: hearing-centre-glasgow-email + alias: IA_HEARING_CENTRE_GLASGOW_EMAIL + - name: app-insights-connection-string + alias: app-insights-connection-string diff --git a/config/owasp/suppressions.xml b/config/owasp/suppressions.xml index 3e8a026e0..4a57fb45a 100644 --- a/config/owasp/suppressions.xml +++ b/config/owasp/suppressions.xml @@ -3,7 +3,7 @@ CVE-2022-45688 - - CVE-2023-35116 + + CVE-2023-35116 + + + ![CDATA[ + Temporary suppression. + ]] + CVE-2023-42794 + CVE-2023-44487 + CVE-2023-42795 + CVE-2023-45648 + CVE-2023-6481 + CVE-2023-34055 + CVE-2023-33202 + CVE-2023-46589 + CVE-2023-6378 Suppress until org.springframework.cloud, service-auth-provider-client, document-management-client and cd-case-document-am-cli upgrade their org.bouncycastle dependents diff --git a/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/CcdScenarioRunnerTest.java b/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/CcdScenarioRunnerTest.java index ab7eef73f..a38f61088 100644 --- a/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/CcdScenarioRunnerTest.java +++ b/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/CcdScenarioRunnerTest.java @@ -11,12 +11,7 @@ import io.restassured.http.Headers; import java.io.IOException; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; import java.util.stream.StreamSupport; @@ -76,7 +71,7 @@ void authenticateMe() { public void setup() { MapSerializer.setObjectMapper(objectMapper); RestAssured.baseURI = targetInstance; - RestAssured.useRelaxedHTTPSValidation(); + RestAssured.useRelaxedHTTPSValidation(); } @Test @@ -100,10 +95,9 @@ public void scenarios_should_behave_as_specified() throws IOException { scenarioPattern = "*" + scenarioPattern + "*.json"; } - Collection scenarioSources = - StringResourceLoader - .load("/scenarios/" + scenarioPattern) - .values(); + Collection scenarioSources = new ArrayList<>(); + scenarioSources.addAll(StringResourceLoader.load("/scenarios/" + scenarioPattern).values()); + scenarioSources.addAll(StringResourceLoader.load("/scenarios/bail/" + scenarioPattern).values()); System.out.println((char) 27 + "[36m" + "-------------------------------------------------------------------"); System.out.println((char) 27 + "[33m" + "RUNNING " + scenarioSources.size() + " SCENARIOS"); @@ -112,8 +106,10 @@ public void scenarios_should_behave_as_specified() throws IOException { List runScenarios = new ArrayList<>(); int maxRetries = 3; for (String scenarioSource : scenarioSources) { - String description = ""; + for (int i = 0; i < maxRetries; i++) { + + String description = ""; try { Map scenario = deserializeWithExpandedValues(scenarioSource); @@ -362,7 +358,6 @@ private Headers getAuthorizationHeaders(Map scenario) { } if ("System".equalsIgnoreCase(credentials)) { - return authorizationHeadersProvider .getSystemAuthorization(); } @@ -370,15 +365,15 @@ private Headers getAuthorizationHeaders(Map scenario) { if ("HomeOfficeLart".equalsIgnoreCase(credentials)) { return authorizationHeadersProvider - .getHomeOfficeLartAuthorization(); + .getHomeOfficeLartAuthorization(); } if ("HomeOfficePOU".equalsIgnoreCase(credentials)) { return authorizationHeadersProvider - .getHomeOfficePouAuthorization(); + .getHomeOfficePouAuthorization(); } return new Headers(); } -} \ No newline at end of file +} diff --git a/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/util/AuthorizationHeadersProvider.java b/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/util/AuthorizationHeadersProvider.java index 943662cbc..2facdc490 100644 --- a/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/util/AuthorizationHeadersProvider.java +++ b/src/functionalTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/util/AuthorizationHeadersProvider.java @@ -257,7 +257,7 @@ public Headers getCitizenAuthorization() { new Header("Authorization", accessToken) ); } - + public Headers getSystemAuthorization() { MultiValueMap tokenRequestForm = new LinkedMultiValueMap<>(); @@ -265,20 +265,19 @@ public Headers getSystemAuthorization() { tokenRequestForm.add("redirect_uri", idamRedirectUrl); tokenRequestForm.add("client_id", idamClientId); tokenRequestForm.add("client_secret", idamClientSecret); - tokenRequestForm.add("username", System.getenv("SYSTEM_USERNAME")); - tokenRequestForm.add("password", System.getenv("SYSTEM_PASSWORD")); + tokenRequestForm.add("username", System.getenv("IA_SYSTEM_USERNAME")); + tokenRequestForm.add("password", System.getenv("IA_SYSTEM_PASSWORD")); tokenRequestForm.add("scope", userScope); String serviceToken = tokens.computeIfAbsent("ServiceAuth", user -> serviceAuthTokenGenerator.generate()); String accessToken = tokens.computeIfAbsent( - "System", - user -> "Bearer " + idamApi.token(tokenRequestForm).getAccessToken() + "SystemUser", + user -> "Bearer " + idamApi.token(tokenRequestForm).getAccessToken() ); return new Headers( - new Header("ServiceAuthorization", serviceToken), - new Header("Authorization", accessToken) + new Header("ServiceAuthorization", serviceToken), + new Header("Authorization", accessToken) ); - } - + } } diff --git a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge-reheard.json b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge-reheard.json index e539f9851..eeb7fdc9f 100644 --- a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge-reheard.json +++ b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge-reheard.json @@ -18,7 +18,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -82,7 +83,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge.json b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge.json index 7b762ee57..c6c59e3b7 100644 --- a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge.json +++ b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-judge.json @@ -16,7 +16,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -78,7 +79,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw-reheard.json b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw-reheard.json index 5f8878fde..d7e3abaed 100644 --- a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw-reheard.json +++ b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw-reheard.json @@ -18,7 +18,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -82,7 +83,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw.json b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw.json index 275f8176c..17d8acfcd 100644 --- a/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw.json +++ b/src/functionalTest/resources/scenarios/RIA-3721-update-hearing-requirements-document-tcw.json @@ -16,7 +16,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -78,7 +79,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country-reheard.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country-reheard.json index 8588b33b2..f785dd6ae 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country-reheard.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country-reheard.json @@ -19,7 +19,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -85,7 +86,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country.json index c0a9c8001..79b149b65 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-in-country.json @@ -17,7 +17,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -81,7 +82,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc-reheard.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc-reheard.json index f1aee9e0a..a4d543054 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc-reheard.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc-reheard.json @@ -18,7 +18,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -83,7 +84,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc.json index a905d7f37..79d07f708 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-submit-giving-evidence-ooc.json @@ -16,7 +16,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -79,7 +80,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country-reheard.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country-reheard.json index 1de46ee6d..dc6a03d65 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country-reheard.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country-reheard.json @@ -19,7 +19,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -85,7 +86,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country.json index d01e2654a..e0ec6528b 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-in-country.json @@ -17,7 +17,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -81,7 +82,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc-reheard.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc-reheard.json index 69e6a63f3..0777a636e 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc-reheard.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc-reheard.json @@ -18,7 +18,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -83,7 +84,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc.json b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc.json index 42105637a..2b5fb0d53 100644 --- a/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc.json +++ b/src/functionalTest/resources/scenarios/RIA-3825-hearing-requirements-update-giving-evidence-ooc.json @@ -16,7 +16,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], @@ -79,7 +80,8 @@ { "id": "1", "value": { - "witnessName": "WitnessName" + "witnessName": "WitnessName", + "witnessFamilyName": "WitnessFamilyName" } } ], diff --git a/src/functionalTest/resources/scenarios/RIA-5778-end-appeal-automatically-notice-document.json b/src/functionalTest/resources/scenarios/RIA-5778-end-appeal-automatically-notice-document.json index 6341c1ce8..01da5e733 100644 --- a/src/functionalTest/resources/scenarios/RIA-5778-end-appeal-automatically-notice-document.json +++ b/src/functionalTest/resources/scenarios/RIA-5778-end-appeal-automatically-notice-document.json @@ -1,5 +1,6 @@ { "description": "RIA-5778 end appeal automatically notice document PDF", + "disabled": "true", "request": { "uri": "/asylum/ccdAboutToSubmit", "credentials": "System", diff --git a/src/functionalTest/resources/scenarios/RIA-7567-draft-hearing-requirements-interpreter-information.json b/src/functionalTest/resources/scenarios/RIA-7567-draft-hearing-requirements-interpreter-information.json new file mode 100644 index 000000000..9d94780c4 --- /dev/null +++ b/src/functionalTest/resources/scenarios/RIA-7567-draft-hearing-requirements-interpreter-information.json @@ -0,0 +1,208 @@ +{ + "description": "RIA-7567 draft hearing requirements with interpreter information request PDF", + "request": { + "uri": "/asylum/ccdAboutToSubmit", + "credentials": "LegalRepresentative", + "input": { + "eventId": "draftHearingRequirements", + "state": "submitHearingRequirements", + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "isAppellantAttendTheHearing": "Yes", + "isAppellantGivingOralEvidence": "Yes", + "isWitnessesAttending": "Yes", + "witnessDetails": [ + { + "id": "1", + "value": { + "witnessName": "Witness", + "witnessFamilyName": "1" + } + } + ], + "isInterpreterServicesNeeded": "Yes", + "appellantInterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "appellantInterpreterSignLanguage": { + "languageRefData": { + "value": { + "code": "sign-dfr", + "label": "Deaf Relay" + }, + "list_items": [{ + "code": "sign-dfr", + "label": "Deaf Relay" + }] + } + }, + "appellantInterpreterSpokenLanguage": { + "languageRefData": { + "value": { + "code": "ara-mag", + "label": "Maghreb" + }, + "list_items": [{ + "code": "ara-mag", + "label": "Maghreb" + }] + } + }, + "isAnyWitnessInterpreterRequired": "Yes", + "witness1": { + "witnessName": "Witness", + "witnessFamilyName": "1" + }, + "witness1InterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "witness1InterpreterSpokenLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 spoken language" + }, + "witness1InterpreterSignLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 sign language" + }, + "isHearingRoomNeeded": "Yes", + "isHearingLoopNeeded": "Yes", + "physicalOrMentalHealthIssues": "Yes", + "physicalOrMentalHealthIssuesDescription": "Physical or mental health issues description", + "pastExperiences": "Yes", + "pastExperiencesDescription": "Past experiences", + "isOutOfCountryEnabled": "Yes", + "remoteVideoCall": "Yes", + "remoteVideoCallDescription": "Remote video call description", + "multimediaEvidence": "Yes", + "multimediaEvidenceDescription": "Multimedia evidence", + "singleSexCourt": "Yes", + "singleSexCourtType": "All female", + "singleSexCourtTypeDescription": "Requirement for single sex court", + "inCameraCourt": "Yes", + "inCameraCourtDescription": "In camera court description", + "additionalRequests": "Yes", + "additionalRequestsDescription": "Additional requests description", + "hearingDateRangeDescription": "Only include dates between 27 Nov 2019 and 5 Feb 2020.", + "datesToAvoid": [ + { + "id": "1", + "value": { + "dateToAvoid": "2019-12-25", + "dateToAvoidReason": "Xmas" + } + } + ], + "uploadAdditionalEvidenceActionAvailable": "Yes", + "hearingDocuments": [], + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } + }, + "expectation": { + "status": 200, + "errors": [], + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "isAppellantAttendTheHearing": "Yes", + "isAppellantGivingOralEvidence": "Yes", + "isWitnessesAttending": "Yes", + "witnessDetails": [ + { + "id": "1", + "value": { + "witnessName": "Witness", + "witnessFamilyName": "1" + } + } + ], + "isInterpreterServicesNeeded": "Yes", + "appellantInterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "appellantInterpreterSignLanguage": { + "languageRefData": { + "value": { + "code": "sign-dfr", + "label": "Deaf Relay" + }, + "list_items": [{ + "code": "sign-dfr", + "label": "Deaf Relay" + }] + } + }, + "appellantInterpreterSpokenLanguage": { + "languageRefData": { + "value": { + "code": "ara-mag", + "label": "Maghreb" + }, + "list_items": [{ + "code": "ara-mag", + "label": "Maghreb" + }] + } + }, + "isAnyWitnessInterpreterRequired": "Yes", + "witness1": { + "witnessName": "Witness", + "witnessFamilyName": "1" + }, + "witness1InterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "witness1InterpreterSpokenLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 spoken language" + }, + "witness1InterpreterSignLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 sign language" + }, + "isHearingRoomNeeded": "Yes", + "isHearingLoopNeeded": "Yes", + "physicalOrMentalHealthIssues": "Yes", + "physicalOrMentalHealthIssuesDescription": "Physical or mental health issues description", + "pastExperiences": "Yes", + "pastExperiencesDescription": "Past experiences", + "isOutOfCountryEnabled": "Yes", + "remoteVideoCall": "Yes", + "remoteVideoCallDescription": "Remote video call description", + "multimediaEvidence": "Yes", + "multimediaEvidenceDescription": "Multimedia evidence", + "singleSexCourt": "Yes", + "singleSexCourtType": "All female", + "singleSexCourtTypeDescription": "Requirement for single sex court", + "inCameraCourt": "Yes", + "inCameraCourtDescription": "In camera court description", + "additionalRequests": "Yes", + "additionalRequestsDescription": "Additional requests description", + "hearingDateRangeDescription": "Only include dates between 27 Nov 2019 and 5 Feb 2020.", + "datesToAvoid": [ + { + "id": "1", + "value": { + "dateToAvoid": "2019-12-25", + "dateToAvoidReason": "Xmas" + } + } + ], + "uploadAdditionalEvidenceActionAvailable": "Yes", + "hearingDocuments": [], + "hearingRequirements": [ + { + "id": "1", + "value": { + "document": { + "document_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/", + "document_binary_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/binary/", + "document_filename": "PA 11111 2019-Gonzlez-hearing-requirements.PDF" + }, + "description": "", + "dateUploaded": "{$TODAY}", + "tag": "hearingRequirements" + } + } + ], + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } +} diff --git a/src/functionalTest/resources/scenarios/RIA-7567-update-hearing-requirements-interpreter-information.json b/src/functionalTest/resources/scenarios/RIA-7567-update-hearing-requirements-interpreter-information.json new file mode 100644 index 000000000..6d1a40b29 --- /dev/null +++ b/src/functionalTest/resources/scenarios/RIA-7567-update-hearing-requirements-interpreter-information.json @@ -0,0 +1,208 @@ +{ + "description": "RIA-7567 update hearing requirements with interpreter information request PDF", + "request": { + "uri": "/asylum/ccdAboutToSubmit", + "credentials": "CaseOfficer", + "input": { + "eventId": "updateHearingRequirements", + "state": "prepareForHearing", + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "isAppellantAttendTheHearing": "Yes", + "isAppellantGivingOralEvidence": "Yes", + "isWitnessesAttending": "Yes", + "witnessDetails": [ + { + "id": "1", + "value": { + "witnessName": "Witness", + "witnessFamilyName": "1" + } + } + ], + "isInterpreterServicesNeeded": "Yes", + "appellantInterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "appellantInterpreterSignLanguage": { + "languageRefData": { + "value": { + "code": "sign-dfr", + "label": "Deaf Relay" + }, + "list_items": [{ + "code": "sign-dfr", + "label": "Deaf Relay" + }] + } + }, + "appellantInterpreterSpokenLanguage": { + "languageRefData": { + "value": { + "code": "ara-mag", + "label": "Maghreb" + }, + "list_items": [{ + "code": "ara-mag", + "label": "Maghreb" + }] + } + }, + "isAnyWitnessInterpreterRequired": "Yes", + "witness1": { + "witnessName": "Witness", + "witnessFamilyName": "1" + }, + "witness1InterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "witness1InterpreterSpokenLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 spoken language" + }, + "witness1InterpreterSignLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 sign language" + }, + "isHearingRoomNeeded": "Yes", + "isHearingLoopNeeded": "Yes", + "physicalOrMentalHealthIssues": "Yes", + "physicalOrMentalHealthIssuesDescription": "Physical or mental health issues description", + "pastExperiences": "Yes", + "pastExperiencesDescription": "Past experiences", + "isOutOfCountryEnabled": "Yes", + "remoteVideoCall": "Yes", + "remoteVideoCallDescription": "Remote video call description", + "multimediaEvidence": "Yes", + "multimediaEvidenceDescription": "Multimedia evidence", + "singleSexCourt": "Yes", + "singleSexCourtType": "All female", + "singleSexCourtTypeDescription": "Requirement for single sex court", + "inCameraCourt": "Yes", + "inCameraCourtDescription": "In camera court description", + "additionalRequests": "Yes", + "additionalRequestsDescription": "Additional requests description", + "hearingDateRangeDescription": "Only include dates between 27 Nov 2019 and 5 Feb 2020.", + "datesToAvoid": [ + { + "id": "1", + "value": { + "dateToAvoid": "2019-12-25", + "dateToAvoidReason": "Xmas" + } + } + ], + "uploadAdditionalEvidenceActionAvailable": "Yes", + "hearingDocuments": [], + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } + }, + "expectation": { + "status": 200, + "errors": [], + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "isAppellantAttendTheHearing": "Yes", + "isAppellantGivingOralEvidence": "Yes", + "isWitnessesAttending": "Yes", + "witnessDetails": [ + { + "id": "1", + "value": { + "witnessName": "Witness", + "witnessFamilyName": "1" + } + } + ], + "isInterpreterServicesNeeded": "Yes", + "appellantInterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "appellantInterpreterSignLanguage": { + "languageRefData": { + "value": { + "code": "sign-dfr", + "label": "Deaf Relay" + }, + "list_items": [{ + "code": "sign-dfr", + "label": "Deaf Relay" + }] + } + }, + "appellantInterpreterSpokenLanguage": { + "languageRefData": { + "value": { + "code": "ara-mag", + "label": "Maghreb" + }, + "list_items": [{ + "code": "ara-mag", + "label": "Maghreb" + }] + } + }, + "isAnyWitnessInterpreterRequired": "Yes", + "witness1": { + "witnessName": "Witness", + "witnessFamilyName": "1" + }, + "witness1InterpreterLanguageCategory": ["spokenLanguageInterpreter", "signLanguageInterpreter"], + "witness1InterpreterSpokenLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 spoken language" + }, + "witness1InterpreterSignLanguage": { + "languageManualEntry": ["Yes"], + "languageManualEntryDescription": "Witness 1 sign language" + }, + "isHearingRoomNeeded": "Yes", + "isHearingLoopNeeded": "Yes", + "physicalOrMentalHealthIssues": "Yes", + "physicalOrMentalHealthIssuesDescription": "Physical or mental health issues description", + "pastExperiences": "Yes", + "pastExperiencesDescription": "Past experiences", + "isOutOfCountryEnabled": "Yes", + "remoteVideoCall": "Yes", + "remoteVideoCallDescription": "Remote video call description", + "multimediaEvidence": "Yes", + "multimediaEvidenceDescription": "Multimedia evidence", + "singleSexCourt": "Yes", + "singleSexCourtType": "All female", + "singleSexCourtTypeDescription": "Requirement for single sex court", + "inCameraCourt": "Yes", + "inCameraCourtDescription": "In camera court description", + "additionalRequests": "Yes", + "additionalRequestsDescription": "Additional requests description", + "hearingDateRangeDescription": "Only include dates between 27 Nov 2019 and 5 Feb 2020.", + "datesToAvoid": [ + { + "id": "1", + "value": { + "dateToAvoid": "2019-12-25", + "dateToAvoidReason": "Xmas" + } + } + ], + "uploadAdditionalEvidenceActionAvailable": "Yes", + "hearingDocuments": [], + "hearingRequirements": [ + { + "id": "1", + "value": { + "document": { + "document_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/", + "document_binary_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/binary/", + "document_filename": "PA 11111 2019-Gonzlez-hearing-requirements.PDF" + }, + "description": "", + "dateUploaded": "{$TODAY}", + "tag": "hearingRequirements" + } + } + ], + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } +} diff --git a/src/functionalTest/resources/scenarios/RIA-7574-appeal-submission-document_with_combined_legal_rep_first_and_family_names.json b/src/functionalTest/resources/scenarios/RIA-7574-appeal-submission-document_with_combined_legal_rep_first_and_family_names.json new file mode 100644 index 000000000..94853aef7 --- /dev/null +++ b/src/functionalTest/resources/scenarios/RIA-7574-appeal-submission-document_with_combined_legal_rep_first_and_family_names.json @@ -0,0 +1,45 @@ +{ + "description": "RIA-7574 Appeal submission document with combined first and family names for legal rep", + "request": { + "uri": "/asylum/ccdAboutToSubmit", + "credentials": "LegalRepresentative", + "input": { + "eventId": "submitAppeal", + "state": "appealSubmitted", + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "legalRepName": "LegalRepFirstName", + "legalRepFamilyName": "LegalRepFamilyName", + "legalRepresentativeDocuments": [] + } + } + } + }, + "expectation": { + "status": 200, + "errors": [], + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "legalRepName": "LegalRepFirstName", + "legalRepFamilyName": "LegalRepFamilyName", + "legalRepresentativeDocuments": [ + { + "id": "1", + "value": { + "document": { + "document_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/", + "document_binary_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/binary/", + "document_filename": "PA 11111 2019-Gonzlez-appeal-form.PDF" + }, + "description": "", + "dateUploaded": "{$TODAY}", + "tag": "appealSubmission" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/src/functionalTest/resources/scenarios/RIA-7879-hearing-notice-document-iac-harmondsworth.json b/src/functionalTest/resources/scenarios/RIA-7879-hearing-notice-document-iac-harmondsworth.json new file mode 100644 index 000000000..1e1a44a0f --- /dev/null +++ b/src/functionalTest/resources/scenarios/RIA-7879-hearing-notice-document-iac-harmondsworth.json @@ -0,0 +1,55 @@ +{ + "description": "RIA-7879 Create hearing notice PDF (IAC Harmondsworth)", + "request": { + "uri": "/asylum/ccdAboutToSubmit", + "credentials": "AdminOfficer", + "input": { + "eventId": "listCase", + "state": "listing", + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "hearingDocuments": [], + "appealReferenceNumber": "DC/50042/2023", + "listCaseHearingCentre": "harmondsworth", + "listCaseHearingLength": "60", + "listCaseHearingDate": "2023-08-31T12:34:56", + "ariaListingReference": "AA/12345/1234", + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } + }, + "expectation": { + "status": 200, + "errors": [], + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "hearingDocuments": [ + { + "id": "1", + "value": { + "document": { + "document_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/", + "document_binary_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/binary/", + "document_filename": "DC 50042 2023-Gonzlez-hearing-notice.PDF" + }, + "description": "", + "dateUploaded": "{$TODAY}", + "tag": "hearingNotice" + } + } + ], + "appealReferenceNumber": "DC/50042/2023", + "listCaseHearingCentre": "harmondsworth", + "listCaseHearingLength": "60", + "listCaseHearingDate": "2023-08-31T12:34:56", + "ariaListingReference": "AA/12345/1234", + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } +} diff --git a/src/functionalTest/resources/scenarios/RIA-8514-record-adjournment-details.json b/src/functionalTest/resources/scenarios/RIA-8514-record-adjournment-details.json new file mode 100644 index 000000000..3c8b5c555 --- /dev/null +++ b/src/functionalTest/resources/scenarios/RIA-8514-record-adjournment-details.json @@ -0,0 +1,53 @@ +{ + "description": "RIA-8514 Create notice of adjourned hearing PDF (IAC Harmondsworth)", + "request": { + "uri": "/asylum/ccdAboutToSubmit", + "credentials": "CaseOfficer", + "input": { + "eventId": "recordAdjournmentDetails", + "state": "prepareForHearing", + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "hearingDocuments": [], + "appealReferenceNumber": "DC/50001/2024", + "listCaseHearingCentre": "harmondsworth", + "listCaseHearingLength": "60", + "listCaseHearingDate": "2024-01-22T09:45:00", + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } + }, + "expectation": { + "status": 200, + "errors": [], + "caseData": { + "template": "minimal-appeal-submitted.json", + "replacements": { + "hearingDocuments": [ + { + "id": "1", + "value": { + "document": { + "document_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/", + "document_binary_url": "$/http.+\/documents/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\/binary/", + "document_filename": "DC 50001 2024-Gonzlez-notice-of-adjourned-hearing.PDF" + }, + "description": "", + "dateUploaded": "{$TODAY}", + "tag": "noticeOfAdjournedHearing" + } + } + ], + "appealReferenceNumber": "DC/50001/2024", + "listCaseHearingCentre": "harmondsworth", + "listCaseHearingLength": "60", + "listCaseHearingDate": "2024-01-22T09:45:00", + "customerServicesTelephone": "{$customerServices.telephoneNumber}", + "customerServicesEmail": "{$customerServices.emailAddress}" + } + } + } +} diff --git a/src/integrationTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/TsvStringProviderTest.java b/src/integrationTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/TsvStringProviderTest.java index e5145df23..e83fcec50 100644 --- a/src/integrationTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/TsvStringProviderTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/TsvStringProviderTest.java @@ -75,6 +75,56 @@ void should_load_strings_from_resources_and_return() { tsvStringProvider.get("hearingCentreName", "taylorHouse") ); + assertEquals( + Optional.of("Harmondsworth"), + tsvStringProvider.get("hearingCentreName", "harmondsworth") + ); + + assertEquals( + Optional.of("Hendon"), + tsvStringProvider.get("hearingCentreName", "hendon") + ); + + assertEquals( + Optional.of("Yarl's Wood"), + tsvStringProvider.get("hearingCentreName", "yarlsWood") + ); + + assertEquals( + Optional.of("Bradford & Keighley"), + tsvStringProvider.get("hearingCentreName", "bradfordKeighley") + ); + + assertEquals( + Optional.of("MCC Minshull st"), + tsvStringProvider.get("hearingCentreName", "mccMinshull") + ); + + assertEquals( + Optional.of("MCC Crown Square"), + tsvStringProvider.get("hearingCentreName", "mccCrownSquare") + ); + + assertEquals( + Optional.of("Manchester Mags"), + tsvStringProvider.get("hearingCentreName", "manchesterMags") + ); + + assertEquals( + Optional.of("NTH Tyne Mags"), + tsvStringProvider.get("hearingCentreName", "nthTyneMags") + ); + + assertEquals( + Optional.of("Leeds Mags"), + tsvStringProvider.get("hearingCentreName", "leedsMags") + ); + + assertEquals( + Optional.of("Alloa Sherrif Court"), + tsvStringProvider.get("hearingCentreName", "alloaSherrif") + ); + assertEquals( Optional.of("Removing the appellant from the UK would breach the UK's obligation under the Refugee Convention"), tsvStringProvider.get("appealGrounds", "protectionRefugeeConvention") @@ -180,6 +230,56 @@ void should_load_strings_from_resources_and_return() { tsvStringProvider.get("hearingCentreAddress", "taylorHouse") ); + assertEquals( + Optional.of("Harmondsworth Tribunal Hearing Centre, Colnbrook Bypass, UB7 0HB"), + tsvStringProvider.get("hearingCentreAddress", "harmondsworth") + ); + + assertEquals( + Optional.of("Hendon Magistrates' Court, The Court House, The Hyde, NW9 7BY"), + tsvStringProvider.get("hearingCentreAddress", "hendon") + ); + + assertEquals( + Optional.of("Yarl's Wood Immigration and Asylum Hearing Centre, Twinwood Road, MK44 1FD"), + tsvStringProvider.get("hearingCentreAddress", "yarlsWood") + ); + + assertEquals( + Optional.of("Bradford and Keighley Magistrates' Court and Family Court, The Tyrls, PO Box 187, BD1 1JL"), + tsvStringProvider.get("hearingCentreAddress", "bradfordKeighley") + ); + + assertEquals( + Optional.of("Manchester Crown Court (Minshull St), The Court House, Minshull Street, M1 3FS"), + tsvStringProvider.get("hearingCentreAddress", "mccMinshull") + ); + + assertEquals( + Optional.of("Manchester Crown Court (Crown Square), Courts of Justice, Crown Square, M3 3FL"), + tsvStringProvider.get("hearingCentreAddress", "mccCrownSquare") + ); + + assertEquals( + Optional.of("Manchester Magistrates' Court, Crown Square, Manchester, Greater Manchester M60 1PR"), + tsvStringProvider.get("hearingCentreAddress", "manchesterMags") + ); + + assertEquals( + Optional.of("North Tyneside Magistrates' Court, Tynemouth Road, The Court House, NE30 1AG"), + tsvStringProvider.get("hearingCentreAddress", "nthTyneMags") + ); + + assertEquals( + Optional.of("Leeds Magistrates' Court and Family Court, Westgate, LS1 3BY"), + tsvStringProvider.get("hearingCentreAddress", "leedsMags") + ); + + assertEquals( + Optional.of("Alloa Sheriff Court, 47 Drysdale Street, Alloa, FK10 1JA"), + tsvStringProvider.get("hearingCentreAddress", "alloaSherrif") + ); + assertEquals( Optional.of("Afghanistan"), tsvStringProvider.get("isoCountries", "AF") diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/AsylumCaseDefinition.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/AsylumCaseDefinition.java index c67e8721b..7f3617e9e 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/AsylumCaseDefinition.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/AsylumCaseDefinition.java @@ -150,6 +150,9 @@ public enum AsylumCaseDefinition { LEGAL_REP_NAME( "legalRepName", new TypeReference(){}), + LEGAL_REP_FAMILY_NAME( + "legalRepFamilyName", new TypeReference(){}), + LEGAL_REP_COMPANY( "legalRepCompany", new TypeReference(){}), @@ -306,6 +309,138 @@ public enum AsylumCaseDefinition { INTERPRETER_LANGUAGE( "interpreterLanguage", new TypeReference>>(){}), + APPELLANT_INTERPRETER_SPOKEN_LANGUAGE( + "appellantInterpreterSpokenLanguage", new TypeReference() {}), + + APPELLANT_INTERPRETER_SIGN_LANGUAGE( + "appellantInterpreterSignLanguage", new TypeReference() {}), + + APPELLANT_INTERPRETER_LANGUAGE_CATEGORY( + "appellantInterpreterLanguageCategory", new TypeReference>() {}), + + IS_ANY_WITNESS_INTERPRETER_REQUIRED( + "isAnyWitnessInterpreterRequired", new TypeReference(){}), + + WITNESS_1( + "witness1", new TypeReference() {}), + + WITNESS_2( + "witness2", new TypeReference() {}), + + WITNESS_3( + "witness3", new TypeReference() {}), + + WITNESS_4( + "witness4", new TypeReference() {}), + + WITNESS_5( + "witness5", new TypeReference() {}), + + WITNESS_6( + "witness6", new TypeReference() {}), + + WITNESS_7( + "witness7", new TypeReference() {}), + + WITNESS_8( + "witness8", new TypeReference() {}), + + WITNESS_9( + "witness9", new TypeReference() {}), + + WITNESS_10( + "witness10", new TypeReference() {}), + + WITNESS_1_INTERPRETER_LANGUAGE_CATEGORY( + "witness1InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_2_INTERPRETER_LANGUAGE_CATEGORY( + "witness2InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_3_INTERPRETER_LANGUAGE_CATEGORY( + "witness3InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_4_INTERPRETER_LANGUAGE_CATEGORY( + "witness4InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_5_INTERPRETER_LANGUAGE_CATEGORY( + "witness5InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_6_INTERPRETER_LANGUAGE_CATEGORY( + "witness6InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_7_INTERPRETER_LANGUAGE_CATEGORY( + "witness7InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_8_INTERPRETER_LANGUAGE_CATEGORY( + "witness8InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_9_INTERPRETER_LANGUAGE_CATEGORY( + "witness9InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_10_INTERPRETER_LANGUAGE_CATEGORY( + "witness10InterpreterLanguageCategory", new TypeReference>() {}), + + WITNESS_1_INTERPRETER_SPOKEN_LANGUAGE( + "witness1InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_1_INTERPRETER_SIGN_LANGUAGE( + "witness1InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_2_INTERPRETER_SPOKEN_LANGUAGE( + "witness2InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_2_INTERPRETER_SIGN_LANGUAGE( + "witness2InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_3_INTERPRETER_SPOKEN_LANGUAGE( + "witness3InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_3_INTERPRETER_SIGN_LANGUAGE( + "witness3InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_4_INTERPRETER_SPOKEN_LANGUAGE( + "witness4InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_4_INTERPRETER_SIGN_LANGUAGE( + "witness4InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_5_INTERPRETER_SPOKEN_LANGUAGE( + "witness5InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_5_INTERPRETER_SIGN_LANGUAGE( + "witness5InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_6_INTERPRETER_SPOKEN_LANGUAGE( + "witness6InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_6_INTERPRETER_SIGN_LANGUAGE( + "witness6InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_7_INTERPRETER_SPOKEN_LANGUAGE( + "witness7InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_7_INTERPRETER_SIGN_LANGUAGE( + "witness7InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_8_INTERPRETER_SPOKEN_LANGUAGE( + "witness8InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_8_INTERPRETER_SIGN_LANGUAGE( + "witness8InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_9_INTERPRETER_SPOKEN_LANGUAGE( + "witness9InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_9_INTERPRETER_SIGN_LANGUAGE( + "witness9InterpreterSignLanguage", new TypeReference() {}), + + WITNESS_10_INTERPRETER_SPOKEN_LANGUAGE( + "witness10InterpreterSpokenLanguage", new TypeReference() {}), + + WITNESS_10_INTERPRETER_SIGN_LANGUAGE( + "witness10InterpreterSignLanguage", new TypeReference() {}), + IS_HEARING_ROOM_NEEDED( "isHearingRoomNeeded", new TypeReference(){}), @@ -483,6 +618,9 @@ public enum AsylumCaseDefinition { UPPER_TRIBUNAL_DOCUMENTS( "upperTribunalDocuments", new TypeReference>>(){}), + IS_INTEGRATED( + "isIntegrated", new TypeReference(){}), + CLARIFYING_QUESTIONS_ANSWERS("clarifyingQuestionsAnswers", new TypeReference>>() {}), @@ -629,6 +767,17 @@ public enum AsylumCaseDefinition { ADJOURN_HEARING_WITHOUT_DATE_REASONS( "adjournHearingWithoutDateReasons", new TypeReference() {}), + IS_CASE_USING_LOCATION_REF_DATA( + "isCaseUsingLocationRefData", new TypeReference(){}), + + IS_REMOTE_HEARING( + "isRemoteHearing", new TypeReference() {}), + + LIST_CASE_HEARING_CENTRE_ADDRESS( + "listCaseHearingCentreAddress", new TypeReference(){}), + + IS_DECISION_WITHOUT_HEARING("isDecisionWithoutHearing", new TypeReference(){}), + CUSTOM_LATEST_REMITTAL_DOCS( "customLatestRemittalDocs", new TypeReference>>(){}), diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinition.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinition.java index a7c3a1810..704a60ab4 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinition.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinition.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.util.List; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.bail.BailInterpreterLanguageRefData; +import uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.clients.model.refdata.CourtVenue; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.AddressUk; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.Document; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.IdValue; @@ -342,16 +343,21 @@ public enum BailCaseFieldDefinition { "fcs4InterpreterSpokenLanguage", new TypeReference() {}), FCS4_INTERPRETER_SIGN_LANGUAGE( "fcs4InterpreterSignLanguage", new TypeReference() {}), - LISTING_EVENT( - "listingEvent", new TypeReference(){}), - LISTING_LOCATION( - "listingLocation", new TypeReference(){}), - LISTING_HEARING_DATE( - "listingHearingDate", new TypeReference(){}), + + LISTING_EVENT("listingEvent", new TypeReference(){}), + LISTING_LOCATION("listingLocation", new TypeReference(){}), + LISTING_HEARING_DATE("listingHearingDate", new TypeReference(){}), HEARING_DOCUMENTS( - "hearingDocuments", new TypeReference>>(){}), + "hearingDocuments", new TypeReference>>(){}), IS_IMA_ENABLED( - "isImaEnabled", new TypeReference() {}); + "isImaEnabled", new TypeReference() {}), + IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED( + "isBailsLocationReferenceDataEnabled", new TypeReference() {}), + REF_DATA_LISTING_LOCATION_DETAIL( + "refDataListingLocationDetail", new TypeReference() {}), + IS_REMOTE_HEARING( + "isRemoteHearing", new TypeReference() {}); + private final String value; private final TypeReference typeReference; diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTag.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTag.java index eaa58fbf3..0ea3e2f37 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTag.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTag.java @@ -41,6 +41,9 @@ public enum DocumentTag { UPPER_TRIBUNAL_BUNDLE("upperTribunalBundle", CaseType.ASYLUM), APPEAL_REASONS("appealReasons", CaseType.ASYLUM), CLARIFYING_QUESTIONS("clarifyingQuestions", CaseType.ASYLUM), + + NOTICE_OF_ADJOURNED_HEARING("noticeOfAdjournedHearing", CaseType.ASYLUM), + APPEAL_FORM("appealForm", CaseType.ASYLUM), NOTICE_OF_DECISION_UT_TRANSFER("noticeOfDecisionUtTransfer", CaseType.ASYLUM), REQUEST_CASE_BUILDING("requestCaseBuilding", CaseType.ASYLUM), diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicList.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicList.java index bd3469d0c..13481088b 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicList.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicList.java @@ -39,4 +39,4 @@ public void setValue(Value value) { this.value = value; } -} \ No newline at end of file +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentre.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentre.java index e8d1b1a6d..b20ea9a40 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentre.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentre.java @@ -22,7 +22,17 @@ public enum HearingCentre { TAYLOR_HOUSE("taylorHouse"), BELFAST("belfast"), HARMONDSWORTH("harmondsworth"), - YARLSWOOD("yarlswood"), + + HENDON("hendon"), + YARLS_WOOD("yarlsWood"), + BRADFORD_KEIGHLEY("bradfordKeighley"), + MCC_MINSHULL("mccMinshull"), + MCC_CROWN_SQUARE("mccCrownSquare"), + MANCHESTER_MAGS("manchesterMags"), + NTH_TYNE_MAGS("nthTyneMags"), + LEEDS_MAGS("leedsMags"), + ALLOA_SHERRIF("alloaSherrif"), + REMOTE_HEARING("remoteHearing"), DECISION_WITHOUT_HEARING("decisionWithoutHearing"); diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageCategory.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageCategory.java index 8c588920b..4d371dcb5 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageCategory.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageCategory.java @@ -1,3 +1,4 @@ + package uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities; public enum InterpreterLanguageCategory { @@ -19,4 +20,4 @@ public String getValue() { public String toString() { return getValue(); } -} \ No newline at end of file +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageRefData.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageRefData.java index a9de49e3d..40e9950c2 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageRefData.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguageRefData.java @@ -16,4 +16,5 @@ public class InterpreterLanguageRefData { private List languageManualEntry; private String languageManualEntryDescription; -} \ No newline at end of file + +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguagesUtils.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguagesUtils.java new file mode 100644 index 000000000..f38bcc7fa --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/InterpreterLanguagesUtils.java @@ -0,0 +1,64 @@ +package uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities; + +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.*; + +import java.util.List; + + +public final class InterpreterLanguagesUtils { + + private InterpreterLanguagesUtils() { + // Utils classes should not have public or default constructors + } + + public static final List WITNESS_N_FIELD = List.of( + WITNESS_1, + WITNESS_2, + WITNESS_3, + WITNESS_4, + WITNESS_5, + WITNESS_6, + WITNESS_7, + WITNESS_8, + WITNESS_9, + WITNESS_10); + + public static final List WITNESS_N_INTERPRETER_CATEGORY_FIELD = List.of( + WITNESS_1_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_2_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_3_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_4_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_5_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_6_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_7_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_8_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_9_INTERPRETER_LANGUAGE_CATEGORY, + WITNESS_10_INTERPRETER_LANGUAGE_CATEGORY + ); + + public static final List WITNESS_N_INTERPRETER_SPOKEN_LANGUAGE = List.of( + WITNESS_1_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_2_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_3_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_4_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_5_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_6_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_7_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_8_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_9_INTERPRETER_SPOKEN_LANGUAGE, + WITNESS_10_INTERPRETER_SPOKEN_LANGUAGE + ); + + public static final List WITNESS_N_INTERPRETER_SIGN_LANGUAGE = List.of( + WITNESS_1_INTERPRETER_SIGN_LANGUAGE, + WITNESS_2_INTERPRETER_SIGN_LANGUAGE, + WITNESS_3_INTERPRETER_SIGN_LANGUAGE, + WITNESS_4_INTERPRETER_SIGN_LANGUAGE, + WITNESS_5_INTERPRETER_SIGN_LANGUAGE, + WITNESS_6_INTERPRETER_SIGN_LANGUAGE, + WITNESS_7_INTERPRETER_SIGN_LANGUAGE, + WITNESS_8_INTERPRETER_SIGN_LANGUAGE, + WITNESS_9_INTERPRETER_SIGN_LANGUAGE, + WITNESS_10_INTERPRETER_SIGN_LANGUAGE + ); +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ListingEvent.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ListingEvent.java index ed9eadd3c..5d0ef1a91 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ListingEvent.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ListingEvent.java @@ -10,7 +10,8 @@ public enum ListingEvent { INITIAL_LISTING("initialListing"), RELISTING("relisting"); - @JsonValue private final String value; + @JsonValue + private final String value; ListingEvent(String value) { this.value = value; @@ -29,4 +30,4 @@ public String toString() { return getValue(); } -} \ No newline at end of file +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/Value.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/Value.java index b4d8816f8..448c9ad7f 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/Value.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/Value.java @@ -26,4 +26,5 @@ public String getCode() { public String getLabel() { return label; } -} \ No newline at end of file + +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/WitnessInterpreterLanguageInformation.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/WitnessInterpreterLanguageInformation.java new file mode 100644 index 000000000..ef27ae39a --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/WitnessInterpreterLanguageInformation.java @@ -0,0 +1,15 @@ +package uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities; + +import lombok.*; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class WitnessInterpreterLanguageInformation { + + private String witnessName; + private String interpreterLanguage; + +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/Event.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/Event.java index c05e77aff..56c3096f7 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/Event.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/Event.java @@ -41,6 +41,9 @@ public enum Event { GENERATE_UPPER_TRIBUNAL_BUNDLE("generateUpperTribunalBundle", CaseType.ASYLUM), SUBMIT_REASONS_FOR_APPEAL("submitReasonsForAppeal", CaseType.ASYLUM), SUBMIT_CLARIFYING_QUESTION_ANSWERS("submitClarifyingQuestionAnswers", CaseType.ASYLUM), + + RECORD_ADJOURNMENT_DETAILS("recordAdjournmentDetails", CaseType.ASYLUM), + UPDATE_TRIBUNAL_DECISION("updateTribunalDecision", CaseType.ASYLUM), REQUEST_CASE_BUILDING("requestCaseBuilding", CaseType.ASYLUM), UPLOAD_HOME_OFFICE_APPEAL_RESPONSE("uploadHomeOfficeAppealResponse", CaseType.ASYLUM), diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetails.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetails.java index 0dff4ae71..faa12dba8 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetails.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetails.java @@ -1,8 +1,14 @@ package uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class WitnessDetails { + private String witnessPartyId; private String witnessName; + private String witnessFamilyName; + private YesOrNo isWitnessDeleted; public WitnessDetails() { // noop -- for deserializer @@ -12,6 +18,11 @@ public WitnessDetails(String witnessName) { this.witnessName = witnessName; } + public WitnessDetails(String witnessName, String witnessFamilyName) { + this.witnessName = witnessName; + this.witnessFamilyName = witnessFamilyName; + } + public String getWitnessName() { return witnessName; } @@ -19,4 +30,19 @@ public String getWitnessName() { public void setWitnessName(String witnessName) { this.witnessName = witnessName; } + + public String getWitnessFamilyName() { + return witnessFamilyName; + } + + public void setWitnessFamilyName(String witnessFamilyName) { + this.witnessFamilyName = witnessFamilyName; + } + + public String buildWitnessFullName() { + String givenNames = getWitnessName() == null ? " " : getWitnessName(); + String familyName = getWitnessFamilyName() == null ? " " : getWitnessFamilyName(); + + return !(givenNames.isBlank() || familyName.isBlank()) ? givenNames + " " + familyName : givenNames; + } } diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreator.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreator.java index f2cc6688c..5d760b4c0 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreator.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreator.java @@ -87,7 +87,13 @@ public PreSubmitCallbackResponse handle( asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class).orElse(HearingCentre.TAYLOR_HOUSE); Document hearingNotice; - if (listCaseHearingCentre.equals(HearingCentre.REMOTE_HEARING)) { + boolean isCaseUsingLocationRefData = asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class) + .orElse(YesOrNo.NO).equals(YesOrNo.YES); + + //prevent the existing case with previous selected remote hearing when the ref data feature is on with different hearing centre + //IS_REMOTE_HEARING is used for the case ref data + if ((!isCaseUsingLocationRefData && listCaseHearingCentre.equals(HearingCentre.REMOTE_HEARING)) + || (isCaseUsingLocationRefData && asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class).orElse(YesOrNo.NO).equals(YesOrNo.YES))) { hearingNotice = remoteHearingNoticeDocumentCreator.create(caseDetails); } else { boolean isAda = asylumCase.read(IS_ACCELERATED_DETAINED_APPEAL, YesOrNo.class).orElse(NO) == YES; diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreator.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreator.java index 3639cfb49..586437d98 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreator.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreator.java @@ -86,8 +86,13 @@ public PreSubmitCallbackResponse handle( hearingDetailsFinder.getHearingDateTime(caseDetailsBefore.get().getCaseData()); boolean isAda = asylumCase.read(IS_ACCELERATED_DETAINED_APPEAL, YesOrNo.class).orElse(NO) == YES; + boolean isCaseUsingLocationRefData = asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class) + .orElse(YesOrNo.NO).equals(YesOrNo.YES); - if (asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class).equals(Optional.of(HearingCentre.REMOTE_HEARING))) { + //prevent the existing case with previous selected remote hearing when the ref data feature is on with different hearing centre + //IS_REMOTE_HEARING is used for the case ref data + if ((!isCaseUsingLocationRefData && asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class).equals(Optional.of(HearingCentre.REMOTE_HEARING))) + || (isCaseUsingLocationRefData && asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class).orElse(YesOrNo.NO).equals(YesOrNo.YES))) { generateDocument(caseDetails, asylumCase, caseDetailsBefore, remoteHearingNoticeUpdatedDetailsDocumentCreator); } else if (hearingCentreNameBefore.equals(listCaseHearingCentre) && oldHearingDate.equals(hearingDate)) { if (isAda) { diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreator.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreator.java new file mode 100644 index 000000000..1f48ffa79 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreator.java @@ -0,0 +1,61 @@ +package uk.gov.hmcts.reform.iacasedocumentsapi.domain.handlers.presubmit; + +import static java.util.Objects.requireNonNull; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.HEARING_DOCUMENTS; + +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCase; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.DocumentTag; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.CaseDetails; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.Event; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.callback.Callback; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.callback.PreSubmitCallbackResponse; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.callback.PreSubmitCallbackStage; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.Document; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.handlers.PreSubmitCallbackHandler; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.DocumentCreator; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.DocumentHandler; + +@Component +public class RecordAdjournmentDetailsCreator implements PreSubmitCallbackHandler { + + private final DocumentCreator documentCreator; + private final DocumentHandler documentHandler; + + public RecordAdjournmentDetailsCreator( + @Qualifier("noticeOfAdjournedHearing") DocumentCreator documentCreator, + DocumentHandler documentHandler) { + this.documentCreator = documentCreator; + this.documentHandler = documentHandler; + } + + public boolean canHandle(PreSubmitCallbackStage callbackStage, Callback callback) { + requireNonNull(callbackStage, "callbackStage must not be null"); + requireNonNull(callback, "callback must not be null"); + + return callbackStage == PreSubmitCallbackStage.ABOUT_TO_SUBMIT + && Event.RECORD_ADJOURNMENT_DETAILS.equals(callback.getEvent()); + } + + public PreSubmitCallbackResponse handle(PreSubmitCallbackStage callbackStage, + Callback callback) { + if (!canHandle(callbackStage, callback)) { + throw new IllegalStateException("Cannot handle callback"); + } + + final CaseDetails caseDetails = callback.getCaseDetails(); + final AsylumCase asylumCase = caseDetails.getCaseData(); + + Document noticeOfAdjournedHearing = documentCreator.create(caseDetails); + + documentHandler.addWithMetadataWithoutReplacingExistingDocuments( + asylumCase, + noticeOfAdjournedHearing, + HEARING_DOCUMENTS, + DocumentTag.NOTICE_OF_ADJOURNED_HEARING + ); + + return new PreSubmitCallbackResponse<>(asylumCase); + } +} \ No newline at end of file diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrder.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrder.java index dd790a861..6d946a276 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrder.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrder.java @@ -23,7 +23,7 @@ private int bundlePositionIndex(DocumentWithMetadata document) { case CASE_SUMMARY: return 1; case REHEARD_HEARING_NOTICE: - return 2; + return 2; case HEARING_NOTICE: return 3; case APPEAL_SUBMISSION: @@ -224,8 +224,10 @@ private int bundlePositionIndex(DocumentWithMetadata document) { return 74; case REMITTAL_DECISION: return 75; - case NONE: + case NOTICE_OF_ADJOURNED_HEARING: return 76; + case NONE: + return 77; default: throw new IllegalStateException("document has unknown tag: " + document.getTag() + ", description: " + document.getDescription()); } diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapper.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapper.java index c5c86c185..e02e057da 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapper.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapper.java @@ -45,15 +45,21 @@ public Map mapFields(AsylumCase asylumCase) { fieldValues.put("hearingDate", formatDateTimeForRendering(asylumCase.read(LIST_CASE_HEARING_DATE, String.class).orElse(""), DOCUMENT_DATE_FORMAT)); fieldValues.put("hearingTime", formatDateTimeForRendering(asylumCase.read(LIST_CASE_HEARING_DATE, String.class).orElse(""), DOCUMENT_TIME_FORMAT)); - if (listedHearingCentre.equals(HearingCentre.REMOTE_HEARING)) { + + boolean isCaseUsingLocationRefData = asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class) + .orElse(YesOrNo.NO).equals(YesOrNo.YES); + + //prevent the existing case with previous selected remote hearing when the ref data feature is on with different hearing centre + //IS_REMOTE_HEARING is used for the case ref data + if ((!isCaseUsingLocationRefData && listedHearingCentre.equals(HearingCentre.REMOTE_HEARING)) + || (isCaseUsingLocationRefData && asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class).orElse(YesOrNo.NO).equals(YesOrNo.YES))) { fieldValues.put("remoteHearing", "Remote hearing"); fieldValues.put("remoteVideoCallTribunalResponse", asylumCase.read(REMOTE_VIDEO_CALL_TRIBUNAL_RESPONSE, String.class).orElse("")); } - fieldValues.put( - "hearingCentreAddress", - stringProvider.get("hearingCentreAddress", listedHearingCentre.toString()).orElse("") - .replaceAll(",\\s*", "\n") + fieldValues.put("hearingCentreAddress", isCaseUsingLocationRefData ? + asylumCase.read(LIST_CASE_HEARING_CENTRE_ADDRESS, String.class).orElse("") + : stringProvider.get("hearingCentreAddress", listedHearingCentre.toString()).orElse("").replaceAll(",\\s*", "\n") ); if (isSubmitRequirementsAvailable.isPresent() && isSubmitRequirementsAvailable.get() == YesOrNo.YES) { @@ -72,6 +78,7 @@ public Map mapFields(AsylumCase asylumCase) { fieldValues.put("ariaListingReference", asylumCase.read(ARIA_LISTING_REFERENCE, String.class).orElse("")); fieldValues.put("customerServicesTelephone", customerServicesProvider.getCustomerServicesTelephone()); fieldValues.put("customerServicesEmail", customerServicesProvider.getCustomerServicesEmail()); + fieldValues.put("isIntegrated", asylumCase.read(IS_INTEGRATED, YesOrNo.class).orElse(YesOrNo.NO)); return fieldValues; } diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplate.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplate.java index 919f7a4c2..6997044b9 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplate.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplate.java @@ -8,6 +8,7 @@ import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; +import lombok.NonNull; import com.google.common.collect.ImmutableMap; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -52,7 +53,9 @@ public Map mapFieldValues( fieldValues.put("CREATED_DATE", caseDetails.getCreatedDate().format(DOCUMENT_DATE_FORMAT)); fieldValues.put("appealSubmissionDate", formatDateForRendering(asylumCase.read(APPEAL_SUBMISSION_DATE, String.class).orElse(""), DOCUMENT_DATE_FORMAT)); fieldValues.put("legalRepresentativeEmailAddress", asylumCase.read(LEGAL_REPRESENTATIVE_EMAIL_ADDRESS, String.class).orElse("")); - fieldValues.put("legalRepName", asylumCase.read(LEGAL_REP_NAME, String.class).orElse("")); + fieldValues.put("legalRepName", formatLegalRepName( + asylumCase.read(LEGAL_REP_NAME, String.class).orElse(""), + asylumCase.read(LEGAL_REP_FAMILY_NAME, String.class).orElse(""))); fieldValues.put("legalRepCompany", asylumCase.read(LEGAL_REP_COMPANY, String.class).orElse("")); fieldValues.put("legalRepReferenceNumber", asylumCase.read(LEGAL_REP_REFERENCE_NUMBER, String.class).orElse("")); fieldValues.put("appellantDateOfBirth", formatDateForRendering(asylumCase.read(APPELLANT_DATE_OF_BIRTH, String.class).orElse(""), DOCUMENT_DATE_FORMAT)); @@ -279,6 +282,13 @@ private void populateDetainedFields(AsylumCase asylumCase, Map f fieldValues.put("hasPendingBailApplication", hasBailApplication); } + private String formatLegalRepName(@NonNull String firstName, @NonNull String lastName) { + if (!(lastName.isEmpty() || firstName.isEmpty())) { + return firstName + " " + lastName; + } + return firstName; + } + private void populateAddressFields(AsylumCase asylumCase, Map fieldValues) { Optional optionalAppellantAddress = asylumCase.read(APPELLANT_ADDRESS); diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplate.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplate.java index 9d840b5cc..55bbce032 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplate.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplate.java @@ -1,8 +1,20 @@ package uk.gov.hmcts.reform.iacasedocumentsapi.domain.templates; -import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.*; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.APPEAL_OUT_OF_COUNTRY; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.APPELLANT_INTERPRETER_SIGN_LANGUAGE; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.APPELLANT_INTERPRETER_SPOKEN_LANGUAGE; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_ANY_WITNESS_INTERPRETER_REQUIRED; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_APPELLANT_ATTENDING_THE_HEARING; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_APPELLANT_GIVING_ORAL_EVIDENCE; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_EVIDENCE_FROM_OUTSIDE_UK_IN_COUNTRY; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_EVIDENCE_FROM_OUTSIDE_UK_OOC; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_WITNESSES_ATTENDING; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.WITNESS_DETAILS; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.InterpreterLanguagesUtils.WITNESS_N_INTERPRETER_SIGN_LANGUAGE; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.InterpreterLanguagesUtils.WITNESS_N_INTERPRETER_SPOKEN_LANGUAGE; import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -11,6 +23,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCase; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.InterpreterLanguageRefData; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.WitnessInterpreterLanguageInformation; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.CaseDetails; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.IdValue; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.WitnessDetails; @@ -21,9 +35,11 @@ public class HearingRequirementsTemplate implements DocumentTemplate { private final String templateName; + protected static final String SPOKEN_LANGUAGE = "Spoken language Interpreter"; + protected static final String SIGN_LANGUAGE = "Sign language Interpreter"; public HearingRequirementsTemplate( - @Value("${hearingRequirementsDocument.templateName}") String templateName + @Value("${hearingRequirementsDocument.templateName}") String templateName ) { this.templateName = templateName; } @@ -34,7 +50,7 @@ public String getName() { @Override public Map mapFieldValues( - CaseDetails caseDetails + CaseDetails caseDetails ) { final AsylumCase asylumCase = caseDetails.getCaseData(); @@ -51,14 +67,84 @@ public Map mapFieldValues( Optional>> witnessDetails = asylumCase.read(WITNESS_DETAILS); fieldValues.put( - "witnessDetails", - witnessDetails - .orElse(Collections.emptyList()) - .stream() - .map(witnessIdValue -> ImmutableMap.of("witnessDetails", witnessIdValue.getValue().getWitnessName())) - .collect(Collectors.toList()) + "witnessDetails", + witnessDetails + .orElse(Collections.emptyList()) + .stream() + .map(witnessIdValue -> + ImmutableMap.of("witnessDetails", formatWitnessDetails(witnessIdValue.getValue()))) + .collect(Collectors.toList()) ); + setAppellantInterpreterLanguage(asylumCase, fieldValues); + fieldValues.put("isAnyWitnessInterpreterRequired", asylumCase.read(IS_ANY_WITNESS_INTERPRETER_REQUIRED, YesOrNo.class).orElse(YesOrNo.NO)); + setWitnessInterpreterLanguage(asylumCase, fieldValues); + return fieldValues; } + + private String formatWitnessDetails(WitnessDetails details) { + String givenNames = details.getWitnessName(); + String familyName = details.getWitnessFamilyName(); + + return familyName == null || familyName.isEmpty() + ? givenNames + : String.format("%s %s", givenNames, familyName); + } + + private void setWitnessInterpreterLanguage(AsylumCase asylumCase, Map fieldValues) { + // set witness interpreter language information + Optional>> witnessesOptional = asylumCase.read(WITNESS_DETAILS); + List> witnesses = witnessesOptional.orElse(Collections.emptyList()); + + List witnessInterpreterLanguageInformationList = new ArrayList<>(); + + for (int i = 0; i < witnesses.size(); i++) { + + Optional witnessSpokenInterpreterLanguage = asylumCase.read(WITNESS_N_INTERPRETER_SPOKEN_LANGUAGE.get(i), InterpreterLanguageRefData.class) + .filter(language -> language.getLanguageRefData() != null || language.getLanguageManualEntryDescription() != null); + Optional witnessSignInterpreterLanguage = asylumCase.read(WITNESS_N_INTERPRETER_SIGN_LANGUAGE.get(i), InterpreterLanguageRefData.class) + .filter(language -> language.getLanguageRefData() != null || language.getLanguageManualEntryDescription() != null); + + if (witnessSpokenInterpreterLanguage.isPresent() || witnessSignInterpreterLanguage.isPresent()) { + StringBuilder witnessInterpreterLanguageDisplayString = new StringBuilder(); + witnessInterpreterLanguageDisplayString.append(constructInterpreterLanguageString(witnessSpokenInterpreterLanguage, SPOKEN_LANGUAGE)); + witnessInterpreterLanguageDisplayString.append(constructInterpreterLanguageString(witnessSignInterpreterLanguage, SIGN_LANGUAGE)); + + witnessInterpreterLanguageInformationList.add( + new WitnessInterpreterLanguageInformation( + witnesses.get(i).getValue().buildWitnessFullName(), + witnessInterpreterLanguageDisplayString.toString())); + } + } + + fieldValues.put("witnessInterpreterInformationList", witnessInterpreterLanguageInformationList); + } + + private void setAppellantInterpreterLanguage(AsylumCase asylumCase, Map fieldValues) { + // set appellant interpreter language information + Optional appellantSpokenInterpreterLanguage = asylumCase.read(APPELLANT_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class) + .filter(language -> language.getLanguageRefData() != null || language.getLanguageManualEntryDescription() != null); + Optional appellantSignInterpreterLanguage = asylumCase.read(APPELLANT_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class) + .filter(language -> language.getLanguageRefData() != null || language.getLanguageManualEntryDescription() != null); + + StringBuilder appellantInterpreterLanguageDisplayString = new StringBuilder(); + appellantInterpreterLanguageDisplayString.append(constructInterpreterLanguageString(appellantSpokenInterpreterLanguage, SPOKEN_LANGUAGE)); + appellantInterpreterLanguageDisplayString.append(constructInterpreterLanguageString(appellantSignInterpreterLanguage, SIGN_LANGUAGE)); + + fieldValues.put("appellantInterpreterLanguage", appellantInterpreterLanguageDisplayString.toString()); + } + + private StringBuilder constructInterpreterLanguageString(Optional interpreterLanguageRefData, String typeOfLanguage) { + StringBuilder interpreterLanguageString = new StringBuilder(); + interpreterLanguageRefData.ifPresent(language -> { + interpreterLanguageString.append(typeOfLanguage).append(": "); + if (language.getLanguageRefData() != null) { + interpreterLanguageString.append(language.getLanguageRefData().getValue().getLabel() + "\n"); + } else if (language.getLanguageManualEntry() != null && !language.getLanguageManualEntry().isEmpty()) { + interpreterLanguageString.append(language.getLanguageManualEntryDescription() + "\n"); + } + }); + return interpreterLanguageString; + } } diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplate.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplate.java index 22e801955..8bd9adc80 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplate.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplate.java @@ -35,4 +35,5 @@ public Map mapFieldValues(CaseDetails caseDetails) { return super.mapFieldValues(caseDetails); } -} \ No newline at end of file + +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplate.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplate.java index 03b0372e7..a82bafacf 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplate.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplate.java @@ -35,4 +35,4 @@ public Map mapFieldValues(CaseDetails caseDetails) { return super.mapFieldValues(caseDetails); } -} \ No newline at end of file +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingTemplate.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingTemplate.java index 13c626029..d2deaa23f 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingTemplate.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingTemplate.java @@ -7,25 +7,35 @@ import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.BAIL_REFERENCE_NUMBER; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.HOME_OFFICE_REFERENCE_NUMBER; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IRC_NAME; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IS_REMOTE_HEARING; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LEGAL_REP_REFERENCE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LISTING_HEARING_DATE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LISTING_LOCATION; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.PRISON_NAME; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.REF_DATA_LISTING_LOCATION_DETAIL; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.YesOrNo.NO; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.YesOrNo.YES; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.HashMap; import java.util.Map; +import java.util.Optional; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ApplicantDetainedLocation; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCase; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.CaseDetails; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.YesOrNo; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.StringProvider; import uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.CustomerServicesProvider; +import uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.clients.model.refdata.CourtVenue; public class BailNoticeOfHearingTemplate { private static final DateTimeFormatter DOCUMENT_DATE_FORMAT = DateTimeFormatter.ofPattern("ddMMyyyy"); private static final DateTimeFormatter DOCUMENT_TIME_FORMAT = DateTimeFormatter.ofPattern("HHmm"); + private static final String REMOTE_HEARING_LOCATION = "Cloud Video Platform (CVP)"; + private final CustomerServicesProvider customerServicesProvider; private final StringProvider stringProvider; @@ -50,7 +60,7 @@ public Map mapFieldValues( fieldValues.put("legalRepReference", bailCase.read(LEGAL_REP_REFERENCE, String.class).orElse("")); fieldValues.put("applicantDetainedLoc", getApplicantDetainedLocation(bailCase)); fieldValues.put("applicantPrisonDetails", bailCase.read(APPLICANT_PRISON_DETAILS, String.class).orElse("")); - fieldValues.put("hearingCentreAddress", getListinglocationAddress(bailCase)); + fieldValues.put("hearingCentreAddress", getListingLocationAddressFromRefDataOrCcd(bailCase)); fieldValues.put("hearingDate", formatDateForRendering(listingHearingDate)); fieldValues.put("hearingTime", formatTimeForRendering(listingHearingDate)); fieldValues.put("customerServicesTelephone", customerServicesProvider.getCustomerServicesTelephone()); @@ -59,6 +69,28 @@ public Map mapFieldValues( return fieldValues; } + public String getListingLocationAddressFromRefDataOrCcd(BailCase bailCase) { + String hearingLocationAddress = getListinglocationAddress(bailCase); + YesOrNo isBailsLocationRefDataEnabled = bailCase.read(IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED, YesOrNo.class) + .orElse(NO); + + if (isBailsLocationRefDataEnabled == YES) { + if (bailCase.read(IS_REMOTE_HEARING, YesOrNo.class).orElse(NO) == YES) { + return REMOTE_HEARING_LOCATION; + } else { + Optional refDataListingLocationDetail = bailCase.read(REF_DATA_LISTING_LOCATION_DETAIL, CourtVenue.class); + + if (refDataListingLocationDetail.isPresent()) { + hearingLocationAddress = (refDataListingLocationDetail.get().getCourtName() + ", " + + refDataListingLocationDetail.get().getCourtAddress() + ", " + + refDataListingLocationDetail.get().getPostcode()); + + } + } + } + return hearingLocationAddress; + } + private String formatDateForRendering( String date ) { @@ -89,9 +121,14 @@ private String getListinglocationAddress(BailCase bailCase) { private String getApplicantDetainedLocation(BailCase bailCase) { String location = bailCase.read(APPLICANT_DETAINED_LOC, String.class).orElse(""); - return location.equals(ApplicantDetainedLocation.PRISON.getCode()) + + + String detentionLocation = location.equals(ApplicantDetainedLocation.PRISON.getCode()) ? bailCase.read(PRISON_NAME, String.class).orElse("") : location.equals(ApplicantDetainedLocation.IMIGRATION_REMOVAL_CENTER.getCode()) ? bailCase.read(IRC_NAME, String.class).orElse("") : ""; + + return detentionLocation; + } private boolean isNullOrEmptyString(String str) { diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinder.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinder.java index e78db1c71..fb02d1120 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinder.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinder.java @@ -1,9 +1,13 @@ package uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_DECISION_WITHOUT_HEARING; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.LIST_CASE_HEARING_CENTRE; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.LIST_CASE_HEARING_DATE; + import org.springframework.stereotype.Service; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCase; -import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.HearingCentre; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.YesOrNo; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.StringProvider; @Service @@ -11,6 +15,8 @@ public class HearingDetailsFinder { private static final String HEARING_CENTRE_ADDRESS = "hearingCentreAddress"; + public static final String DECISION_WITHOUT_HEARING = "Decision Without Hearing"; + private final StringProvider stringProvider; public HearingDetailsFinder(StringProvider stringProvider) { @@ -18,75 +24,55 @@ public HearingDetailsFinder(StringProvider stringProvider) { } public String getHearingCentreAddress(AsylumCase asylumCase) { - final HearingCentre listCaseHearingCentre = - getHearingCentre(asylumCase); - - final String hearingCentreAddress = - stringProvider - .get(HEARING_CENTRE_ADDRESS, listCaseHearingCentre.toString()) - .orElseThrow(() -> new IllegalStateException("hearingCentreAddress is not present")); - return hearingCentreAddress; + return stringProvider + .get(HEARING_CENTRE_ADDRESS, getHearingCentre(asylumCase).toString()) + .orElseThrow(() -> new IllegalStateException("hearingCentreAddress is not present")); } public String getHearingCentreName(AsylumCase asylumCase) { - final HearingCentre listCaseHearingCentre = getHearingCentre(asylumCase); + if (isDecisionWithoutHearingAppeal(asylumCase)) { + return DECISION_WITHOUT_HEARING; + } - return stringProvider.get("hearingCentreName", listCaseHearingCentre.toString()) + return stringProvider.get("hearingCentreName", getHearingCentre(asylumCase).toString()) .orElseThrow(() -> new IllegalStateException("listCaseHearingCentreName is not present")); } public String getHearingDateTime(AsylumCase asylumCase) { + return asylumCase - .read(AsylumCaseDefinition.LIST_CASE_HEARING_DATE, String.class) + .read(LIST_CASE_HEARING_DATE, String.class) .orElseThrow(() -> new IllegalStateException("listCaseHearingDate is not present")); } private HearingCentre getHearingCentre(AsylumCase asylumCase) { + return asylumCase - .read(AsylumCaseDefinition.LIST_CASE_HEARING_CENTRE, HearingCentre.class) + .read(LIST_CASE_HEARING_CENTRE, HearingCentre.class) .orElseThrow(() -> new IllegalStateException("listCaseHearingCentre is not present")); } public String getHearingCentreUrl(HearingCentre hearingCentre) { - String hearingCentreUrl; - switch (hearingCentre) { - case BELFAST: - hearingCentreUrl = "https://www.nidirect.gov.uk/contacts/contacts-az/belfast-laganside-courts"; - break; - case BIRMINGHAM: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/birmingham-immigration-and-asylum-chamber-first-tier-tribunal"; - break; - case BRADFORD: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/bradford-tribunal-hearing-centre"; - break; - case GLASGOW: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/glasgow-employment-and-immigration-tribunals-eagle-building"; - break; - case HATTON_CROSS: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/hatton-cross-tribunal-hearing-centre"; - break; - case TAYLOR_HOUSE: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/taylor-house-tribunal-hearing-centre"; - break; - case MANCHESTER: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/manchester-tribunal-hearing-centre"; - break; - case NEWPORT: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/newport-south-wales-immigration-and-asylum-tribunal"; - break; - case NOTTINGHAM: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/nottingham-magistrates-court"; - break; - case NORTH_SHIELDS: - hearingCentreUrl = "https://courttribunalfinder.service.gov.uk/courts/newcastle-civil-family-courts-and-tribunals-centre"; - break; - default: - hearingCentreUrl = "Hearing centre url not available"; - break; - } - return hearingCentreUrl; + return switch (hearingCentre) { + case BELFAST -> "https://www.nidirect.gov.uk/contacts/contacts-az/belfast-laganside-courts"; + case BIRMINGHAM -> "https://courttribunalfinder.service.gov.uk/courts/birmingham-immigration-and-asylum-chamber-first-tier-tribunal"; + case BRADFORD -> "https://courttribunalfinder.service.gov.uk/courts/bradford-tribunal-hearing-centre"; + case GLASGOW -> "https://courttribunalfinder.service.gov.uk/courts/glasgow-employment-and-immigration-tribunals-eagle-building"; + case HATTON_CROSS -> "https://courttribunalfinder.service.gov.uk/courts/hatton-cross-tribunal-hearing-centre"; + case TAYLOR_HOUSE -> "https://courttribunalfinder.service.gov.uk/courts/taylor-house-tribunal-hearing-centre"; + case MANCHESTER -> "https://courttribunalfinder.service.gov.uk/courts/manchester-tribunal-hearing-centre"; + case NEWPORT -> "https://courttribunalfinder.service.gov.uk/courts/newport-south-wales-immigration-and-asylum-tribunal"; + case NOTTINGHAM -> "https://courttribunalfinder.service.gov.uk/courts/nottingham-magistrates-court"; + case NORTH_SHIELDS -> "https://courttribunalfinder.service.gov.uk/courts/newcastle-civil-family-courts-and-tribunals-centre"; + default -> "Hearing centre url not available"; + }; + } + + private boolean isDecisionWithoutHearingAppeal(AsylumCase asylumCase) { + return asylumCase.read(IS_DECISION_WITHOUT_HEARING, YesOrNo.class) + .map(yesOrNo -> YesOrNo.YES == yesOrNo).orElse(false); } } diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/clients/model/refdata/CourtVenue.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/clients/model/refdata/CourtVenue.java new file mode 100644 index 000000000..f8eed893b --- /dev/null +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/clients/model/refdata/CourtVenue.java @@ -0,0 +1,22 @@ +package uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.clients.model.refdata; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import lombok.AllArgsConstructor; +import lombok.Value; + +@Value +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) +@AllArgsConstructor +public class CourtVenue { + + private String siteName; + private String courtName; + private String epimmsId; + private String courtStatus; + private String isHearingLocation; + private String isCaseManagementLocation; + private String courtAddress; + private String postcode; + +} diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/DocumentCreatorConfiguration.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/DocumentCreatorConfiguration.java index ce92f4b78..2591c5360 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/DocumentCreatorConfiguration.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/DocumentCreatorConfiguration.java @@ -120,6 +120,27 @@ public DocumentCreator getHearingNoticeAdjournedWithoutDateDocumentC ); } + @Bean("noticeOfAdjournedHearing") + public DocumentCreator getNoticeOfAdjournedHearingDocumentCreator( + @Value("${noticeOfAdjournedHearingDocument.contentType}") String contentType, + @Value("${noticeOfAdjournedHearingDocument.fileExtension}") String fileExtension, + @Value("${noticeOfAdjournedHearingDocument.fileName}") String fileName, + AsylumCaseFileNameQualifier fileNameQualifier, + @Qualifier("noticeOfAdjournedHearingTemplate") HearingNoticeTemplate documentTemplate, + DocumentGenerator documentGenerator, + DocumentUploader documentUploader + ) { + return new DocumentCreator<>( + contentType, + fileExtension, + fileName, + fileNameQualifier, + documentTemplate, + documentGenerator, + documentUploader + ); + } + @Bean("hearingNoticeEdited") public DocumentCreator getHearingNoticeEditedDocumentCreator( @Value("${hearingNoticeEditedDocument.contentType}") String contentType, diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/HearingNoticeTemplateConfiguration.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/HearingNoticeTemplateConfiguration.java index 68e2a1d5e..dcb089ba8 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/HearingNoticeTemplateConfiguration.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/config/HearingNoticeTemplateConfiguration.java @@ -38,4 +38,10 @@ public HearingNoticeTemplate getAdaHearingNoticeTemplate( @Value("${hearingNoticeAdaDocument.templateName}") String templateName, StringProvider stringProvider) { return new HearingNoticeTemplate(templateName, stringProvider, customerServicesProvider); } + + @Bean("noticeOfAdjournedHearingTemplate") + public HearingNoticeTemplate getNoticeOfAdjournedHearingTemplate( + @Value("${noticeOfAdjournedHearingDocument.templateName}") String templateName, StringProvider stringProvider) { + return new HearingNoticeTemplate(templateName, stringProvider, customerServicesProvider); + } } diff --git a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/controllers/advice/CallbackControllerAdvice.java b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/controllers/advice/CallbackControllerAdvice.java index 14c5103b5..bc5fe02cb 100644 --- a/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/controllers/advice/CallbackControllerAdvice.java +++ b/src/main/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/controllers/advice/CallbackControllerAdvice.java @@ -35,7 +35,7 @@ public CallbackControllerAdvice(ErrorResponseLogger errorResponseLogger) { }) protected ResponseEntity handleExceptions( HttpServletRequest request, - RequiredFieldMissingException e + Exception e ) { log.error("Exception for the CCDCaseId: {}", RequestContextHolder.currentRequestAttributes().getAttribute("CCDCaseId", RequestAttributes.SCOPE_REQUEST)); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index b234ac569..4c2757e86 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -36,6 +36,8 @@ spring: allow-bean-definition-overriding: true application: name: Immigration & Asylum case documents API + config: + import: "optional:configtree:/mnt/secrets/ia/" jackson.date-format: yyyy-MM-dd security: oauth2: @@ -82,6 +84,11 @@ hearingNoticeAdjournedWithoutDateDocument.fileExtension: PDF hearingNoticeAdjournedWithoutDateDocument.fileName: "hearing-notice" hearingNoticeAdjournedWithoutDateDocument.templateName: ${IA_HEARING_NOTICE_ADJOURNED_WITHOUT_DATE_TEMPLATE:TB-IAC-HNO-ENG-00376.docx} +noticeOfAdjournedHearingDocument.contentType: application/pdf +noticeOfAdjournedHearingDocument.fileExtension: PDF +noticeOfAdjournedHearingDocument.fileName: "notice-of-adjourned-hearing" +noticeOfAdjournedHearingDocument.templateName: ${NOTICE_OF_ADJOURNED_HEARING_TEMPLATE:TB-IAC-HNO-ENG-00240.docx} + hearingNoticeEditedDocument.contentType: application/pdf hearingNoticeEditedDocument.fileExtension: PDF hearingNoticeEditedDocument.fileName: "hearing-notice" @@ -527,6 +534,7 @@ security: - "editAppealAfterSubmit" - "generateHearingBundle" - "customiseHearingBundle" + - "recordAdjournmentDetails" - "requestCaseBuilding" - "asyncStitchingComplete" - "recordOutOfTimeDecision" @@ -567,6 +575,8 @@ security: - "makeNewApplication" - "editBailApplicationAfterSubmit" - "uploadSignedDecisionNotice" + - "caseListing" + - "recordAdjournmentDetails" - "editAppealAfterSubmit" - "markAppealPaid" - "recordRemissionDecision" @@ -618,7 +628,10 @@ security: caseworker-ia-system: - "submitReasonsForAppeal" - "endAppealAutomatically" + - "listCase" + - "editCaseListing" - "caseListing" + - "recordAdjournmentDetails" - "requestHearingRequirementsFeature" caseworker-ia-homeofficelart: - "uploadHomeOfficeAppealResponse" @@ -629,7 +642,7 @@ security: - "uploadAdditionalEvidenceHomeOffice" - "uploadAddendumEvidenceHomeOffice" - "submitApplication" - - "makeNewApplication" + - "makeNewApplication" caseworker-ia-respondentofficer: - "applyForFTPARespondent" - "uploadAdditionalEvidenceHomeOffice" diff --git a/src/main/resources/strings.tsv b/src/main/resources/strings.tsv index 8ec23ca1d..f45a857e4 100644 --- a/src/main/resources/strings.tsv +++ b/src/main/resources/strings.tsv @@ -74,7 +74,7 @@ hearingCentreAddress leedsMags Leeds Magistrates' Court and Family Court, Westga hearingCentreAddress alloaSherrif Alloa Sheriff Court, 47 Drysdale Street, Alloa, FK10 1JA hearingCentreAddress remoteHearing Cloud Video Platform (CVP) hearingCentreAddress decisionWithoutHearing No hearing centre -hearingCentreAddress harmondsworth Harmondsworth Tribunal Hearing Centre, Colnbrook Bypass, Harmondsworth, UB7 0HD +hearingCentreAddress harmondsworth Harmondsworth Tribunal Hearing Centre, Colnbrook Bypass, UB7 0HB isoCountries AF Afghanistan isoCountries AX Aland Islands isoCountries AL Albania diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinitionTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinitionTest.java index 34ab4cebf..f75b938ec 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinitionTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/BailCaseFieldDefinitionTest.java @@ -32,6 +32,6 @@ public void mapped_to_equivalent_field_name() { @Test public void should_fail_if_new_fields_added_in_class() { - assertEquals(170, values().length); + assertEquals(173, values().length); } } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTagTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTagTest.java index 09a110b9e..17752cfde 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTagTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DocumentTagTest.java @@ -32,6 +32,7 @@ void has_correct_values() { assertEquals("upperTribunalBundle", DocumentTag.UPPER_TRIBUNAL_BUNDLE.toString()); assertEquals("appealReasons", DocumentTag.APPEAL_REASONS.toString()); assertEquals("clarifyingQuestions", DocumentTag.CLARIFYING_QUESTIONS.toString()); + assertEquals("noticeOfAdjournedHearing", DocumentTag.NOTICE_OF_ADJOURNED_HEARING.toString()); assertEquals("appealForm", DocumentTag.APPEAL_FORM.toString()); assertEquals("noticeOfDecisionUtTransfer", DocumentTag.NOTICE_OF_DECISION_UT_TRANSFER.toString()); assertEquals("remittalDecision", DocumentTag.REMITTAL_DECISION.toString()); @@ -89,6 +90,6 @@ void has_correct_values() { @Test public void if_this_test_fails_it_is_because_it_needs_updating_with_your_changes() { - assertEquals(85, DocumentTag.values().length); + assertEquals(86, DocumentTag.values().length); } } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicListTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicListTest.java new file mode 100644 index 000000000..e94acf5a2 --- /dev/null +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/DynamicListTest.java @@ -0,0 +1,34 @@ +package uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class DynamicListTest { + + @Mock + private Value value; + + @Test + void should_initialize_with_value_and_list_of_values() { + List lov = List.of(value,value,value); + DynamicList dynamicList = new DynamicList(value, lov); + + assertEquals(value, dynamicList.getValue()); + assertEquals(lov, dynamicList.getListItems()); + } + + @Test + void should_set_fields() { + DynamicList dynamicList = new DynamicList(null, Collections.emptyList()); + dynamicList.setValue(value); + + assertEquals(value, dynamicList.getValue()); + } +} diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentreTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentreTest.java index 618acd09f..dc9f01dc3 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentreTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/HearingCentreTest.java @@ -24,7 +24,15 @@ public void has_correct_values() { assertEquals("belfast", HearingCentre.BELFAST.toString()); assertEquals("newcastle", HearingCentre.NEWCASTLE.toString()); assertEquals("harmondsworth", HearingCentre.HARMONDSWORTH.toString()); - assertEquals("yarlswood", HearingCentre.YARLSWOOD.toString()); + assertEquals("hendon", HearingCentre.HENDON.toString()); + assertEquals("yarlsWood", HearingCentre.YARLS_WOOD.toString()); + assertEquals("bradfordKeighley", HearingCentre.BRADFORD_KEIGHLEY.toString()); + assertEquals("mccMinshull", HearingCentre.MCC_MINSHULL.toString()); + assertEquals("mccCrownSquare", HearingCentre.MCC_CROWN_SQUARE.toString()); + assertEquals("manchesterMags", HearingCentre.MANCHESTER_MAGS.toString()); + assertEquals("nthTyneMags", HearingCentre.NTH_TYNE_MAGS.toString()); + assertEquals("leedsMags", HearingCentre.LEEDS_MAGS.toString()); + assertEquals("alloaSherrif", HearingCentre.ALLOA_SHERRIF.toString()); assertEquals("remoteHearing", HearingCentre.REMOTE_HEARING.toString()); assertEquals("decisionWithoutHearing", HearingCentre.DECISION_WITHOUT_HEARING.toString()); } @@ -45,13 +53,21 @@ public void can_be_created_from() { assertEquals(HearingCentre.BELFAST, HearingCentre.from("belfast").get()); assertEquals(HearingCentre.NEWCASTLE, HearingCentre.from("newcastle").get()); assertEquals(HearingCentre.HARMONDSWORTH, HearingCentre.from("harmondsworth").get()); - assertEquals(HearingCentre.YARLSWOOD, HearingCentre.from("yarlswood").get()); + assertEquals(HearingCentre.HENDON, HearingCentre.from("hendon").get()); + assertEquals(HearingCentre.YARLS_WOOD, HearingCentre.from("yarlsWood").get()); + assertEquals(HearingCentre.BRADFORD_KEIGHLEY, HearingCentre.from("bradfordKeighley").get()); + assertEquals(HearingCentre.MCC_MINSHULL, HearingCentre.from("mccMinshull").get()); + assertEquals(HearingCentre.MCC_CROWN_SQUARE, HearingCentre.from("mccCrownSquare").get()); + assertEquals(HearingCentre.MANCHESTER_MAGS, HearingCentre.from("manchesterMags").get()); + assertEquals(HearingCentre.NTH_TYNE_MAGS, HearingCentre.from("nthTyneMags").get()); + assertEquals(HearingCentre.LEEDS_MAGS, HearingCentre.from("leedsMags").get()); + assertEquals(HearingCentre.ALLOA_SHERRIF, HearingCentre.from("alloaSherrif").get()); assertEquals(HearingCentre.REMOTE_HEARING, HearingCentre.from("remoteHearing").get()); assertEquals(HearingCentre.DECISION_WITHOUT_HEARING, HearingCentre.from("decisionWithoutHearing").get()); } @Test public void if_this_test_fails_it_is_because_it_needs_updating_with_your_changes() { - assertEquals(17, HearingCentre.values().length); + assertEquals(25, HearingCentre.values().length); } } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/EventTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/EventTest.java index a5b83d6ce..9217b4506 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/EventTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/EventTest.java @@ -42,6 +42,7 @@ public void has_correct_values() { assertEquals("generateUpperTribunalBundle", Event.GENERATE_UPPER_TRIBUNAL_BUNDLE.toString()); assertEquals("submitReasonsForAppeal", Event.SUBMIT_REASONS_FOR_APPEAL.toString()); assertEquals("submitClarifyingQuestionAnswers",Event.SUBMIT_CLARIFYING_QUESTION_ANSWERS.toString()); + assertEquals("recordAdjournmentDetails", Event.RECORD_ADJOURNMENT_DETAILS.toString()); assertEquals("updateTribunalDecision",Event.UPDATE_TRIBUNAL_DECISION.toString()); assertEquals("submitApplication",Event.SUBMIT_APPLICATION.toString()); assertEquals("recordTheDecision",Event.RECORD_THE_DECISION.toString()); @@ -77,6 +78,6 @@ public void has_correct_values() { @Test public void if_this_test_fails_it_is_because_it_needs_updating_with_your_changes() { - assertEquals(68, Event.values().length); + assertEquals(69, Event.values().length); } } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetailsTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetailsTest.java index 568c17994..a523019db 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetailsTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/entities/ccd/field/WitnessDetailsTest.java @@ -1,23 +1,50 @@ package uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field; -import org.junit.Assert; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; public class WitnessDetailsTest { private final String witnessName = "Some Name"; + private final String witnessFamilyName = "Some family Name"; private WitnessDetails witnessDetails; @BeforeEach public void setUp() { witnessDetails = new WitnessDetails(); witnessDetails.setWitnessName(witnessName); + witnessDetails.setWitnessFamilyName(witnessFamilyName); } @Test public void should_hold_onto_values() { - Assert.assertEquals(witnessName, witnessDetails.getWitnessName()); + assertEquals(witnessName, witnessDetails.getWitnessName()); + assertEquals(witnessFamilyName, witnessDetails.getWitnessFamilyName()); + } + + @Test + public void should_build_witness_full_name_if_names_present() { + assertEquals(witnessName + " " + witnessFamilyName, witnessDetails.buildWitnessFullName()); + } + + @Test + public void should_build_witness_full_name_if_names_not_present() { + WitnessDetails witnessDetails2 = new WitnessDetails(); + assertEquals(" ", witnessDetails2.buildWitnessFullName()); + } + + @Test + public void should_initialize_object() { + WitnessDetails witnessDetails3 = new WitnessDetails(witnessName); + assertEquals(witnessName, witnessDetails3.getWitnessName()); + assertNull(witnessDetails3.getWitnessFamilyName()); + + WitnessDetails witnessDetails4 = new WitnessDetails(witnessName, witnessFamilyName); + assertEquals(witnessName, witnessDetails4.getWitnessName()); + assertEquals(witnessFamilyName, witnessDetails4.getWitnessFamilyName()); } } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreatorTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreatorTest.java index e005bd2a2..e141947de 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreatorTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeCreatorTest.java @@ -18,6 +18,8 @@ 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.CsvSource; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoSettings; @@ -95,16 +97,24 @@ public void setUp() { when(asylumCase.read(IS_ACCELERATED_DETAINED_APPEAL, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); } - @Test - void should_create_hearing_notice_pdf_and_append_to_legal_representative_documents_for_the_case() { + @ParameterizedTest + @CsvSource({ "TAYLOR_HOUSE, NO, NO", "TAYLOR_HOUSE, YES, NO", "REMOTE_HEARING, YES, NO"}) + void should_create_hearing_notice_pdf_and_append_to_legal_representative_documents_for_the_case( + HearingCentre hearingCentre, + YesOrNo enabledRefData, + YesOrNo isRefDataRemoteHearing) { when(callback.getCaseDetails()).thenReturn(caseDetails); when(callback.getEvent()).thenReturn(Event.LIST_CASE); when(caseDetails.getCaseData()).thenReturn(asylumCase); when(hearingNoticeDocumentCreator.create(caseDetails)).thenReturn(uploadedDocument); - when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.TAYLOR_HOUSE)); + when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(hearingCentre)); when(asylumCase.read(IS_REHEARD_APPEAL_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); when(asylumCase.read(CASE_FLAG_SET_ASIDE_REHEARD_EXISTS, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(enabledRefData)); + if (enabledRefData.equals(YesOrNo.YES)) { + when(asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(isRefDataRemoteHearing)); + } PreSubmitCallbackResponse callbackResponse = hearingNoticeCreator.handle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, callback); @@ -125,6 +135,7 @@ void should_create_hearing_notice_pdf_and_append_to_legal_representative_documen when(hearingNoticeDocumentCreator.create(caseDetails)).thenReturn(uploadedDocument); when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.TAYLOR_HOUSE)); when(asylumCase.read(IS_REHEARD_APPEAL_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); PreSubmitCallbackResponse callbackResponse = hearingNoticeCreator.handle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, callback); @@ -146,6 +157,7 @@ void should_create_hearing_notice_pdf_and_append_to_reheard_hearing_documents_fo when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.TAYLOR_HOUSE)); when(asylumCase.read(IS_REHEARD_APPEAL_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); when(asylumCase.read(CASE_FLAG_SET_ASIDE_REHEARD_EXISTS, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); PreSubmitCallbackResponse callbackResponse = hearingNoticeCreator.handle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, callback); @@ -157,8 +169,11 @@ void should_create_hearing_notice_pdf_and_append_to_reheard_hearing_documents_fo verify(documentHandler, times(1)).addWithMetadataWithoutReplacingExistingDocuments(asylumCase, uploadedDocument, REHEARD_HEARING_DOCUMENTS, DocumentTag.REHEARD_HEARING_NOTICE); } - @Test - void should_create_remote_hearing_notice_pdf_and_append_to_reheard_hearing_documents_for_the_case() { + @ParameterizedTest + @CsvSource({ "NO, NO", "YES, YES", "NO, YES" }) + void should_create_remote_hearing_notice_pdf_and_append_to_reheard_hearing_documents_for_the_case( + YesOrNo enabledRefData, + YesOrNo isRefDataRemoteHearing) { when(callback.getCaseDetails()).thenReturn(caseDetails); when(callback.getEvent()).thenReturn(Event.LIST_CASE); @@ -168,6 +183,10 @@ void should_create_remote_hearing_notice_pdf_and_append_to_reheard_hearing_docum when(asylumCase.read(CASE_FLAG_SET_ASIDE_REHEARD_EXISTS, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.REMOTE_HEARING)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(enabledRefData)); + if (enabledRefData.equals(YesOrNo.YES)) { + when(asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(isRefDataRemoteHearing)); + } PreSubmitCallbackResponse callbackResponse = hearingNoticeCreator.handle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, callback); diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreatorTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreatorTest.java index 2c0b20fe1..1f74332e4 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreatorTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/HearingNoticeEditedCreatorTest.java @@ -9,6 +9,8 @@ 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.CsvSource; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCase; @@ -104,6 +106,7 @@ void should_create_hearing_notice_pdf_and_append_to_legal_representative_documen when(asylumCase.read(CASE_FLAG_SET_ASIDE_REHEARD_EXISTS, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.TAYLOR_HOUSE)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); when(asylumCase.read(IS_ACCELERATED_DETAINED_APPEAL, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); @@ -129,8 +132,11 @@ void should_create_hearing_notice_pdf_and_append_to_legal_representative_documen verify(documentHandler, times(1)).addWithMetadataWithoutReplacingExistingDocuments(asylumCase, uploadedDocument, HEARING_DOCUMENTS, DocumentTag.HEARING_NOTICE); } - @Test - void should_create_hearing_notice_pdf_and_append_to_legal_representative_documents_for_the_case_for_remote_hearing() { + @ParameterizedTest + @CsvSource({ "NO, NO", "YES, YES", "NO, YES" }) + void should_create_hearing_notice_pdf_and_append_to_legal_representative_documents_for_the_case_for_remote_hearing( + YesOrNo enabledRefData, + YesOrNo isRefDataRemoteHearing) { when(callback.getEvent()).thenReturn(Event.SUBMIT_APPEAL); when(callback.getEvent()).thenReturn(Event.EDIT_CASE_LISTING); when(callback.getCaseDetails()).thenReturn(caseDetails); @@ -140,7 +146,12 @@ void should_create_hearing_notice_pdf_and_append_to_legal_representative_documen when(asylumCase.read(IS_REHEARD_APPEAL_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); when(asylumCase.read(CASE_FLAG_SET_ASIDE_REHEARD_EXISTS, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); - when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.REMOTE_HEARING)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(enabledRefData)); + if (enabledRefData.equals(YesOrNo.YES)) { + when(asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(isRefDataRemoteHearing)); + } else { + when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.REMOTE_HEARING)); + } when(asylumCase.read(IS_ACCELERATED_DETAINED_APPEAL, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); @@ -167,8 +178,11 @@ void should_create_hearing_notice_pdf_and_append_to_legal_representative_documen verify(documentHandler, times(0)).addWithMetadataWithoutReplacingExistingDocuments(asylumCase, uploadedDocument, HEARING_DOCUMENTS, DocumentTag.HEARING_NOTICE); } - @Test - void should_create_hearing_notice_pdf_and_append_to_legal_representative_documents_for_the_case_for_remote_hearing_reheard_case() { + @ParameterizedTest + @CsvSource({ "NO, NO", "YES, YES", "NO, YES" }) + void should_create_hearing_notice_pdf_and_append_to_legal_representative_documents_for_the_case_for_remote_hearing_reheard_case( + YesOrNo enabledRefData, + YesOrNo isRefDataRemoteHearing) { when(callback.getEvent()).thenReturn(Event.SUBMIT_APPEAL); when(callback.getEvent()).thenReturn(Event.EDIT_CASE_LISTING); when(callback.getCaseDetails()).thenReturn(caseDetails); @@ -178,7 +192,12 @@ void should_create_hearing_notice_pdf_and_append_to_legal_representative_documen when(asylumCase.read(IS_REHEARD_APPEAL_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); when(asylumCase.read(CASE_FLAG_SET_ASIDE_REHEARD_EXISTS, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); - when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.REMOTE_HEARING)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(enabledRefData)); + if (enabledRefData.equals(YesOrNo.YES)) { + when(asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(isRefDataRemoteHearing)); + } else { + when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.REMOTE_HEARING)); + } when(asylumCase.read(IS_ACCELERATED_DETAINED_APPEAL, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); @@ -218,6 +237,7 @@ void should_create_reheard_hearing_notice_pdf_and_append_to_legal_representative when(asylumCase.read(CASE_FLAG_SET_ASIDE_REHEARD_EXISTS, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.TAYLOR_HOUSE)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); when(asylumCase.read(IS_ACCELERATED_DETAINED_APPEAL, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreatorTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreatorTest.java new file mode 100644 index 000000000..2ad1eb5ed --- /dev/null +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/handlers/presubmit/RecordAdjournmentDetailsCreatorTest.java @@ -0,0 +1,130 @@ +package uk.gov.hmcts.reform.iacasedocumentsapi.domain.handlers.presubmit; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.HEARING_DOCUMENTS; + +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.mockito.junit.jupiter.MockitoExtension; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCase; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.DocumentTag; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.CaseDetails; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.Event; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.callback.Callback; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.callback.PreSubmitCallbackResponse; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.callback.PreSubmitCallbackStage; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.Document; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.DocumentCreator; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.DocumentHandler; + +@ExtendWith(MockitoExtension.class) +@SuppressWarnings("unchecked") +public class RecordAdjournmentDetailsCreatorTest { + + @Mock private DocumentCreator noticeOfAdjournedHearingDocumentCreator; + @Mock private DocumentHandler documentHandler; + + @Mock private Callback callback; + @Mock private CaseDetails caseDetails; + @Mock private AsylumCase asylumCase; + @Mock private Document uploadedDocument; + + private RecordAdjournmentDetailsCreator recordAdjournmentDetailsCreator; + + @BeforeEach + public void setUp() { + + recordAdjournmentDetailsCreator = + new RecordAdjournmentDetailsCreator( + noticeOfAdjournedHearingDocumentCreator, + documentHandler + ); + } + + @Test + public void should_create_notice_of_adjourned_hearing_pdf_and_append_to_hearing_documents() { + when(callback.getCaseDetails()).thenReturn(caseDetails); + when(callback.getEvent()).thenReturn(Event.RECORD_ADJOURNMENT_DETAILS); + when(caseDetails.getCaseData()).thenReturn(asylumCase); + + when(noticeOfAdjournedHearingDocumentCreator.create(caseDetails)).thenReturn(uploadedDocument); + + PreSubmitCallbackResponse callbackResponse = + recordAdjournmentDetailsCreator.handle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, callback); + + assertNotNull(callbackResponse); + assertEquals(asylumCase, callbackResponse.getData()); + + verify(noticeOfAdjournedHearingDocumentCreator, times(1)).create(caseDetails); + verify(documentHandler, times(1)).addWithMetadataWithoutReplacingExistingDocuments( + asylumCase, + uploadedDocument, + HEARING_DOCUMENTS, + DocumentTag.NOTICE_OF_ADJOURNED_HEARING); + } + + @Test + public void handling_should_throw_if_cannot_actually_handle() { + + assertThatThrownBy(() -> recordAdjournmentDetailsCreator.handle(PreSubmitCallbackStage.ABOUT_TO_START, callback)) + .hasMessage("Cannot handle callback") + .isExactlyInstanceOf(IllegalStateException.class); + + when(callback.getEvent()).thenReturn(Event.START_APPEAL); + assertThatThrownBy(() -> recordAdjournmentDetailsCreator.handle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, callback)) + .hasMessage("Cannot handle callback") + .isExactlyInstanceOf(IllegalStateException.class); + } + + @Test + public void it_can_handle_callback() { + + for (Event event : Event.values()) { + + when(callback.getEvent()).thenReturn(event); + + for (PreSubmitCallbackStage callbackStage : PreSubmitCallbackStage.values()) { + + boolean canHandle = recordAdjournmentDetailsCreator.canHandle(callbackStage, callback); + + if (event == Event.RECORD_ADJOURNMENT_DETAILS && callbackStage == PreSubmitCallbackStage.ABOUT_TO_SUBMIT) { + assertTrue(canHandle); + } else { + assertFalse(canHandle); + } + } + + reset(callback); + } + } + + @Test + public void should_not_allow_null_arguments() { + + assertThatThrownBy(() -> recordAdjournmentDetailsCreator.canHandle(null, callback)) + .hasMessage("callbackStage must not be null") + .isExactlyInstanceOf(NullPointerException.class); + + assertThatThrownBy(() -> recordAdjournmentDetailsCreator.canHandle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, null)) + .hasMessage("callback must not be null") + .isExactlyInstanceOf(NullPointerException.class); + + assertThatThrownBy(() -> recordAdjournmentDetailsCreator.handle(null, callback)) + .hasMessage("callbackStage must not be null") + .isExactlyInstanceOf(NullPointerException.class); + + assertThatThrownBy(() -> recordAdjournmentDetailsCreator.handle(PreSubmitCallbackStage.ABOUT_TO_SUBMIT, null)) + .hasMessage("callback must not be null") + .isExactlyInstanceOf(NullPointerException.class); + } +} diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrderTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrderTest.java index d8037fb5f..4127607d7 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrderTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/BundleOrderTest.java @@ -37,7 +37,7 @@ public void should_sort_in_correct_order_excluding_bail_tags() { .map(DocumentWithMetadata::getTag) .collect(Collectors.toList()); - assertEquals(78, sortedTags.size()); + assertEquals(79, sortedTags.size()); List documentTagList = Arrays.asList( DocumentTag.CASE_SUMMARY, @@ -117,6 +117,7 @@ public void should_sort_in_correct_order_excluding_bail_tags() { DocumentTag.UPDATED_DECISION_AND_REASONS_COVER_LETTER, DocumentTag.UPDATED_FINAL_DECISION_AND_REASONS_PDF, DocumentTag.REMITTAL_DECISION, + DocumentTag.NOTICE_OF_ADJOURNED_HEARING, DocumentTag.NONE ); diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapperTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapperTest.java index 3a5d276d9..656387759 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapperTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/service/HearingNoticeFieldMapperTest.java @@ -56,10 +56,13 @@ class HearingNoticeFieldMapperTest { private String expectedFormattedHearingTimePart = "1234"; private String expectedFormattedManchesterHearingCentreAddress = "Manchester\n123 Somewhere\nNorth"; private String expectedFormattedTaylorHouseHearingCentreAddress = "London\n456 Somewhere\nSouth"; + private String manchesterRefDataAddress = "Manchester Tribunal Hearing Centre - Piccadilly Exchange, Piccadilly Plaza, M1 4AH"; private String customerServicesTelephone = "555 555 555"; private String customerServicesEmail = "customer.services@example.com"; + private YesOrNo isIntegrated = YesOrNo.NO; + private HearingNoticeTemplate hearingNoticeTemplate; @BeforeEach @@ -106,13 +109,15 @@ void should_map_case_data_to_template_field_values() { when(asylumCase.read(SUBMIT_HEARING_REQUIREMENTS_AVAILABLE)).thenReturn(Optional.of(YesOrNo.NO)); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.of(isIntegrated)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); when((customerServicesProvider.getCustomerServicesTelephone())).thenReturn(customerServicesTelephone); when((customerServicesProvider.getCustomerServicesEmail())).thenReturn(customerServicesEmail); Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); - assertEquals(17, templateFieldValues.size()); + assertEquals(18, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(appealReferenceNumber, templateFieldValues.get("appealReferenceNumber")); assertEquals(appellantGivenNames, templateFieldValues.get("appellantGivenNames")); @@ -128,6 +133,7 @@ void should_map_case_data_to_template_field_values() { assertEquals(singleSexCourt, templateFieldValues.get("singleSexCourt")); assertEquals(inCamera, templateFieldValues.get("inCamera")); assertEquals(otherHearingRequest, templateFieldValues.get("otherHearingRequest")); + assertEquals(isIntegrated, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } @@ -157,6 +163,8 @@ void should_map_case_data_from_submit_hearing_to_template_field_values() { when(asylumCase.read(IN_CAMERA_COURT_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(caseOfficerReviewedInCamera)); when(asylumCase.read(ADDITIONAL_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(caseOfficerReviewedOther)); when(asylumCase.read(SUBMIT_HEARING_REQUIREMENTS_AVAILABLE)).thenReturn(Optional.of(YesOrNo.NO)); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); when((customerServicesProvider.getCustomerServicesTelephone())).thenReturn(customerServicesTelephone); when((customerServicesProvider.getCustomerServicesEmail())).thenReturn(customerServicesEmail); @@ -164,7 +172,7 @@ void should_map_case_data_from_submit_hearing_to_template_field_values() { when(asylumCase.read(SUBMIT_HEARING_REQUIREMENTS_AVAILABLE)).thenReturn(Optional.of(YesOrNo.YES)); Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); - assertEquals(17, templateFieldValues.size()); + assertEquals(18, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(appealReferenceNumber, templateFieldValues.get("appealReferenceNumber")); assertEquals(appellantGivenNames, templateFieldValues.get("appellantGivenNames")); @@ -180,6 +188,7 @@ void should_map_case_data_from_submit_hearing_to_template_field_values() { assertEquals(caseOfficerReviewedSingleSexCourt, templateFieldValues.get("singleSexCourt")); assertEquals(caseOfficerReviewedInCamera, templateFieldValues.get("inCamera")); assertEquals(caseOfficerReviewedOther, templateFieldValues.get("otherHearingRequest")); + assertEquals(isIntegrated, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } @@ -210,18 +219,34 @@ void should_use_correct_hearing_centre_address() { setUpData(); when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.MANCHESTER)); when(stringProvider.get("hearingCentreAddress", "manchester")).thenReturn(Optional.of(manchesterHearingCentreAddress)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); assertEquals(expectedFormattedManchesterHearingCentreAddress, templateFieldValues.get("hearingCentreAddress")); } + @Test + void should_use_correct_hearing_centre_address_when_ref_data_feature_is_on() { + + setUpData(); + when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.MANCHESTER)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(asylumCase.read(LIST_CASE_HEARING_CENTRE_ADDRESS, String.class)).thenReturn(Optional.of(manchesterRefDataAddress)); + when(asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + + Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); + + assertEquals(manchesterRefDataAddress, templateFieldValues.get("hearingCentreAddress")); + } + @Test void should_use_remote_hearing_centre() { setUpData(); when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.REMOTE_HEARING)); when(asylumCase.read(REMOTE_VIDEO_CALL_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of("Remote hearing agreed")); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); @@ -230,6 +255,22 @@ void should_use_remote_hearing_centre() { assertEquals(ariaListingReference, templateFieldValues.get("ariaListingReference")); } + @Test + void should_use_remote_hearing_centre_when_ref_data_feature_is_on() { + + setUpData(); + when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.REMOTE_HEARING)); + when(asylumCase.read(REMOTE_VIDEO_CALL_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of("agreed for remote hearing")); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(asylumCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(asylumCase.read(LIST_CASE_HEARING_CENTRE_ADDRESS, String.class)).thenReturn(Optional.of(manchesterRefDataAddress)); + + Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); + + assertEquals("Remote hearing", templateFieldValues.get("remoteHearing")); + assertEquals("agreed for remote hearing", templateFieldValues.get("remoteVideoCallTribunalResponse")); + } + @Test void should_be_tolerant_of_missing_data() { @@ -272,10 +313,12 @@ void should_be_tolerant_of_missing_data() { when(asylumCase.read(LIST_CASE_REQUIREMENTS_SINGLE_SEX_COURT, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(LIST_CASE_REQUIREMENTS_IN_CAMERA_COURT, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(LIST_CASE_REQUIREMENTS_OTHER, String.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.empty()); Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); - assertEquals(17, templateFieldValues.size()); + assertEquals(18, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals("", templateFieldValues.get("appealReferenceNumber")); assertEquals("", templateFieldValues.get("appellantGivenNames")); @@ -288,6 +331,7 @@ void should_be_tolerant_of_missing_data() { assertEquals("The court will not be single sex", templateFieldValues.get("singleSexCourt")); assertEquals("The hearing will be held in public court", templateFieldValues.get("inCamera")); assertEquals("No other adjustments are being made", templateFieldValues.get("otherHearingRequest")); + assertEquals(YesOrNo.NO, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplateTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplateTest.java index 92f951c8d..db051961f 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplateTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/AppealSubmissionTemplateTest.java @@ -51,6 +51,8 @@ public class AppealSubmissionTemplateTest { private LocalDateTime createdDate = LocalDateTime.parse("2020-12-31T12:34:56"); private String appealReferenceNumber = "RP/11111/2020"; private String legalRepReferenceNumber = "OUR-REF"; + private final String legalRepFirstName = "legalRepFirstName"; + private final String legalRepFamilyName = "legalRepFamilyName"; private String homeOfficeReferenceNumber = "A1234567/001"; private String homeOfficeDecisionDate = "2020-12-23"; private String decisionLetterReceivedDate = "2020-12-23"; @@ -237,6 +239,43 @@ void should_map_case_data_to_template_field_values() { assertEquals(YesOrNo.YES, templateFieldValues.get("hasOtherAppeals")); } + @Test + void should_correctly_map_legal_rep_name_when_only_first_name_provided() { + + when(caseDetails.getCaseData()).thenReturn(asylumCase); + when(caseDetails.getCreatedDate()).thenReturn(createdDate); + when(asylumCase.read(LEGAL_REP_NAME, String.class)).thenReturn(Optional.of(legalRepFirstName)); + + Map templateFieldValues = appealSubmissionTemplate.mapFieldValues(caseDetails); + + assertEquals(legalRepFirstName, templateFieldValues.get("legalRepName")); + } + + @Test + void should_correctly_map_legal_rep_name_when_only_family_name_provided() { + + when(caseDetails.getCaseData()).thenReturn(asylumCase); + when(caseDetails.getCreatedDate()).thenReturn(createdDate); + when(asylumCase.read(LEGAL_REP_FAMILY_NAME, String.class)).thenReturn(Optional.of(legalRepFamilyName)); + + Map templateFieldValues = appealSubmissionTemplate.mapFieldValues(caseDetails); + + assertEquals("", templateFieldValues.get("legalRepName")); + } + + @Test + void should_correctly_map_legal_rep_name_when_first_name_and_family_name_provided() { + + when(caseDetails.getCaseData()).thenReturn(asylumCase); + when(caseDetails.getCreatedDate()).thenReturn(createdDate); + when(asylumCase.read(LEGAL_REP_NAME, String.class)).thenReturn(Optional.of(legalRepFirstName)); + when(asylumCase.read(LEGAL_REP_FAMILY_NAME, String.class)).thenReturn(Optional.of(legalRepFamilyName)); + + Map templateFieldValues = appealSubmissionTemplate.mapFieldValues(caseDetails); + + assertEquals(legalRepFirstName + " " + legalRepFamilyName, templateFieldValues.get("legalRepName")); + } + @Test void should_not_add_appeal_type_if_not_present() { diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateProviderTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateProviderTest.java index 3f9196d6b..d23f41a0d 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateProviderTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateProviderTest.java @@ -133,7 +133,7 @@ public class BailSubmissionTemplateProviderTest { Arrays.asList( new IdValue<>("1", new InterpreterLanguage("Arabic", "NA")) ); - + private Map fieldValuesMap; @BeforeEach @@ -860,4 +860,3 @@ private void supporter4DataSetUp() { when(bailCase.read(FINANCIAL_AMOUNT_SUPPORTER_4_UNDERTAKES_1, String.class)).thenReturn(Optional.of(financialAmountSupporterUndertakes1)); } } - diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateTest.java index 18d49b8ff..7bfffc57a 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/BailSubmissionTemplateTest.java @@ -46,4 +46,3 @@ public void should_map_case_data_to_template_field_values() { verify(bailSubmissionTemplateProvider, times(1)).mapFieldValues(caseDetails); } } - diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/CmaAppointmentNoticeTemplateTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/CmaAppointmentNoticeTemplateTest.java index e0042d095..e6759f7b5 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/CmaAppointmentNoticeTemplateTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/CmaAppointmentNoticeTemplateTest.java @@ -64,6 +64,8 @@ public class CmaAppointmentNoticeTemplateTest { private String directionExplanation = "an explanation"; + private YesOrNo isIntegrated = YesOrNo.NO; + private CmaAppointmentNoticeTemplate cmaAppointmentNoticeTemplate; @BeforeEach @@ -126,6 +128,7 @@ public void should_throw_exception_when_direction_is_not_present() { when(asylumCase.read(SINGLE_SEX_COURT_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(singleSexCourtTribunalResponse)); when(asylumCase.read(ADDITIONAL_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(otherHearingRequestTribunalResponse)); when(asylumCase.read(ARIA_LISTING_REFERENCE, String.class)).thenReturn(Optional.of(ariaListingReference)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); when((customerServicesProvider.getCustomerServicesTelephone())).thenReturn(customerServicesTelephone); when((customerServicesProvider.getCustomerServicesEmail())).thenReturn(customerServicesEmail); @@ -164,6 +167,7 @@ public void should_map_case_data_to_template_field_values() { when(asylumCase.read(ADDITIONAL_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(otherHearingRequestTribunalResponse)); when(asylumCase.read(PAST_EXPERIENCES_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(pastExperienceTribunalResponse)); when(asylumCase.read(ARIA_LISTING_REFERENCE, String.class)).thenReturn(Optional.of(ariaListingReference)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); when((customerServicesProvider.getCustomerServicesTelephone())).thenReturn(customerServicesTelephone); when((customerServicesProvider.getCustomerServicesEmail())).thenReturn(customerServicesEmail); @@ -173,10 +177,11 @@ public void should_map_case_data_to_template_field_values() { when(directionFinder.findFirst(asylumCase, DirectionTag.REQUEST_CMA_REQUIREMENTS)).thenReturn(Optional.of(direction)); when((hearingDetailsFinder.getHearingCentreUrl(MANCHESTER))).thenReturn(hearingCentreUrl); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.of(isIntegrated)); Map templateFieldValues = cmaAppointmentNoticeTemplate.mapFieldValues(caseDetails); - assertEquals(23, templateFieldValues.size()); + assertEquals(24, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(appealReferenceNumber, templateFieldValues.get("appealReferenceNumber")); assertEquals(appellantGivenNames, templateFieldValues.get("appellantGivenNames")); @@ -196,6 +201,7 @@ public void should_map_case_data_to_template_field_values() { assertEquals(directionExplanation, templateFieldValues.get("reasonForAppointment")); assertEquals(MANCHESTER.toString(), templateFieldValues.get("hearingCentreName")); assertEquals(hearingCentreUrl, templateFieldValues.get("hearingCentreUrl")); + assertEquals(isIntegrated, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } @@ -249,11 +255,13 @@ public void should_be_tolerant_of_missing_data() { when(asylumCase.read(ADDITIONAL_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(PAST_EXPERIENCES_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(ARIA_LISTING_REFERENCE, String.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.empty()); Map templateFieldValues = cmaAppointmentNoticeTemplate.mapFieldValues(caseDetails); - assertEquals(23, templateFieldValues.size()); + assertEquals(24, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals("", templateFieldValues.get("appealReferenceNumber")); assertEquals("", templateFieldValues.get("appellantGivenNames")); @@ -275,6 +283,7 @@ public void should_be_tolerant_of_missing_data() { assertEquals(directionExplanation, templateFieldValues.get("reasonForAppointment")); assertEquals(frontendUrl, templateFieldValues.get("aipFrontendUrl")); assertEquals(hearingCentreUrl, templateFieldValues.get("hearingCentreUrl")); + assertEquals(YesOrNo.NO, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeTemplateTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeTemplateTest.java index 9f8f6dc86..d649cc938 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeTemplateTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeTemplateTest.java @@ -46,6 +46,7 @@ public class HearingNoticeTemplateTest { private String expectedFormattedHearingTimePart = "1234"; private String expectedFormattedManchesterHearingCentreAddress = "Manchester\n123 Somewhere\nNorth"; private String ariaListingReference = "AA/12345/1234"; + private YesOrNo isIntegrated = YesOrNo.NO; private String customerServicesTelephone = "555 555 555"; private String customerServicesEmail = "customer.services@example.com"; @@ -94,10 +95,12 @@ public void should_map_case_data_to_template_field_values() { when(asylumCase.read(IN_CAMERA_COURT_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(inCamera)); when(asylumCase.read(ADDITIONAL_TRIBUNAL_RESPONSE, String.class)).thenReturn(Optional.of(otherHearingRequest)); when(asylumCase.read(ARIA_LISTING_REFERENCE, String.class)).thenReturn(Optional.of(ariaListingReference)); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.of(isIntegrated)); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); - assertEquals(17, templateFieldValues.size()); + assertEquals(18, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(appealReferenceNumber, templateFieldValues.get("appealReferenceNumber")); assertEquals(appellantGivenNames, templateFieldValues.get("appellantGivenNames")); @@ -113,6 +116,7 @@ public void should_map_case_data_to_template_field_values() { assertEquals(inCamera, templateFieldValues.get("inCamera")); assertEquals(otherHearingRequest, templateFieldValues.get("otherHearingRequest")); assertEquals(ariaListingReference, templateFieldValues.get("ariaListingReference")); + assertEquals(isIntegrated, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } @@ -149,10 +153,12 @@ public void should_be_tolerant_of_missing_data() { when(asylumCase.read(LIST_CASE_REQUIREMENTS_IN_CAMERA_COURT, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(LIST_CASE_REQUIREMENTS_OTHER, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(ARIA_LISTING_REFERENCE, String.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.empty()); Map templateFieldValues = hearingNoticeTemplate.mapFieldValues(caseDetails); - assertEquals(17, templateFieldValues.size()); + assertEquals(18, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals("", templateFieldValues.get("appealReferenceNumber")); assertEquals("", templateFieldValues.get("appellantGivenNames")); @@ -168,6 +174,7 @@ public void should_be_tolerant_of_missing_data() { assertEquals("The hearing will be held in public court", templateFieldValues.get("inCamera")); assertEquals("No other adjustments are being made", templateFieldValues.get("otherHearingRequest")); assertEquals("", templateFieldValues.get("ariaListingReference")); + assertEquals(YesOrNo.NO, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeUpdatedTemplateProviderTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeUpdatedTemplateProviderTest.java index 8052cf70f..75718c8f4 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeUpdatedTemplateProviderTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingNoticeUpdatedTemplateProviderTest.java @@ -63,6 +63,7 @@ class HearingNoticeUpdatedTemplateProviderTest { private String expectedFormattedBirminghamHearingCentreName = "Birmingham"; private String expectedFormattedHattonCrossHearingCentreName = "Hatton Cross"; private String expectedFormattedGlasgowHearingCentreName = "Glasgow"; + private YesOrNo isIntegrated = YesOrNo.NO; private String customerServicesTelephone = "555 555 555"; private String customerServicesEmail = "customer.services@example.com"; @@ -77,6 +78,7 @@ public void setUp() { stringProvider, customerServicesProvider ); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); } @Test @@ -103,6 +105,7 @@ void should_map_case_data_to_template_field_values() { when(asylumCase.read(LIST_CASE_REQUIREMENTS_IN_CAMERA_COURT, String.class)).thenReturn(Optional.of(inCamera)); when(asylumCase.read(LIST_CASE_REQUIREMENTS_OTHER, String.class)).thenReturn(Optional.of(otherHearingRequest)); when(asylumCase.read(ARIA_LISTING_REFERENCE, String.class)).thenReturn(Optional.of(ariaListingReference)); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.of(isIntegrated)); when(asylumCaseBefore.read(LIST_CASE_HEARING_DATE, String.class)).thenReturn(Optional.of(hearingDateBefore)); when(asylumCaseBefore.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(HearingCentre.TAYLOR_HOUSE)); @@ -113,7 +116,7 @@ void should_map_case_data_to_template_field_values() { Map templateFieldValues = hearingNoticeUpdatedTemplateProvider.mapFieldValues(caseDetails, caseDetailsBefore); - assertEquals(19, templateFieldValues.size()); + assertEquals(20, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(expectedFormattedTaylorHouseHearingCentreName, templateFieldValues.get("oldHearingCentre")); assertEquals(expectedFormattedHearingDatePartBefore, templateFieldValues.get("oldHearingDate")); @@ -131,6 +134,7 @@ void should_map_case_data_to_template_field_values() { assertEquals(inCamera, templateFieldValues.get("inCamera")); assertEquals(otherHearingRequest, templateFieldValues.get("otherHearingRequest")); assertEquals(ariaListingReference, templateFieldValues.get("ariaListingReference")); + assertEquals(isIntegrated, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } @@ -569,11 +573,13 @@ void should_be_tolerant_of_missing_data() { when(asylumCase.read(LIST_CASE_REQUIREMENTS_IN_CAMERA_COURT, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(LIST_CASE_REQUIREMENTS_OTHER, String.class)).thenReturn(Optional.empty()); when(asylumCase.read(ARIA_LISTING_REFERENCE, String.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_INTEGRATED, YesOrNo.class)).thenReturn(Optional.empty()); when(asylumCaseBefore.read(LIST_CASE_HEARING_DATE, String.class)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_CASE_USING_LOCATION_REF_DATA, YesOrNo.class)).thenReturn(Optional.empty()); Map templateFieldValues = hearingNoticeUpdatedTemplateProvider.mapFieldValues(caseDetails, caseDetailsBefore); - assertEquals(19, templateFieldValues.size()); + assertEquals(20, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(expectedFormattedTaylorHouseHearingCentreName, templateFieldValues.get("oldHearingCentre")); assertEquals("", templateFieldValues.get("oldHearingDate")); @@ -591,6 +597,7 @@ void should_be_tolerant_of_missing_data() { assertEquals("The hearing will be held in public court", templateFieldValues.get("inCamera")); assertEquals("No other adjustments are being made", templateFieldValues.get("otherHearingRequest")); assertEquals("", templateFieldValues.get("ariaListingReference")); + assertEquals(YesOrNo.NO, templateFieldValues.get("isIntegrated")); assertEquals(customerServicesTelephone, customerServicesProvider.getCustomerServicesTelephone()); assertEquals(customerServicesEmail, customerServicesProvider.getCustomerServicesEmail()); } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplateTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplateTest.java index c513ff3d1..1c7c1e620 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplateTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/HearingRequirementsTemplateTest.java @@ -11,9 +11,11 @@ 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.mockito.junit.jupiter.MockitoExtension; -import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCase; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.*; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.CaseDetails; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.*; @@ -22,6 +24,8 @@ @SuppressWarnings("unchecked") class HearingRequirementsTemplateTest { + private static InterpreterLanguageRefData APPELLANT_SPOKEN_INTERPRETER_LANGUAGE = new InterpreterLanguageRefData(); + private static InterpreterLanguageRefData APPELLANT_SPOKEN_INTERPRETER_LANGUAGE_MANUAL = new InterpreterLanguageRefData(); private final String templateName = "HEARING_REQUIREMENTS_TEMPLATE.docx"; @Mock private CaseDetails caseDetails; @@ -43,6 +47,14 @@ class HearingRequirementsTemplateTest { private InterpreterLanguage interpreter1 = new InterpreterLanguage(); private InterpreterLanguage interpreter2 = new InterpreterLanguage(); + private YesOrNo isAnyWitnessInterpreterRequired = YesOrNo.YES; + private InterpreterLanguageRefData appellantSignInterpreterLanguage = new InterpreterLanguageRefData(); + private InterpreterLanguageRefData witness1SpokenInterpreterLanguage = new InterpreterLanguageRefData(); + private InterpreterLanguageRefData witness1SignInterpreterLanguage = new InterpreterLanguageRefData(); + private InterpreterLanguageRefData witness2SpokenInterpreterLanguage = new InterpreterLanguageRefData(); + private InterpreterLanguageRefData witness2SignInterpreterLanguage = new InterpreterLanguageRefData(); + private List witnessInterpreterLanguageInformationList = new ArrayList(); + private YesOrNo isHearingRoomNeeded = YesOrNo.YES; private YesOrNo isHearingLoopNeeded = YesOrNo.YES; @@ -87,6 +99,7 @@ public void setUp() { ); witness1.setWitnessName("Some Witness"); + witness1.setWitnessFamilyName("Some Witness Family"); witness2.setWitnessName("Another Witness"); witnessDetails = @@ -105,6 +118,21 @@ public void setUp() { new IdValue<>("222", interpreter2) ); + APPELLANT_SPOKEN_INTERPRETER_LANGUAGE.setLanguageRefData(new DynamicList("lang")); + APPELLANT_SPOKEN_INTERPRETER_LANGUAGE_MANUAL.setLanguageManualEntry(List.of("Yes")); + APPELLANT_SPOKEN_INTERPRETER_LANGUAGE_MANUAL.setLanguageManualEntryDescription("lang"); + appellantSignInterpreterLanguage.setLanguageRefData(new DynamicList("lang")); + witness1SpokenInterpreterLanguage.setLanguageRefData(new DynamicList("lang")); + witness1SignInterpreterLanguage.setLanguageRefData(new DynamicList("lang")); + witness2SpokenInterpreterLanguage.setLanguageRefData(new DynamicList("lang")); + witness2SignInterpreterLanguage.setLanguageRefData(new DynamicList("lang")); + witnessInterpreterLanguageInformationList.add( + new WitnessInterpreterLanguageInformation(witness1.buildWitnessFullName(), + "Spoken language Interpreter: lang\nSign language Interpreter: lang\n")); + witnessInterpreterLanguageInformationList.add( + new WitnessInterpreterLanguageInformation(witness2.buildWitnessFullName(), + "Spoken language Interpreter: lang\nSign language Interpreter: lang\n")); + datesToAvoid1.setDateToAvoid(LocalDate.parse("2019-12-25")); datesToAvoid2.setDateToAvoid(LocalDate.parse("2020-01-01")); datesToAvoid1.setDateToAvoidReason("Christmas"); @@ -123,8 +151,13 @@ void should_return_template_name() { assertEquals(templateName, hearingRequirementsTemplate.getName()); } - @Test - void should_map_case_data_to_template_field_values_for_in_country_appeal() { + static List refDataOrManualSpokenInterpreterLanguageField() { + return List.of(APPELLANT_SPOKEN_INTERPRETER_LANGUAGE, APPELLANT_SPOKEN_INTERPRETER_LANGUAGE_MANUAL); + } + + @ParameterizedTest + @MethodSource("refDataOrManualSpokenInterpreterLanguageField") + void should_map_case_data_to_template_field_values_for_in_country_appeal(InterpreterLanguageRefData appellantSpokenInterpreterLanguage) { when(caseDetails.getCaseData()).thenReturn(asylumCase); @@ -145,6 +178,14 @@ void should_map_case_data_to_template_field_values_for_in_country_appeal() { when(asylumCase.read(IS_INTERPRETER_SERVICES_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isInterpreterServicesNeeded)); when(asylumCase.read(INTERPRETER_LANGUAGE)).thenReturn(Optional.of(interpreterLanguage)); + when(asylumCase.read(IS_ANY_WITNESS_INTERPRETER_REQUIRED, YesOrNo.class)).thenReturn(Optional.of(isAnyWitnessInterpreterRequired)); + when(asylumCase.read(APPELLANT_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(appellantSpokenInterpreterLanguage)); + when(asylumCase.read(APPELLANT_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(appellantSignInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SignInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SignInterpreterLanguage)); + when(asylumCase.read(IS_HEARING_ROOM_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingRoomNeeded)); when(asylumCase.read(IS_HEARING_LOOP_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingLoopNeeded)); @@ -176,7 +217,8 @@ void should_map_case_data_to_template_field_values_for_in_country_appeal() { Map templateFieldValues = hearingRequirementsTemplate.mapFieldValues(caseDetails); - assertEquals(36, templateFieldValues.size()); + assertEquals(39, templateFieldValues.size()); + assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(appealReferenceNumber, templateFieldValues.get("appealReferenceNumber")); assertEquals(legalRepReferenceNumber, templateFieldValues.get("legalRepReferenceNumber")); @@ -190,7 +232,7 @@ void should_map_case_data_to_template_field_values_for_in_country_appeal() { assertEquals(isWitnessesAttending, templateFieldValues.get("isWitnessesAttending")); assertEquals(YesOrNo.NO, templateFieldValues.get("isEvidenceFromOutsideUkInCountry")); assertEquals(2, ((List) templateFieldValues.get("witnessDetails")).size()); - assertEquals(ImmutableMap.of("witnessDetails", "Some Witness"), ((List) templateFieldValues.get("witnessDetails")).get(0)); + assertEquals(ImmutableMap.of("witnessDetails", "Some Witness Some Witness Family"), ((List) templateFieldValues.get("witnessDetails")).get(0)); assertEquals(ImmutableMap.of("witnessDetails", "Another Witness"), ((List) templateFieldValues.get("witnessDetails")).get(1)); assertEquals(isInterpreterServicesNeeded, templateFieldValues.get("isInterpreterServicesNeeded")); assertEquals(2, ((List) templateFieldValues.get("language")).size()); @@ -199,6 +241,17 @@ void should_map_case_data_to_template_field_values_for_in_country_appeal() { assertEquals(2, ((List) templateFieldValues.get("languageDialect")).size()); assertEquals(ImmutableMap.of("languageDialect", "Dialect A"), ((List) templateFieldValues.get("languageDialect")).get(0)); assertEquals(ImmutableMap.of("languageDialect", "Dialect B"), ((List) templateFieldValues.get("languageDialect")).get(1)); + assertEquals(isAnyWitnessInterpreterRequired, templateFieldValues.get("isAnyWitnessInterpreterRequired")); + assertEquals("Spoken language Interpreter: lang\nSign language Interpreter: lang\n", templateFieldValues.get("appellantInterpreterLanguage")); + assertEquals(2, ((List) templateFieldValues.get("witnessInterpreterInformationList")).size()); + assertEquals(witnessInterpreterLanguageInformationList.get(0).getWitnessName(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(0)).getWitnessName()); + assertEquals(witnessInterpreterLanguageInformationList.get(0).getInterpreterLanguage(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(0)).getInterpreterLanguage()); + assertEquals(witnessInterpreterLanguageInformationList.get(1).getWitnessName(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(1)).getWitnessName()); + assertEquals(witnessInterpreterLanguageInformationList.get(1).getInterpreterLanguage(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(1)).getInterpreterLanguage()); assertEquals(isHearingRoomNeeded, templateFieldValues.get("isHearingRoomNeeded")); assertEquals(isHearingLoopNeeded, templateFieldValues.get("isHearingLoopNeeded")); assertEquals(remoteVideoCall, templateFieldValues.get("remoteVideoCall")); @@ -247,6 +300,14 @@ public void should_map_case_data_to_template_field_values_for_out_of_country_app when(asylumCase.read(IS_INTERPRETER_SERVICES_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isInterpreterServicesNeeded)); when(asylumCase.read(INTERPRETER_LANGUAGE)).thenReturn(Optional.of(interpreterLanguage)); + when(asylumCase.read(IS_ANY_WITNESS_INTERPRETER_REQUIRED, YesOrNo.class)).thenReturn(Optional.of(isAnyWitnessInterpreterRequired)); + when(asylumCase.read(APPELLANT_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(APPELLANT_SPOKEN_INTERPRETER_LANGUAGE)); + when(asylumCase.read(APPELLANT_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(appellantSignInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SignInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SignInterpreterLanguage)); + when(asylumCase.read(IS_HEARING_ROOM_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingRoomNeeded)); when(asylumCase.read(IS_HEARING_LOOP_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingLoopNeeded)); @@ -278,7 +339,8 @@ public void should_map_case_data_to_template_field_values_for_out_of_country_app Map templateFieldValues = hearingRequirementsTemplate.mapFieldValues(caseDetails); - assertEquals(36, templateFieldValues.size()); + assertEquals(39, templateFieldValues.size()); + assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(appealReferenceNumber, templateFieldValues.get("appealReferenceNumber")); assertEquals(legalRepReferenceNumber, templateFieldValues.get("legalRepReferenceNumber")); @@ -291,7 +353,7 @@ public void should_map_case_data_to_template_field_values_for_out_of_country_app assertEquals(isAppellantGivingOralEvidence, templateFieldValues.get("isAppellantGivingOralEvidence")); assertEquals(isWitnessesAttending, templateFieldValues.get("isWitnessesAttending")); assertEquals(2, ((List) templateFieldValues.get("witnessDetails")).size()); - assertEquals(ImmutableMap.of("witnessDetails", "Some Witness"), ((List) templateFieldValues.get("witnessDetails")).get(0)); + assertEquals(ImmutableMap.of("witnessDetails", "Some Witness Some Witness Family"), ((List) templateFieldValues.get("witnessDetails")).get(0)); assertEquals(ImmutableMap.of("witnessDetails", "Another Witness"), ((List) templateFieldValues.get("witnessDetails")).get(1)); assertEquals(YesOrNo.NO, templateFieldValues.get("isEvidenceFromOutsideUkInCountry")); assertEquals(isInterpreterServicesNeeded, templateFieldValues.get("isInterpreterServicesNeeded")); @@ -301,6 +363,17 @@ public void should_map_case_data_to_template_field_values_for_out_of_country_app assertEquals(2, ((List) templateFieldValues.get("languageDialect")).size()); assertEquals(ImmutableMap.of("languageDialect", "Dialect A"), ((List) templateFieldValues.get("languageDialect")).get(0)); assertEquals(ImmutableMap.of("languageDialect", "Dialect B"), ((List) templateFieldValues.get("languageDialect")).get(1)); + assertEquals(isAnyWitnessInterpreterRequired, templateFieldValues.get("isAnyWitnessInterpreterRequired")); + assertEquals("Spoken language Interpreter: lang\nSign language Interpreter: lang\n", templateFieldValues.get("appellantInterpreterLanguage")); + assertEquals(2, ((List) templateFieldValues.get("witnessInterpreterInformationList")).size()); + assertEquals(witnessInterpreterLanguageInformationList.get(0).getWitnessName(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(0)).getWitnessName()); + assertEquals(witnessInterpreterLanguageInformationList.get(0).getInterpreterLanguage(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(0)).getInterpreterLanguage()); + assertEquals(witnessInterpreterLanguageInformationList.get(1).getWitnessName(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(1)).getWitnessName()); + assertEquals(witnessInterpreterLanguageInformationList.get(1).getInterpreterLanguage(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(1)).getInterpreterLanguage()); assertEquals(isHearingRoomNeeded, templateFieldValues.get("isHearingRoomNeeded")); assertEquals(isHearingLoopNeeded, templateFieldValues.get("isHearingLoopNeeded")); assertEquals(remoteVideoCall, templateFieldValues.get("remoteVideoCall")); @@ -330,7 +403,8 @@ public void should_map_case_data_to_template_field_values_for_out_of_country_app templateFieldValues = hearingRequirementsTemplate.mapFieldValues(caseDetails); - assertEquals(36, templateFieldValues.size()); + assertEquals(39, templateFieldValues.size()); + assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals(appealReferenceNumber, templateFieldValues.get("appealReferenceNumber")); assertEquals(legalRepReferenceNumber, templateFieldValues.get("legalRepReferenceNumber")); @@ -341,7 +415,7 @@ public void should_map_case_data_to_template_field_values_for_out_of_country_app assertEquals(isAppellantGivingOralEvidence, templateFieldValues.get("isAppellantGivingOralEvidence")); assertEquals(isWitnessesAttending, templateFieldValues.get("isWitnessesAttending")); assertEquals(2, ((List) templateFieldValues.get("witnessDetails")).size()); - assertEquals(ImmutableMap.of("witnessDetails", "Some Witness"), ((List) templateFieldValues.get("witnessDetails")).get(0)); + assertEquals(ImmutableMap.of("witnessDetails", "Some Witness Some Witness Family"), ((List) templateFieldValues.get("witnessDetails")).get(0)); assertEquals(ImmutableMap.of("witnessDetails", "Another Witness"), ((List) templateFieldValues.get("witnessDetails")).get(1)); assertEquals(isInterpreterServicesNeeded, templateFieldValues.get("isInterpreterServicesNeeded")); assertEquals(2, ((List) templateFieldValues.get("language")).size()); @@ -350,6 +424,17 @@ public void should_map_case_data_to_template_field_values_for_out_of_country_app assertEquals(2, ((List) templateFieldValues.get("languageDialect")).size()); assertEquals(ImmutableMap.of("languageDialect", "Dialect A"), ((List) templateFieldValues.get("languageDialect")).get(0)); assertEquals(ImmutableMap.of("languageDialect", "Dialect B"), ((List) templateFieldValues.get("languageDialect")).get(1)); + assertEquals(isAnyWitnessInterpreterRequired, templateFieldValues.get("isAnyWitnessInterpreterRequired")); + assertEquals("Spoken language Interpreter: lang\nSign language Interpreter: lang\n", templateFieldValues.get("appellantInterpreterLanguage")); + assertEquals(2, ((List) templateFieldValues.get("witnessInterpreterInformationList")).size()); + assertEquals(witnessInterpreterLanguageInformationList.get(0).getWitnessName(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(0)).getWitnessName()); + assertEquals(witnessInterpreterLanguageInformationList.get(0).getInterpreterLanguage(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(0)).getInterpreterLanguage()); + assertEquals(witnessInterpreterLanguageInformationList.get(1).getWitnessName(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(1)).getWitnessName()); + assertEquals(witnessInterpreterLanguageInformationList.get(1).getInterpreterLanguage(), + ((WitnessInterpreterLanguageInformation)((List) templateFieldValues.get("witnessInterpreterInformationList")).get(1)).getInterpreterLanguage()); assertEquals(isHearingRoomNeeded, templateFieldValues.get("isHearingRoomNeeded")); assertEquals(isHearingLoopNeeded, templateFieldValues.get("isHearingLoopNeeded")); assertEquals(YesOrNo.NO, templateFieldValues.get("remoteVideoCall")); @@ -398,6 +483,14 @@ void should_map_case_data_to_template_field_values_no_dates_to_avoid_flag() { when(asylumCase.read(IS_INTERPRETER_SERVICES_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isInterpreterServicesNeeded)); when(asylumCase.read(INTERPRETER_LANGUAGE)).thenReturn(Optional.of(interpreterLanguage)); + when(asylumCase.read(IS_ANY_WITNESS_INTERPRETER_REQUIRED, YesOrNo.class)).thenReturn(Optional.of(isAnyWitnessInterpreterRequired)); + when(asylumCase.read(APPELLANT_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(APPELLANT_SPOKEN_INTERPRETER_LANGUAGE)); + when(asylumCase.read(APPELLANT_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(appellantSignInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SignInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SignInterpreterLanguage)); + when(asylumCase.read(IS_HEARING_ROOM_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingRoomNeeded)); when(asylumCase.read(IS_HEARING_LOOP_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingLoopNeeded)); @@ -460,6 +553,9 @@ void should_be_tolerant_of_missing_data() { when(asylumCase.read(WITNESS_DETAILS)).thenReturn(Optional.empty()); when(asylumCase.read(IS_INTERPRETER_SERVICES_NEEDED, YesOrNo.class)).thenReturn(Optional.empty()); when(asylumCase.read(INTERPRETER_LANGUAGE)).thenReturn(Optional.empty()); + when(asylumCase.read(IS_ANY_WITNESS_INTERPRETER_REQUIRED, YesOrNo.class)).thenReturn(Optional.empty()); + when(asylumCase.read(APPELLANT_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.empty()); + when(asylumCase.read(APPELLANT_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.empty()); when(asylumCase.read(IS_HEARING_ROOM_NEEDED, YesOrNo.class)).thenReturn(Optional.empty()); when(asylumCase.read(IS_HEARING_LOOP_NEEDED, YesOrNo.class)).thenReturn(Optional.empty()); when(asylumCase.read(PHYSICAL_OR_MENTAL_HEALTH_ISSUES, YesOrNo.class)).thenReturn(Optional.empty()); @@ -482,7 +578,7 @@ void should_be_tolerant_of_missing_data() { Map templateFieldValues = hearingRequirementsTemplate.mapFieldValues(caseDetails); - assertEquals(36, templateFieldValues.size()); + assertEquals(39, templateFieldValues.size()); assertEquals("[userImage:hmcts.png]", templateFieldValues.get("hmcts")); assertEquals("", templateFieldValues.get("appealReferenceNumber")); @@ -503,6 +599,8 @@ void should_be_tolerant_of_missing_data() { assertEquals(YesOrNo.NO, templateFieldValues.get("isInterpreterServicesNeeded")); assertEquals(0, ((List) templateFieldValues.get("language")).size()); assertEquals(0, ((List) templateFieldValues.get("languageDialect")).size()); + assertEquals("", templateFieldValues.get("appellantInterpreterLanguage")); + assertEquals(0, ((List) templateFieldValues.get("witnessInterpreterInformationList")).size()); assertEquals(YesOrNo.NO, templateFieldValues.get("isHearingRoomNeeded")); assertEquals(YesOrNo.NO, templateFieldValues.get("isHearingLoopNeeded")); assertEquals(YesOrNo.NO, templateFieldValues.get("physicalOrMentalHealthIssues")); @@ -546,6 +644,14 @@ void should_default_date_to_avoid_reason_null_values_to_empty_string() { when(asylumCase.read(IS_INTERPRETER_SERVICES_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isInterpreterServicesNeeded)); when(asylumCase.read(INTERPRETER_LANGUAGE)).thenReturn(Optional.of(interpreterLanguage)); + when(asylumCase.read(IS_ANY_WITNESS_INTERPRETER_REQUIRED, YesOrNo.class)).thenReturn(Optional.of(isAnyWitnessInterpreterRequired)); + when(asylumCase.read(APPELLANT_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(APPELLANT_SPOKEN_INTERPRETER_LANGUAGE)); + when(asylumCase.read(APPELLANT_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(appellantSignInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SignInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SignInterpreterLanguage)); + when(asylumCase.read(IS_HEARING_ROOM_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingRoomNeeded)); when(asylumCase.read(IS_HEARING_LOOP_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingLoopNeeded)); @@ -622,6 +728,14 @@ void should_default_date_to_avoid_null_values_to_past_date() { when(asylumCase.read(IS_INTERPRETER_SERVICES_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isInterpreterServicesNeeded)); when(asylumCase.read(INTERPRETER_LANGUAGE)).thenReturn(Optional.of(interpreterLanguage)); + when(asylumCase.read(IS_ANY_WITNESS_INTERPRETER_REQUIRED, YesOrNo.class)).thenReturn(Optional.of(isAnyWitnessInterpreterRequired)); + when(asylumCase.read(APPELLANT_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(APPELLANT_SPOKEN_INTERPRETER_LANGUAGE)); + when(asylumCase.read(APPELLANT_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(appellantSignInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_1_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness1SignInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SPOKEN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SpokenInterpreterLanguage)); + when(asylumCase.read(WITNESS_2_INTERPRETER_SIGN_LANGUAGE, InterpreterLanguageRefData.class)).thenReturn(Optional.of(witness2SignInterpreterLanguage)); + when(asylumCase.read(IS_HEARING_ROOM_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingRoomNeeded)); when(asylumCase.read(IS_HEARING_LOOP_NEEDED, YesOrNo.class)).thenReturn(Optional.of(isHearingLoopNeeded)); diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplateTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplateTest.java index f24ea4c28..1777e7e8f 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplateTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingInitialListingTemplateTest.java @@ -10,9 +10,12 @@ import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.BAIL_REFERENCE_NUMBER; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.HOME_OFFICE_REFERENCE_NUMBER; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IRC_NAME; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IS_REMOTE_HEARING; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LEGAL_REP_REFERENCE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LISTING_HEARING_DATE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LISTING_LOCATION; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.REF_DATA_LISTING_LOCATION_DETAIL; import java.util.Map; import java.util.Optional; @@ -25,8 +28,10 @@ import org.mockito.quality.Strictness; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCase; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.CaseDetails; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.YesOrNo; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.StringProvider; import uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.CustomerServicesProvider; +import uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.clients.model.refdata.CourtVenue; @MockitoSettings(strictness = Strictness.LENIENT) @ExtendWith(MockitoExtension.class) @@ -45,7 +50,7 @@ class BailNoticeOfHearingInitialListingTemplateTest { private final String customerServicesEmail = "customer@services.com"; private final String customerServicesPhone = "111122223333"; final String legalRepReference = "legalRepReference"; - + private CourtVenue hattonCross; private final String initialListingTemplateName = "TB-IAC-HNO-ENG-Bails-Notice-of-Hearing.docx"; private BailNoticeOfHearingInitialListingTemplate template; @@ -56,6 +61,14 @@ public void setUp() { template = new BailNoticeOfHearingInitialListingTemplate( initialListingTemplateName, customerServicesProvider, stringProvider); + hattonCross = new CourtVenue("Hatton Cross Tribunal Hearing Centre", + "Hatton Cross Tribunal Hearing Centre", + "386417", + "Open", + "Y", + "Y", + "York House And Wellington House, 2-3 Dukes Green, Feltham, Middlesex", + "TW14 0LS"); } @Test @@ -137,4 +150,41 @@ void dataSetUp() { when(bailCase.read(IRC_NAME, String.class)).thenReturn(Optional.of("Dungavel")); } + @Test + void should_get_listing_location_address_from_ref_data_with_enabled_ref_data_feature() { + dataSetUp(); + when(bailCase.read(IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(bailCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + when(bailCase.read(REF_DATA_LISTING_LOCATION_DETAIL, CourtVenue.class)) + .thenReturn(Optional.of(hattonCross)); + + fieldValuesMap = template.mapFieldValues(caseDetails); + + assertEquals("Hatton Cross Tribunal Hearing Centre, " + + "York House And Wellington House, 2-3 Dukes Green, Feltham, Middlesex, " + + "TW14 0LS", fieldValuesMap.get("hearingCentreAddress")); + } + + @Test + void should_get_remote_hearing_address_with_enabled_ref_data_feature() { + dataSetUp(); + when(bailCase.read(IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(bailCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + + fieldValuesMap = template.mapFieldValues(caseDetails); + + assertEquals("Cloud Video Platform (CVP)", + fieldValuesMap.get("hearingCentreAddress")); + } + + @Test + void should_get_listing_location_address_from_ccd_with_disabled_ref_data_feature() { + dataSetUp(); + when(bailCase.read(IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + + fieldValuesMap = template.mapFieldValues(caseDetails); + + assertEquals("Nottingham Justice Centre\nCarrington Street\nNottingham\nNG2 1EE", + fieldValuesMap.get("hearingCentreAddress")); + } } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplateTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplateTest.java index 94641f0de..c4480b281 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplateTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/domain/templates/bail/BailNoticeOfHearingRelistingTemplateTest.java @@ -9,10 +9,13 @@ import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.APPLICANT_PRISON_DETAILS; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.BAIL_REFERENCE_NUMBER; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.HOME_OFFICE_REFERENCE_NUMBER; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.IS_REMOTE_HEARING; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LEGAL_REP_REFERENCE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LISTING_HEARING_DATE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.LISTING_LOCATION; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.PRISON_NAME; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCaseFieldDefinition.REF_DATA_LISTING_LOCATION_DETAIL; import java.util.Map; import java.util.Optional; @@ -25,8 +28,10 @@ import org.mockito.quality.Strictness; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.BailCase; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.CaseDetails; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.YesOrNo; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.StringProvider; import uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.CustomerServicesProvider; +import uk.gov.hmcts.reform.iacasedocumentsapi.infrastructure.clients.model.refdata.CourtVenue; @MockitoSettings(strictness = Strictness.LENIENT) @ExtendWith(MockitoExtension.class) @@ -48,6 +53,8 @@ class BailNoticeOfHearingRelistingTemplateTest { private final String relistingTemplateName = "TB-IAC-HNO-ENG-bails-notice-of-hearings-relisted.docx"; + private CourtVenue newCastle; + private BailNoticeOfHearingRelistingTemplate template; private Map fieldValuesMap; @@ -56,6 +63,16 @@ public void setUp() { template = new BailNoticeOfHearingRelistingTemplate( relistingTemplateName, customerServicesProvider, stringProvider); + + newCastle = new CourtVenue("Newcastle Civil & Family Courts and Tribunals Centre", + "Newcastle Civil And Family Courts And Tribunals Centre", + "366796", + "Open", + "Y", + "Y", + "Barras Bridge, Newcastle-Upon-Tyne", + "NE1 8QF"); + } @Test @@ -138,4 +155,42 @@ void dataSetUp() { when(bailCase.read(PRISON_NAME, String.class)).thenReturn(Optional.of("Dungavel")); } + @Test + void should_get_listing_location_address_from_ccd_with_disabled_ref_data_feature() { + dataSetUp(); + when(bailCase.read(IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + + fieldValuesMap = template.mapFieldValues(caseDetails); + + assertEquals("Nottingham Justice Centre\nCarrington Street\nNottingham\nNG2 1EE", + fieldValuesMap.get("hearingCentreAddress")); + } + + @Test + void should_get_remote_hearing_address_with_enabled_ref_data_feature() { + dataSetUp(); + when(bailCase.read(IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(bailCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + + fieldValuesMap = template.mapFieldValues(caseDetails); + + assertEquals("Cloud Video Platform (CVP)", + fieldValuesMap.get("hearingCentreAddress")); + } + + @Test + void should_get_listing_location_address_from_ref_data_with_enabled_ref_data_feature() { + dataSetUp(); + when(bailCase.read(IS_BAILS_LOCATION_REFERENCE_DATA_ENABLED, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + when(bailCase.read(IS_REMOTE_HEARING, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.NO)); + when(bailCase.read(REF_DATA_LISTING_LOCATION_DETAIL, CourtVenue.class)) + .thenReturn(Optional.of(newCastle)); + + fieldValuesMap = template.mapFieldValues(caseDetails); + + assertEquals("Newcastle Civil And Family Courts And Tribunals Centre, " + + "Barras Bridge, Newcastle-Upon-Tyne, " + + "NE1 8QF", fieldValuesMap.get("hearingCentreAddress")); + } + } diff --git a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinderTest.java b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinderTest.java index 3e973c9aa..eb07b47d1 100644 --- a/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinderTest.java +++ b/src/test/java/uk/gov/hmcts/reform/iacasedocumentsapi/infrastructure/HearingDetailsFinderTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.when; +import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.IS_DECISION_WITHOUT_HEARING; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.LIST_CASE_HEARING_CENTRE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCaseDefinition.LIST_CASE_HEARING_DATE; import static uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.HearingCentre.*; @@ -17,6 +18,7 @@ import org.mockito.quality.Strictness; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.AsylumCase; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.HearingCentre; +import uk.gov.hmcts.reform.iacasedocumentsapi.domain.entities.ccd.field.YesOrNo; import uk.gov.hmcts.reform.iacasedocumentsapi.domain.service.StringProvider; @ExtendWith(MockitoExtension.class) @@ -73,6 +75,13 @@ public void should_return_given_hearing_centre_name() { assertEquals(hearingCentreName, hearingDetailsFinder.getHearingCentreName(asylumCase)); } + @Test + public void should_return_hearing_centre_name_for_decision_without_hearing_appeal() { + when(asylumCase.read(IS_DECISION_WITHOUT_HEARING, YesOrNo.class)).thenReturn(Optional.of(YesOrNo.YES)); + + assertEquals(HearingDetailsFinder.DECISION_WITHOUT_HEARING, hearingDetailsFinder.getHearingCentreName(asylumCase)); + } + @Test public void should_throw_exception_when_hearing_centre_name_is_empty() { when(asylumCase.read(LIST_CASE_HEARING_CENTRE, HearingCentre.class)).thenReturn(Optional.of(hearingCentre));