From 48b26353e3a85fcc61a67ed7d5345bdb1a33c2f0 Mon Sep 17 00:00:00 2001 From: Ashley Wong <50691452+so99y@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:48:33 +0000 Subject: [PATCH] DFPL-1682 Need to be able to select both a C1 with supplement application and a C110a application (#4995) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * DFPL-CFV FPL-CFV- Feature Branch (#4678) * simplified test cases * Capture uploaderCaseRoles when uploading new documents * Fixing JSON to use MultiSelectList instead of Collection * List to List * Revert "List to List" This reverts commit f45188ccb622b3850f85d368ce64372a23bc633f. * Fix test cases. * Use uploaderCaseRoles to determine the right of removing documents. * capture uploaderCaseRoles for the placement response case * Showing placementResponse to the dropdown list * Logic for removing placementNoticeDocument * Add revokeCaseAccess to TestingSupportController * Grant CU permission for judiciary to CaseSummary * Grant "U" access to judiciary * Add placement response option for admin * Grant U to magistrate * missing final modifier * test case for buildDocumentTypeDynamicListForRemoval * prevent NPE * more test cases for buildDocumentTypeDynamicListForRemoval * add test cases to increase code coverage. * simplified * More test cases for DocumentType. * test case for getFieldNameOfRemovedList * simplified test case * code tidy up * Make use of toList() * making use of toList() * test case for no document available * missing assertThat * add test cases on toJsonFieldName * revert * DFPL-1493 CFV - Further application documents (#4642) * Documents filed on issue and Threshold * Care plan * permission settings * migrate scripts for application documents * Migration case tests * migration script for mixed application documents * rollback script and its test case * MigrateCaseController for testing * remove an extra line * remove 1401 test case * hide documents from `applicationDocuments` * fixiing permission issues * deprecated applicationDocuments * DEPRECATED applicationDocuments * remove unused methods * remove unused test cases * checkstyle * Added swetList, socialWorkChronList, genogramList, checklistDocList, birthCertList and otherDocFiledList * update test cases * Fixing test cases * revert migratCaseController --------- Co-authored-by: Ashley Wong * Missing new fields for documents created on DFPL-1493 * Revert commented codes * Sara confirmed the placement responses are viewable by everyone. * Sara confirmed placementResponses are viewable by everyone. * missing permission for solicitors on some of the documents. * add test case for removeDocuments * more test cases * updated test cases * test cases for removing caseSummary * Test case for removing placementResponses * code smell. * Clean up - making use of anyMatch * Code cleanup * Code smell - making use of anyMatch * Unit tests for REMOVE_DOCUMENT action. * Add translation requirement option * Missing translationRequirements in PlacementResponse * add back constructors * Remove unnecessary file. * Revert "add revokeCaseAccess" This reverts commit 8aab026f5704bfac369800725330f092fa8b7a1f. * Consolidated migration scripts. * checkstyle * add a checking to prevent the migration being performed twice. * use remove instead * Grant superuser with CRUD for the purpose of rollback script * Remove property if the collection is an empty list. * Remove property if the collection is an empty list in rollback script. * Revoke R access from respondentStatements * Revoke R access from respondentStatements * Resolving code review conversation. * Rename the event name * Check NPE * Created MigratCFVService * Add test cases for the MigrateCaseController * Fix court bundle issue on migration * Deprecated courtBundleNC * Checkstyle * Updated due to deprecate courtBundleNC * Rename manage document to (OLD) Manage document * Fixed test cases * Squashed commit of the following: commit e1d682fbdd9b8fb3a62f5a1e3c76bd13df220c8c Merge: c820d5313 60ab8181d Author: Chak Shing, Lo Date: Mon Sep 4 15:09:17 2023 +0100 Merge remote-tracking branch 'origin/DFPL-1464' into DFPL-1609 commit c820d5313abb1dd855d60943f2992e65d5394d9a Author: Chak Shing, Lo Date: Wed Aug 30 18:34:31 2023 +0100 update cafcass noti mapping commit d0cd924d423711799379d7b4b7a7ebcfc7e24f3b Author: Chak Shing, Lo Date: Wed Aug 30 16:28:55 2023 +0100 fix code style check commit e6f87390d18ef7ff51eb31302b56afcc8c694074 Author: Chak Shing, Lo Date: Wed Aug 30 16:19:33 2023 +0100 remove temporary skip logic in unit test commit b1ab719f78e4f4229687481b5bcddb8092fb6c7d Author: Chak Shing, Lo Date: Wed Aug 30 16:16:22 2023 +0100 remove temporary skip logic commit 0395efc4e9fc209fb8466beb1f9a3ced1dba5d33 Author: Chak Shing, Lo Date: Wed Aug 30 13:11:57 2023 +0100 remove extra line commit 730e552a85b2ebd12dfba0bfd27715d0e689ee6a Author: Chak Shing, Lo Date: Wed Aug 30 12:41:35 2023 +0100 rollback toList commit 0b45987d6658c4cf0dc31c22e13fdd13f4d8fbcf Author: Chak Shing, Lo Date: Wed Aug 30 12:05:54 2023 +0100 update test commit 40c4f797ef1fb2306a027e55d4372dc638f66cae Merge: d5be1372d ab7db77df Author: Chak Shing, Lo Date: Wed Aug 30 11:26:04 2023 +0100 Merge branch 'DFPL-1464' into DFPL-1609 commit d5be1372ddfeed3366d713e572d46ee16e8370ed Author: Chak Shing, Lo Date: Wed Aug 30 11:25:41 2023 +0100 fix check style commit 2ff8fdc1efd459f317f7265da1af88c90d922e42 Author: Chak Shing, Lo Date: Wed Aug 30 10:57:33 2023 +0100 fix comment commit 56d4a386acfde6884c2be473c7dd35faa981e951 Merge: 1bca23c5d 97414f1e1 Author: Chak Shing, Lo Date: Tue Aug 29 12:48:09 2023 +0100 Merge branch 'DFPL-1464' into DFPL-1609 commit 1bca23c5d1a9f4c6071d19b0dbd7b27ce289638d Author: Chak Shing, Lo Date: Tue Aug 29 10:31:00 2023 +0100 fix code check commit 40d662ab3d87188e0fb9519834b70ee9b6b5154d Author: Chak Shing, Lo Date: Tue Aug 29 10:09:12 2023 +0100 update translation commit 9038f94ea23e733b283e371541c2a9c7748c0eca Merge: b05520623 fc82de3d4 Author: Chak Shing Lo <95437003+chak-shing-lo-justice@users.noreply.github.com> Date: Tue Aug 29 09:41:44 2023 +0100 Merge branch 'DFPL-1464' into DFPL-1609 commit b05520623308f84ce8620292415943b858adeee5 Author: Chak Shing, Lo Date: Thu Aug 24 17:49:54 2023 +0100 add log for future debugging commit 80cbd8a8885a07d8995b2c43f472ba58f597a588 Author: Chak Shing, Lo Date: Thu Aug 24 17:24:16 2023 +0100 update cafcass mapping commit f41ba622f5d475ca5a64de293d9541d4694ce14f Author: Chak Shing, Lo Date: Wed Aug 23 23:11:12 2023 +0100 fix cafcass doc description commit 62da7552a08caeb451fc678bd59831e6f2e399b1 Author: Chak Shing, Lo Date: Wed Aug 23 19:18:35 2023 +0100 backward compatible cafcass email provider commit f11bedfcb81d8d64bd438af7fe51d90f92204e37 Author: Chak Shing, Lo Date: Wed Aug 23 19:13:42 2023 +0100 update cafcass category list commit 6c3319c66b94960d5472af824c472cefe22d05d0 Author: Chak Shing, Lo Date: Wed Aug 23 18:49:51 2023 +0100 update cafcass noti logic commit 95ddc4a0cb72a187cfd96cbabd456ddbb37a8dce Author: Chak Shing, Lo Date: Wed Aug 23 13:30:23 2023 +0100 controller unit test commit 83b0705aee76897d65a0be05bc6780b5b62df8df Author: Chak Shing, Lo Date: Wed Aug 23 12:24:04 2023 +0100 fix bug commit a4ff5a4c4f014c8b0523e85be5ff886b66900808 Author: Chak Shing, Lo Date: Wed Aug 23 11:47:44 2023 +0100 update translation commit a6f0c48c1e883dc179aeab1c61866ed2f821e4d6 Author: Chak Shing, Lo Date: Tue Aug 22 18:15:01 2023 +0100 fix code check and unit test commit f8ce4f7b5a0eb85cf4bb142a54fb09d793e910ec Author: Chak Shing, Lo Date: Tue Aug 22 17:03:50 2023 +0100 update handler unit test commit 48c664a2a631eb37a45a5965593f210d27aeb30e Merge: f715b395e 8158d4b1a Author: Chak Shing Lo <95437003+chak-shing-lo-justice@users.noreply.github.com> Date: Tue Aug 22 11:35:56 2023 +0100 Merge branch 'DFPL-1464' into DFPL-1609 commit f715b395e5c1ca4bc1a146cd7f16e4c9b0c0a5e7 Author: Chak Shing, Lo Date: Tue Aug 22 11:24:39 2023 +0100 fix send by post sending hearing document commit 17045c05ae0371e6e355b042a7a5a144864b7603 Author: Chak Shing, Lo Date: Mon Aug 21 21:54:16 2023 +0100 update document uploaded unit test commit 25b5d470509f6e73fed8300b38c316a59da35eae Author: Chak Shing, Lo Date: Mon Aug 21 20:12:39 2023 +0100 update handler unit test commit 36560f3cf68e30503045e8648174a9c444cf3a90 Author: Chak Shing, Lo Date: Thu Aug 17 17:24:16 2023 +0100 fix after resolving conflict commit 05334d242a083b3985bd54f51221188d37acc684 Author: Chak Shing, Lo Date: Thu Aug 17 17:20:43 2023 +0100 update notification logic commit f42299cd328c0fdd7b8b50251717ad242eff79b1 Author: Chak Shing, Lo Date: Thu Aug 17 17:19:55 2023 +0100 revert sonarqube commit a30c93107390d6d84a732a749ec9ceb44b5f8a97 Merge: e32221965 9f35d246f Author: Chak Shing Lo <95437003+chak-shing-lo-justice@users.noreply.github.com> Date: Thu Aug 17 17:17:59 2023 +0100 Merge branch 'DFPL-1464' into DFPL-1609 commit e32221965cd8df2c2e117457cc7241fac4154d0b Author: Chak Shing, Lo Date: Mon Aug 14 17:08:52 2023 +0100 skip sonarqube for testing commit f97e8b0240267ad85e36c4659e1bd73325f95282 Author: Chak Shing, Lo Date: Mon Aug 14 17:02:39 2023 +0100 fix getting new document uploaded commit 3a30a19755df83e23cd1e35a6357308a45807b6f Merge: d5409e8ba d7a04477e Author: Chak Shing, Lo Date: Mon Aug 14 12:52:11 2023 +0100 Merge branch 'DFPL-1464' into DFPL-1609 commit d5409e8ba285d8ab31766b957670c7bc36a08c16 Merge: 3c83c27f1 a1e4c78f1 Author: Chak Shing Lo <95437003+chak-shing-lo-justice@users.noreply.github.com> Date: Fri Aug 11 10:27:23 2023 +0100 Merge branch 'DFPL-1464' into DFPL-1609 commit 3c83c27f178955d084dd2e69285783a999a374d1 Author: Chak Shing, Lo Date: Wed Aug 9 16:38:20 2023 +0100 ObjectHelperTest commit 73a426128f9dd38afb298de973e9697582999ab5 Author: Chak Shing, Lo Date: Tue Aug 8 17:43:06 2023 +0100 update publish event commit 2844ccf536f612a660b663317a99745095296b09 Author: Chak Shing, Lo Date: Tue Aug 8 15:55:34 2023 +0100 update interface NotifyDocumentUploaded commit 518effce5eb7235149f5e2d4e8318a4e2fd44760 Author: Chak Shing, Lo Date: Tue Aug 8 15:29:38 2023 +0100 update comment commit ce330b7bb408cb1e5213fac691d7573bc6787b20 Author: Chak Shing, Lo Date: Tue Aug 8 15:28:18 2023 +0100 update comment and default config commit a0258d0a7a76d8efe97def6f9c66b581271f0417 Author: Chak Shing, Lo Date: Tue Aug 8 15:12:11 2023 +0100 update comment commit e0ffe38fe57e46f17b6b6d1a215f937d6004f784 Author: Chak Shing, Lo Date: Tue Aug 8 14:41:17 2023 +0100 update comment commit cba1a892993cd44f0f0e20c8104a5d40cff5f63d Author: Chak Shing, Lo Date: Tue Aug 8 14:10:03 2023 +0100 remove unused comment commit f90167d9f3766361b2d3bdfb6aae2e979c6ab3ce Author: Chak Shing, Lo Date: Tue Aug 8 14:04:33 2023 +0100 new managedDoc handler for sending document uploaded noti * Fix Field Not Recognised error * add missing properties of applicationDocuments * add missing new fields * Fix wrong category for expert reports * Revoke R access to hearingFurtherEvidenceDocuments * Migration tests * Hide documents * update fpla-docker to master * Fix court bundle rollback script * Checkstyle * Categorise Sealed CMO to Order * Missing manage document instruction in demo * remove an extra blank line * remove logic which is not needed. * Set lastUploadedOrder to be non-readable since previously it is set to be DO_NOT_SHOW using FieldShowCondition. * added caseSummaryListBackup * Categorise documents under `urgentHearingOrder` field to category: "Orders". And hide "unsealedOrder" by setting authorisation setting. * Categorise supporting documents under CMO to category "Orders" * Fix applicationDocuments cannot be removed after migration. * Keep positionStatementRespondentListV2 and positionStatementChildListV2 * backup skeltonArgumentList * Fix test case * rollback some line changes * Revoke read access of "ordersToBeSent" field. * Fix issues on CAFCASS permission * Hide document tab and hearing document tab. * Remove access of old manage documents event. * Suppress unused graph ql vuln * DFPL-1775 Upload journey -updated event for Cafcass England & Cyrmu (#4727) * Enable CAFCASS to upload document * Enable cafcass user to upload/remove documents * updated unit tests * Fix test cases --------- Co-authored-by: Ashley Wong * Remove done migraitons * add back removed import * DFPL 1609 / DFPL-1730 New Upload Document Notification- Cafcass England & Cyrmu (#4774) * new managedDoc handler for sending document uploaded noti * remove unused comment * update comment * update comment * update comment and default config * update comment * update interface NotifyDocumentUploaded * update publish event * ObjectHelperTest * fix getting new document uploaded * skip sonarqube for testing * revert sonarqube * update notification logic * fix after resolving conflict * update handler unit test * update document uploaded unit test * fix send by post sending hearing document * update handler unit test * fix code check and unit test * update translation * fix bug * controller unit test * update cafcass noti logic * update cafcass category list * backward compatible cafcass email provider * fix cafcass doc description * update cafcass mapping * add log for future debugging * update translation * fix code check * fix comment * fix check style * update test * rollback toList * remove extra line * remove temporary skip logic * remove temporary skip logic in unit test * fix code style check * update cafcass noti mapping * Update dependency @babel/core to v7.23.2 (#4769) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency codeceptjs to v3.5.6 (#4771) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency com.fasterxml.jackson.datatype:jackson-datatype-joda to v2.15.3 (#4773) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix not notifying Cafcass welsh * fix not notifying cafcass welsh * revert changes after merge * revert changes after merge * revert changes after merge * revert changes after merge --------- Co-authored-by: Ashley Wong Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Adding postgres upgrade work to this branch, so demo can be used for initial config and testing * fix delimiter when familyman number is null (#4820) * Revert "fix delimiter when familyman number is null (#4820)" This reverts commit 52af2c2d36190f7ad0a5fafff2008de78cf37cfd. * Revert "Adding postgres upgrade work to this branch, so demo can be used for initial config and testing" This reverts commit c7911b923152c384d86bc6b6a15acce314da2ebd. --------- Co-authored-by: Ashley Wong Co-authored-by: Chak Shing, Lo Co-authored-by: Daniel Catchpole Co-authored-by: Chak Shing Lo <95437003+chak-shing-lo-justice@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jamesrferguson1 <94848497+jamesrferguson1@users.noreply.github.com> Co-authored-by: Paul Trelease * Resolved code conflict error. * missing curly bracket. * Remove unused imports. * DFPL-1902 - Data Migration for FurtherEvidenceDocument without Document Type (#4909) * Fixing issue without document type * remove unnecessary code. * temporary enable the old manage doc menu. * Logic for validating the counts * remove blank lines * Add rollback script and fix test cases * add missing test * add missing method * validate the response data * remove unnecessary codes. * update test case * Logic for validating position statements * logic for validating respondent statement * logic for validating correspondence documents * logic for validating application documents * Logic for validating migrated court bundle * checkstyle * added unit tests * added unit tests * updated test cases * increase test coverage * unit test for validating respondent statement migrations * unit tests for validting correspondence documents * Unit test for validating application documents * typo * Fixing court bundle validate migration logic and add its test cases. * fine tuning * remove an extra line * Revert "temporary enable the old manage doc menu." This reverts commit 01968073b035eb11843695b203c31a173136f3df. * simplifying * tidy up * checkstyle * Capitalised * Moving old documents to archived migrated data category e.g. documents_socialWorkChronology_document * Temporary enable the old manage doc menu for Charles’ testing. * remove unnecessary codes. * Hide "Correspondence" tab as those documents can be viewed in CFV. * Bug fix on typo * Logic for moving migrated documents to archived migrated data. * Logic for moving migrated documents to archived migrated data. * Revert "Temporary enable the old manage doc menu for Charles’ testing." This reverts commit 167d058199c787efcb7605c9465358f6f2003fe5. * typo * add unit tests for the new methods * Test cases and fixes. * using doesNotContain instead of extracting the property and check isNull * checkstyle fix * unit test cases * missing import * checkstyle fix * Fix test cases. * DFPL-1902: Correct merge error in commit bf9c4a9 * DFPL-1902: Added missing Util.UUID import --------- Co-authored-by: Ashley Wong Co-authored-by: Paul Trelease * WIP Updating Task List * adding c1Application field to caseData in order to control the event dropdown list * wip * wip * checkstyle * add missing AuthorisationCaseField entry * Fix unit tests * rearrange the code changes order. * Add checkbox for removing submitted C1 application with supplement * Capturing document uploader type and case roles. And clear submittedC1WithSupplement when changing order types. * update permission settings * Fix test case TaskListControllerSubmittedTest * checkstyle * Fix EventsCheckerTest * Add unit tests for OrdersNeededController * Remove @Autowired * Move logic to EnterC1WithSupplementController. * checkstyle * Checkstyle * Add test case for C1WithSupplementChecker * add test case * Setting default value * Code coverage * Add TaskListServiceTest * Test case on about-to-start controller * add case for clearSubmittedC1WithSupplement * add emptiness checkings. * add one more case * simplifed * resolving code smell. * into a single statement. * switch to single statement * Fix wrong category * Resolve merging error. --------- Co-authored-by: Ashley Wong Co-authored-by: Chak Shing, Lo Co-authored-by: Daniel Catchpole Co-authored-by: Chak Shing Lo <95437003+chak-shing-lo-justice@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jamesrferguson1 <94848497+jamesrferguson1@users.noreply.github.com> Co-authored-by: Paul Trelease Co-authored-by: Braimah101 <41795070+Braimah101@users.noreply.github.com> --- .../AuthorisationCaseEvent.json | 23 ++ .../CareSupervision/barrister.json | 7 + .../CareSupervision/cafcass-solicitor.json | 7 + .../CareSupervision/cafcass.json | 7 + .../CareSupervision/court-admin.json | 7 + .../CareSupervision/eps-managing.json | 14 ++ .../CareSupervision/la-barrister.json | 7 + .../CareSupervision/la-managing.json | 14 ++ .../CareSupervision/la-shared.json | 14 ++ .../CareSupervision/la-solicitor.json | 14 ++ .../CareSupervision/solicitor.json | 26 ++ .../CareSupervision/system-update.json | 7 + .../AdditionalApplicationsBundle.json | 14 +- .../CaseEvent/CareSupervision/MultiState.json | 20 +- .../enterC1WithSupplement.json | 237 ++++++++++++++++++ .../enterC1WithSupplement.json | 14 ++ .../CaseField/CareSupervision/caseField.json | 18 ++ .../C1SupplementOriginal.json | 84 +++++++ .../C1SupportingEvidenceBundle.json | 18 ++ .../C1SupportingEvidenceBundleOriginal.json | 235 +++++++++++++++++ .../SubmittedC1WithSupplement.json | 95 +++++++ ...hSupplementControllerAboutToStartTest.java | 65 +++++ ...SupplementControllerAboutToSubmitTest.java | 72 ++++++ .../OrdersNeededControllerTest.java | 15 ++ ...rderTypeWithSubmittedC1WithSupplement.json | 111 ++++++++ ...licationWithSubmittedC1WithSupplement.json | 111 ++++++++ .../EnterC1WithSupplementController.java | 64 +++++ .../controllers/OrdersNeededController.java | 6 + .../uk/gov/hmcts/reform/fpl/enums/Event.java | 3 +- .../gov/hmcts/reform/fpl/model/CaseData.java | 2 + .../SubmittedC1WithSupplementBundle.java | 34 +++ .../reform/fpl/service/TaskListRenderer.java | 2 + .../reform/fpl/service/TaskListService.java | 5 + .../document/ManageDocumentService.java | 10 +- .../validators/C1WithSupplementChecker.java | 43 ++++ .../fpl/service/validators/EventsChecker.java | 5 + .../fpl/service/TaskListServiceTest.java | 59 ++++- .../C1WithSupplementCheckerTest.java | 110 ++++++++ .../service/validators/EventsCheckerTest.java | 9 +- 39 files changed, 1590 insertions(+), 18 deletions(-) create mode 100644 ccd-definition/CaseEventToComplexTypes/enterC1WithSupplement.json create mode 100644 ccd-definition/CaseEventToFields/CareSupervision/enterC1WithSupplement.json create mode 100644 ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupplementOriginal.json create mode 100644 ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundleOriginal.json create mode 100644 ccd-definition/ComplexTypes/CareSupervision/SubmittedC1WithSupplement.json create mode 100644 service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToStartTest.java create mode 100644 service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToSubmitTest.java create mode 100644 service/src/integrationTest/resources/fixtures/caseCareAndStandaloneOrderTypeWithSubmittedC1WithSupplement.json create mode 100644 service/src/integrationTest/resources/fixtures/caseNonC1ApplicationWithSubmittedC1WithSupplement.json create mode 100644 service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementController.java create mode 100644 service/src/main/java/uk/gov/hmcts/reform/fpl/model/common/SubmittedC1WithSupplementBundle.java create mode 100644 service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementChecker.java create mode 100644 service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementCheckerTest.java diff --git a/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json b/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json index 726f5679fd1..22cee2909f7 100644 --- a/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json +++ b/ccd-definition/AuthorisationCaseEvent/CareSupervision/AuthorisationCaseEvent.json @@ -400,6 +400,29 @@ } ] }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseEventID": "enterC1WithSupplement", + "AccessControl": [ + { + "UserRoles": [ + "[LASOLICITOR]", + "[EPSMANAGING]", + "[LAMANAGING]", + "[SOLICITORA]", + "[CHILDSOLICITORA]" + ], + "CRUD": "CR" + }, + { + "UserRoles": [ + "caseworker-publiclaw-solicitor" + ], + "CRUD": "R" + } + ] + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/barrister.json b/ccd-definition/AuthorisationCaseField/CareSupervision/barrister.json index e8edff2d44c..ce06d94b07e 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/barrister.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/barrister.json @@ -828,6 +828,13 @@ "UserRole": "[BARRISTER]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "[BARRISTER]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass-solicitor.json b/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass-solicitor.json index 160526cf7c2..29fd0b62c36 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass-solicitor.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass-solicitor.json @@ -629,6 +629,13 @@ "UserRole": "[CAFCASSSOLICITOR]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "[CAFCASSSOLICITOR]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass.json b/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass.json index 015fbcdccca..eb4bec32392 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/cafcass.json @@ -1140,6 +1140,13 @@ "UserRole": "caseworker-publiclaw-cafcass", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "caseworker-publiclaw-cafcass", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/court-admin.json b/ccd-definition/AuthorisationCaseField/CareSupervision/court-admin.json index 16682e92a57..36593f976aa 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/court-admin.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/court-admin.json @@ -3667,6 +3667,13 @@ "UserRole": "caseworker-publiclaw-courtadmin", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "caseworker-publiclaw-courtadmin", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/eps-managing.json b/ccd-definition/AuthorisationCaseField/CareSupervision/eps-managing.json index 675efb6f493..7fad7ad6ab0 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/eps-managing.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/eps-managing.json @@ -1791,6 +1791,13 @@ "UserRole": "[EPSMANAGING]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "[EPSMANAGING]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", @@ -2071,6 +2078,13 @@ "UserRole": "[EPSMANAGING]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "c1Application", + "UserRole": "[EPSMANAGING]", + "CRUD": "CRUD" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/la-barrister.json b/ccd-definition/AuthorisationCaseField/CareSupervision/la-barrister.json index 86cb54cdbbd..1d8c3b3d6ea 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/la-barrister.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/la-barrister.json @@ -1266,6 +1266,13 @@ "UserRole": "[LABARRISTER]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "[LABARRISTER]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/la-managing.json b/ccd-definition/AuthorisationCaseField/CareSupervision/la-managing.json index b432108ce6d..edeb5a49197 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/la-managing.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/la-managing.json @@ -1756,6 +1756,13 @@ "UserRole": "[LAMANAGING]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "[LAMANAGING]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", @@ -2064,6 +2071,13 @@ "UserRole": "[LAMANAGING]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "c1Application", + "UserRole": "[LAMANAGING]", + "CRUD": "CRUD" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/la-shared.json b/ccd-definition/AuthorisationCaseField/CareSupervision/la-shared.json index 0e269589f05..b516daa7f97 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/la-shared.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/la-shared.json @@ -1694,6 +1694,13 @@ "UserRole": "[LASHARED]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "[LASHARED]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", @@ -1866,6 +1873,13 @@ "UserRole": "[LASHARED]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "c1Application", + "UserRole": "[LASHARED]", + "CRUD": "CRUD" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/la-solicitor.json b/ccd-definition/AuthorisationCaseField/CareSupervision/la-solicitor.json index c6318142290..d85bca5b164 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/la-solicitor.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/la-solicitor.json @@ -2685,6 +2685,13 @@ "UserRole": "[LASOLICITOR]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "[LASOLICITOR]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", @@ -3178,6 +3185,13 @@ "UserRole": "[LASOLICITOR]", "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "c1Application", + "UserRole": "[LASOLICITOR]", + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/solicitor.json b/ccd-definition/AuthorisationCaseField/CareSupervision/solicitor.json index 30aff94cb0b..c3ec7af3880 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/solicitor.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/solicitor.json @@ -552,6 +552,19 @@ ], "CRUD": "CRUD" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "c1Application", + "UserRoles": ["[SOLICITOR]", "[SOLICITORA]", "[SOLICITORB]", "[SOLICITORC]", "[SOLICITORD]", + "[SOLICITORE]", "[SOLICITORF]", "[SOLICITORG]", "[SOLICITORH]", "[SOLICITORI]", "[SOLICITORJ]", + "[CHILDSOLICITORA]", "[CHILDSOLICITORB]", "[CHILDSOLICITORC]", "[CHILDSOLICITORD]", + "[CHILDSOLICITORE]", "[CHILDSOLICITORF]", "[CHILDSOLICITORG]", "[CHILDSOLICITORH]", + "[CHILDSOLICITORI]", "[CHILDSOLICITORJ]", "[CHILDSOLICITORK]", "[CHILDSOLICITORL]", + "[CHILDSOLICITORM]", "[CHILDSOLICITORN]", "[CHILDSOLICITORO]" + ], + "CRUD": "CRUD" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", @@ -946,6 +959,19 @@ ], "CRUD": "CRU" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRoles": ["[SOLICITOR]", "[SOLICITORA]", "[SOLICITORB]", "[SOLICITORC]", "[SOLICITORD]", + "[SOLICITORE]", "[SOLICITORF]", "[SOLICITORG]", "[SOLICITORH]", "[SOLICITORI]", "[SOLICITORJ]", + "[CHILDSOLICITORA]", "[CHILDSOLICITORB]", "[CHILDSOLICITORC]", "[CHILDSOLICITORD]", + "[CHILDSOLICITORE]", "[CHILDSOLICITORF]", "[CHILDSOLICITORG]", "[CHILDSOLICITORH]", + "[CHILDSOLICITORI]", "[CHILDSOLICITORJ]", "[CHILDSOLICITORK]", "[CHILDSOLICITORL]", + "[CHILDSOLICITORM]", "[CHILDSOLICITORN]", "[CHILDSOLICITORO]" + ], + "CRUD": "CRU" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/AuthorisationCaseField/CareSupervision/system-update.json b/ccd-definition/AuthorisationCaseField/CareSupervision/system-update.json index 79159d337c1..fd694fbba8b 100644 --- a/ccd-definition/AuthorisationCaseField/CareSupervision/system-update.json +++ b/ccd-definition/AuthorisationCaseField/CareSupervision/system-update.json @@ -3534,5 +3534,12 @@ "CaseFieldID": "previousProceedingListRemoved", "UserRole": "caseworker-publiclaw-systemupdate", "CRUD": "CRUD" + }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseFieldID": "submittedC1WithSupplement", + "UserRole": "caseworker-publiclaw-systemupdate", + "CRUD": "CRU" } ] diff --git a/ccd-definition/AuthorisationComplexType/caseDocuments/AdditionalApplicationsBundle.json b/ccd-definition/AuthorisationComplexType/caseDocuments/AdditionalApplicationsBundle.json index 4bff5d3de1e..3317584dae8 100644 --- a/ccd-definition/AuthorisationComplexType/caseDocuments/AdditionalApplicationsBundle.json +++ b/ccd-definition/AuthorisationComplexType/caseDocuments/AdditionalApplicationsBundle.json @@ -1175,7 +1175,7 @@ "[CHILDSOLICITORO]", "[BARRISTER]" ], - "CRUD": "CU" + "CRUD": "CRU" }, { "UserRoles": [ @@ -1189,7 +1189,7 @@ "UserRoles": [ "caseworker-publiclaw-cafcass" ], - "CRUD": "U" + "CRUD": "RU" } ] }, @@ -1242,13 +1242,7 @@ "[EPSMANAGING]", "[BARRISTER]" ], - "CRUD": "CRU" - }, - { - "UserRoles": [ - "caseworker-publiclaw-cafcass" - ], - "CRUD": "R" + "CRUD": "CU" }, { "UserRoles": [ @@ -1317,7 +1311,7 @@ "[CHILDSOLICITORO]", "[BARRISTER]" ], - "CRUD": "CRU" + "CRUD": "CU" } ] }, diff --git a/ccd-definition/CaseEvent/CareSupervision/MultiState.json b/ccd-definition/CaseEvent/CareSupervision/MultiState.json index 10083b3f408..427b7ec85f5 100644 --- a/ccd-definition/CaseEvent/CareSupervision/MultiState.json +++ b/ccd-definition/CaseEvent/CareSupervision/MultiState.json @@ -416,13 +416,31 @@ "EndButtonLabel": "Save and continue", "CallBackURLSubmittedEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/update-task-list/submitted" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "ID": "enterC1WithSupplement", + "Name": "C1 with supplement", + "Description": "Entering C1 with supplement", + "DisplayOrder": 12, + "PreConditionState(s)": "Open;RETURNED", + "PostConditionState": "*", + "SecurityClassification": "Public", + "ShowSummary": "Y", + "ShowEventNotes": "N", + "EndButtonLabel": "Save and continue", + "CallBackURLAboutToStartEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/enter-c1-with-supplement/about-to-start", + "CallBackURLAboutToSubmitEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/enter-c1-with-supplement/about-to-submit", + "CallBackURLSubmittedEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callback/update-task-list/submitted", + "EventEnablingCondition": "c1Application!=\"Yes\"" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", "ID": "otherProceedings", "Name": "Other proceedings", "Description": "Entering other proceedings and proposals", - "DisplayOrder": 12, + "DisplayOrder": 13, "PreConditionState(s)": "Open;RETURNED", "PostConditionState": "*", "SecurityClassification": "Public", diff --git a/ccd-definition/CaseEventToComplexTypes/enterC1WithSupplement.json b/ccd-definition/CaseEventToComplexTypes/enterC1WithSupplement.json new file mode 100644 index 00000000000..6727695d91f --- /dev/null +++ b/ccd-definition/CaseEventToComplexTypes/enterC1WithSupplement.json @@ -0,0 +1,237 @@ +[ + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "isDocumentUploaded", + "FieldDisplayOrder": "0", + "DisplayContext": "READONLY", + "FieldShowCondition": "submittedC1WithSupplement.isDocumentUploaded=\"DO_NOT_SHOW\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "clearSubmittedC1WithSupplement", + "FieldDisplayOrder": "1", + "DisplayContext": "MANDATORY", + "FieldShowCondition": "submittedC1WithSupplement.isDocumentUploaded=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "document", + "EventElementLabel": "Upload application", + "FieldDisplayOrder": "1", + "DisplayContext": "MANDATORY", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "documentAcknowledgeLabel", + "FieldDisplayOrder": 4, + "DisplayContext": "READONLY", + "EventElementLabel": "
Check if this document is related to ${caseName}

", + "FieldShowCondition": "documentAcknowledge!=\"ACK_RELATED_TO_CASE\" AND submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "documentAcknowledgeLabelForCYA", + "FieldDisplayOrder": 4, + "DisplayContext": "READONLY", + "EventElementLabel": "
Check if this document is related to this case

", + "FieldShowCondition": "documentAcknowledge=\"ACK_RELATED_TO_CASE\" AND submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "documentAcknowledge", + "FieldDisplayOrder": 5, + "DisplayContext": "MANDATORY", + "EventElementLabel": "Tick to confirm this document is related to this case", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "urgencyTimeFrameType", + "EventElementLabel": "Please state how soon you want the judge to consider your application?", + "FieldDisplayOrder": "6", + "DisplayContext": "OPTIONAL", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "EventElementLabel": "Supplements", + "ListElementCode": "supplementsBundle", + "FieldDisplayOrder": "7", + "DisplayContext": "OPTIONAL", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supplementsBundle.name", + "FieldDisplayOrder": "8", + "DisplayContext": "MANDATORY", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supplementsBundle.notes", + "FieldDisplayOrder": "10", + "DisplayContext": "OPTIONAL", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "EventElementLabel": "Upload document", + "ListElementCode": "supplementsBundle.document", + "FieldDisplayOrder": "11", + "DisplayContext": "MANDATORY", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supplementsBundle.documentAcknowledgeLabel", + "FieldDisplayOrder": "12", + "DisplayContext": "READONLY", + "EventElementLabel": "
Check if this document is related to ${caseName}

", + "FieldShowCondition": "documentAcknowledge!=\"ACK_RELATED_TO_CASE\" AND submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supplementsBundle.documentAcknowledgeLabelForCYA", + "FieldDisplayOrder": "12", + "DisplayContext": "READONLY", + "EventElementLabel": "
Check if this document is related to this case

", + "FieldShowCondition": "documentAcknowledge=\"ACK_RELATED_TO_CASE\" AND submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supplementsBundle.documentAcknowledge", + "FieldDisplayOrder": "13", + "DisplayContext": "MANDATORY", + "EventElementLabel": "Tick to confirm this document is related to this case", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "EventElementLabel": "Supporting Documents", + "ListElementCode": "supportingEvidenceBundle", + "FieldDisplayOrder": "14", + "DisplayContext": "OPTIONAL", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "EventElementLabel": "File name", + "ListElementCode": "supportingEvidenceBundle.name", + "FieldDisplayOrder": "15", + "DisplayContext": "MANDATORY", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supportingEvidenceBundle.notes", + "FieldDisplayOrder": "16", + "DisplayContext": "OPTIONAL", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supportingEvidenceBundle.dateTimeReceived", + "DisplayContext": "OPTIONAL", + "FieldShowCondition": "temporaryC2Document=\"DO NOT SHOW\" AND submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supportingEvidenceBundle.document", + "EventElementLabel": "Upload document", + "FieldDisplayOrder": "17", + "DisplayContext": "MANDATORY", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supportingEvidenceBundle.documentAcknowledgeLabel", + "FieldDisplayOrder": "18", + "DisplayContext": "READONLY", + "EventElementLabel": "
Check if this document is related to ${caseName}

", + "FieldShowCondition": "documentAcknowledge!=\"ACK_RELATED_TO_CASE\" AND submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supportingEvidenceBundle.documentAcknowledgeLabelForCYA", + "FieldDisplayOrder": "18", + "DisplayContext": "READONLY", + "EventElementLabel": "
Check if this document is related to this case

", + "FieldShowCondition": "documentAcknowledge=\"ACK_RELATED_TO_CASE\" AND submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "EnterC1WithSupplement", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "ListElementCode": "supportingEvidenceBundle.documentAcknowledge", + "FieldDisplayOrder": "19", + "DisplayContext": "MANDATORY", + "EventElementLabel": "Tick to confirm this document is related to this case", + "FieldShowCondition": "submittedC1WithSupplement.clearSubmittedC1WithSupplement!=\"YES\"" + } +] diff --git a/ccd-definition/CaseEventToFields/CareSupervision/enterC1WithSupplement.json b/ccd-definition/CaseEventToFields/CareSupervision/enterC1WithSupplement.json new file mode 100644 index 00000000000..f62bc61b607 --- /dev/null +++ b/ccd-definition/CaseEventToFields/CareSupervision/enterC1WithSupplement.json @@ -0,0 +1,14 @@ +[ + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "CaseEventID": "enterC1WithSupplement", + "CaseFieldID": "submittedC1WithSupplement", + "PageFieldDisplayOrder": 1, + "DisplayContext": "COMPLEX", + "PageID": 1, + "PageDisplayOrder": 1, + "PageColumnNumber": 1, + "ShowSummaryChangeOption": "Y" + } +] diff --git a/ccd-definition/CaseField/CareSupervision/caseField.json b/ccd-definition/CaseField/CareSupervision/caseField.json index c5fe5f4b086..6db1db785de 100644 --- a/ccd-definition/CaseField/CareSupervision/caseField.json +++ b/ccd-definition/CaseField/CareSupervision/caseField.json @@ -2496,6 +2496,24 @@ "SecurityClassification": "Public", "Searchable": "N" }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "ID": "submittedC1WithSupplement", + "Label": "C1 with supplement (Original application)", + "FieldType": "SubmittedC1WithSupplement", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "ID": "c1Application", + "Label": " ", + "FieldType": "YesOrNo", + "SecurityClassification": "Public", + "Searchable": "N" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupplementOriginal.json b/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupplementOriginal.json new file mode 100644 index 00000000000..af94a95a35f --- /dev/null +++ b/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupplementOriginal.json @@ -0,0 +1,84 @@ +[ + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "name", + "FieldType": "FixedList", + "ElementLabel": "Document name", + "FieldTypeParameter": "SupplementType", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "secureAccommodationType", + "FieldType": "FixedRadioList", + "ElementLabel": "Which jurisdiction?", + "FieldTypeParameter": "SecureAccommodationType", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "notes", + "FieldType": "TextArea", + "ElementLabel": "Notes", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "dateTimeUploaded", + "FieldType": "DateTime", + "ElementLabel": "Date and time uploaded", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "document", + "FieldType": "Document", + "ElementLabel": "File", + "SecurityClassification": "Public", + "RegularExpression": ".doc,.docx,.pdf", + "CategoryID": "originalApplications" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "uploadedBy", + "FieldType": "Text", + "ElementLabel": "Uploaded by", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "documentAcknowledgeLabel", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "documentAcknowledgeLabelForCYA", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupplementOriginal", + "ListElementCode": "documentAcknowledge", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "DocumentAcknowledge", + "ElementLabel": "Tick to confirm this document is related to this case", + "SecurityClassification": "Public", + "Searchable": "N" + } +] diff --git a/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundle.json b/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundle.json index 043bcc7f737..0b881589804 100644 --- a/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundle.json +++ b/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundle.json @@ -213,5 +213,23 @@ "FieldType": "TextArea", "ElementLabel": "Reason for removal", "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundle", + "ListElementCode": "uploaderType", + "FieldType": "FixedList", + "FieldTypeParameter": "DocumentUploaderType", + "ElementLabel": "Document Uploader Type", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundle", + "ListElementCode": "uploaderCaseRoles", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "CaseRole", + "ElementLabel": "Document Uploader Case Roles", + "SecurityClassification": "Public" } ] diff --git a/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundleOriginal.json b/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundleOriginal.json new file mode 100644 index 00000000000..0186d36a40b --- /dev/null +++ b/ccd-definition/ComplexTypes/CareSupervision/1_SupportingDocuments/C1SupportingEvidenceBundleOriginal.json @@ -0,0 +1,235 @@ +[ + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "name", + "FieldType": "Text", + "ElementLabel": "Document name", + "SecurityClassification": "Public", + "RegularExpression": "^(?!.*<[^>\\d]+>*).*" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "notes", + "FieldType": "TextArea", + "ElementLabel": "Notes", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "dateTimeReceived", + "FieldType": "DateTime", + "ElementLabel": "Date and time received", + "HintText": "For example, 31 3 2016 2 30 00", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "dateTimeUploaded", + "FieldType": "DateTime", + "ElementLabel": "Date and time uploaded", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "uploadedBy", + "FieldType": "Text", + "ElementLabel": "Uploaded by", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "document", + "FieldType": "Document", + "ElementLabel": "File", + "SecurityClassification": "Public", + "CategoryID": "originalApplications" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "translatedDocument", + "FieldType": "Document", + "ElementLabel": "Translated document", + "SecurityClassification": "Public", + "CategoryID": "originalApplications" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "translationUploadDateTime", + "FieldType": "DateTime", + "ElementLabel": "Welsh translation upload time", + "SecurityClassification": "Public", + "FieldShowCondition": "translatedDocument=\"DO_NOT_SHOW\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "documentAcknowledgeLabel", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "documentAcknowledgeLabelForCYA", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "documentAcknowledge", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "DocumentAcknowledge", + "ElementLabel": "Tick to confirm this document is related to this case", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "confidentialWarningLabel", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "confidential", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "ConfidentialDocument", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "FieldShowCondition": "confidentialWarningLabel=\"DO_NOT_SHOW\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "confidentialTabLabel", + "FieldType": "Text", + "ElementLabel": " ", + "SecurityClassification": "Public", + "FieldShowCondition": "confidential CONTAINS \"CONFIDENTIAL\"", + "Searchable": "N", + "Comment": "Used to identify documents as confidential in tab view only. Does not display in event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "type", + "FieldType": "FixedRadioList", + "FieldTypeParameter": "FurtherEvidenceType", + "ElementLabel": "Choose a further evidence document type", + "SecurityClassification": "Public", + "FieldShowCondition": "confidential=\"DO_NOT_SHOW\"", + "Searchable": "N", + "Comment": "Not shown in tab" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "expertReportType", + "FieldType": "FixedList", + "FieldTypeParameter": "ExpertReportList", + "ElementLabel": "Choose an expert report type", + "SecurityClassification": "Public", + "FieldShowCondition": "type=\"EXPERT_REPORTS\"", + "Searchable": "N", + "Comment": "Only shown + populated if this is an expert report" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "uploadedBySolicitor", + "FieldType": "YesOrNo", + "ElementLabel": " ", + "SecurityClassification": "Public", + "FieldShowCondition": "confidential=\"DO_NOT_SHOW\"", + "Searchable": "N", + "Comment": "Not shown in tab" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "translationRequirements", + "FieldType": "FixedRadioList", + "FieldTypeParameter": "LanguageTranslationRequirement", + "ElementLabel": "Is translation needed?", + "SecurityClassification": "Public", + "FieldShowCondition": "confidential=\"DO_NOT_SHOW\"", + "Searchable": "N", + "Comment": "Not shown in tab" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "needTranslation", + "FieldType": "YesOrNo", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "FieldShowCondition": "translationRequirements=\"DO_NOT_SHOW\"" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "hasConfidentialAddressLabel", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "hasConfidentialAddress", + "FieldType": "YesOrNo", + "ElementLabel": "Document contains a confidential address?", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "removalReason", + "FieldType": "TextArea", + "ElementLabel": "Reason for removal", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "uploaderType", + "FieldType": "FixedList", + "FieldTypeParameter": "DocumentUploaderType", + "ElementLabel": "Document Uploader Type", + "SecurityClassification": "Public" + }, + { + "LiveFrom": "01/01/2017", + "ID": "C1SupportingEvidenceBundleOriginal", + "ListElementCode": "uploaderCaseRoles", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "CaseRole", + "ElementLabel": "Document Uploader Case Roles", + "SecurityClassification": "Public" + } +] diff --git a/ccd-definition/ComplexTypes/CareSupervision/SubmittedC1WithSupplement.json b/ccd-definition/ComplexTypes/CareSupervision/SubmittedC1WithSupplement.json new file mode 100644 index 00000000000..8751777b292 --- /dev/null +++ b/ccd-definition/ComplexTypes/CareSupervision/SubmittedC1WithSupplement.json @@ -0,0 +1,95 @@ +[ + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "ListElementCode": "isDocumentUploaded", + "ElementLabel": "Is Document Uploaded?", + "FieldType": "FixedRadioList", + "FieldTypeParameter": "YesOrNoFixedList", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "ListElementCode": "clearSubmittedC1WithSupplement", + "ElementLabel": "Remove this C1 with supplement application.", + "FieldType": "FixedRadioList", + "FieldTypeParameter": "YesOrNoFixedList", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "ListElementCode": "document", + "FieldType": "Document", + "ElementLabel": "File", + "RegularExpression": ".doc,.docx,.pdf", + "SecurityClassification": "Public", + "Searchable": "N", + "CategoryID": "originalApplications" + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "ListElementCode": "urgencyTimeFrameType", + "ElementLabel": "Please state how soon you want the judge to consider your application?", + "FieldType": "FixedRadioList", + "FieldTypeParameter": "UrgencyTimeFrameType", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "ListElementCode": "supplementsBundle", + "ElementLabel": "Supplements", + "FieldType": "Collection", + "FieldTypeParameter": "C1SupplementOriginal", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "ListElementCode": "supportingEvidenceBundle", + "ElementLabel": "Supporting documents", + "FieldType": "Collection", + "FieldTypeParameter": "C1SupportingEvidenceBundleOriginal", + "SecurityClassification": "Public", + "Searchable": "N" + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "ListElementCode": "documentAcknowledgeLabel", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "ListElementCode": "documentAcknowledgeLabelForCYA", + "FieldType": "Label", + "ElementLabel": " ", + "SecurityClassification": "Public", + "Searchable": "N", + "Comment": "Presentational only - used to display a warning label in the event." + }, + { + "LiveFrom": "01/01/2017", + "ID": "SubmittedC1WithSupplement", + "ListElementCode": "documentAcknowledge", + "FieldType": "MultiSelectList", + "FieldTypeParameter": "DocumentAcknowledge", + "ElementLabel": "Tick to confirm this document is related to this case", + "SecurityClassification": "Public", + "Searchable": "N" + } +] diff --git a/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToStartTest.java b/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToStartTest.java new file mode 100644 index 00000000000..ba0f73a830d --- /dev/null +++ b/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToStartTest.java @@ -0,0 +1,65 @@ +package uk.gov.hmcts.reform.fpl.controllers; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import uk.gov.hmcts.reform.fpl.enums.State; +import uk.gov.hmcts.reform.fpl.model.CaseData; +import uk.gov.hmcts.reform.fpl.model.common.DocumentReference; +import uk.gov.hmcts.reform.fpl.model.common.SubmittedC1WithSupplementBundle; +import uk.gov.hmcts.reform.fpl.service.document.ManageDocumentService; + +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +@WebMvcTest(ManageDocumentService.class) +@OverrideAutoConfiguration(enabled = true) +class EnterC1WithSupplementControllerAboutToStartTest extends AbstractCallbackTest { + + @MockBean + private ManageDocumentService manageDocumentService; + + EnterC1WithSupplementControllerAboutToStartTest() { + super("enter-c1-with-supplement"); + } + + @SuppressWarnings("unchecked") + @Test + void shouldPopulateIsDocumentUploadedAndClearSubmittedC1WithSupplement() { + Map caseDetails = postAboutToStartEvent(CaseData.builder() + .id(10L) + .state(State.OPEN) + .caseName("CaseName") + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .document(DocumentReference.builder().filename("ABC.docx").build()) + .build()) + .build()).getData(); + + assertThat(caseDetails.get("submittedC1WithSupplement")).isNotNull(); + Map submittedC1WithSupplement = (Map) caseDetails + .get("submittedC1WithSupplement"); + assertThat(submittedC1WithSupplement).extracting("isDocumentUploaded").isEqualTo("YES"); + assertThat(submittedC1WithSupplement).extracting("clearSubmittedC1WithSupplement") + .isEqualTo("NO"); + } + + @SuppressWarnings("unchecked") + @Test + void shouldPopulateIsDocumentUploadedAndClearSubmittedC1WithSupplementWithoutDocument() { + Map caseDetails = postAboutToStartEvent(CaseData.builder() + .id(10L) + .state(State.OPEN) + .caseName("CaseName") + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .build()) + .build()).getData(); + + assertThat(caseDetails.get("submittedC1WithSupplement")).isNotNull(); + Map submittedC1WithSupplement = (Map) caseDetails + .get("submittedC1WithSupplement"); + assertThat(submittedC1WithSupplement).extracting("isDocumentUploaded").isEqualTo("NO"); + assertThat(submittedC1WithSupplement).extracting("clearSubmittedC1WithSupplement").isNull(); + } +} diff --git a/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToSubmitTest.java b/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToSubmitTest.java new file mode 100644 index 00000000000..bbe990e104d --- /dev/null +++ b/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementControllerAboutToSubmitTest.java @@ -0,0 +1,72 @@ +package uk.gov.hmcts.reform.fpl.controllers; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import uk.gov.hmcts.reform.fpl.enums.CaseRole; +import uk.gov.hmcts.reform.fpl.enums.State; +import uk.gov.hmcts.reform.fpl.model.CaseData; +import uk.gov.hmcts.reform.fpl.model.SupportingEvidenceBundle; +import uk.gov.hmcts.reform.fpl.model.common.DocumentReference; +import uk.gov.hmcts.reform.fpl.model.common.SubmittedC1WithSupplementBundle; +import uk.gov.hmcts.reform.fpl.service.document.ManageDocumentService; + +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import static uk.gov.hmcts.reform.fpl.enums.notification.DocumentUploaderType.DESIGNATED_LOCAL_AUTHORITY; +import static uk.gov.hmcts.reform.fpl.utils.ElementUtils.element; + +@WebMvcTest(ManageDocumentService.class) +@OverrideAutoConfiguration(enabled = true) +class EnterC1WithSupplementControllerAboutToSubmitTest extends AbstractCallbackTest { + + @MockBean + private ManageDocumentService manageDocumentService; + + EnterC1WithSupplementControllerAboutToSubmitTest() { + super("enter-c1-with-supplement"); + } + + @Test + void shouldRemoveSubmittedC1WithSupplementWhenClearFlagIsYes() { + Map caseDetails = postAboutToSubmitEvent(CaseData.builder() + .id(10L) + .state(State.OPEN) + .caseName("Updated CaseName") + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .clearSubmittedC1WithSupplement("yes") + .build()) + .build()).getData(); + + assertThat(caseDetails.get("submittedC1WithSupplement")).isNull(); + } + + @Test + void shouldPopulateUploaderInfos() { + when(manageDocumentService.getUploaderType(any())).thenReturn(DESIGNATED_LOCAL_AUTHORITY); + when(manageDocumentService.getUploaderCaseRoles(any())).thenReturn(List.of(CaseRole.LASOLICITOR)); + + CaseData caseData = extractCaseData(postAboutToSubmitEvent(CaseData.builder() + .id(10L) + .state(State.OPEN) + .caseName("Updated CaseName") + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .supportingEvidenceBundle(List.of(element(SupportingEvidenceBundle.builder() + .document(DocumentReference.builder().filename("ABC.docx").build()) + .build()))) + .build()) + .build())); + + SubmittedC1WithSupplementBundle submittedC1WithSupplementBundle = caseData.getSubmittedC1WithSupplement(); + assertThat(submittedC1WithSupplementBundle).isNotNull(); + submittedC1WithSupplementBundle.getSupportingEvidenceBundle().forEach(seb -> { + assertThat(seb.getValue().getUploaderType()).isEqualTo(DESIGNATED_LOCAL_AUTHORITY); + assertThat(seb.getValue().getUploaderCaseRoles()).isEqualTo(List.of(CaseRole.LASOLICITOR)); + }); + } +} diff --git a/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededControllerTest.java b/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededControllerTest.java index 2b4b59687f5..5dd0f2def56 100644 --- a/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededControllerTest.java +++ b/service/src/integrationTest/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededControllerTest.java @@ -159,4 +159,19 @@ void shouldSetCaseManagementLocation() { assertThat(caseManagementLocation).containsEntry("baseLocation", "234946"); assertThat(caseManagementLocation).containsEntry("region", "7"); } + + @Test + void shouldRemoveSubmittedC1WithSupplementIfC1Application() { + AboutToStartOrSubmitCallbackResponse response = postAboutToSubmitEvent( + "fixtures/caseCareAndStandaloneOrderTypeWithSubmittedC1WithSupplement.json"); + assertThat(response.getData().get("submittedC1WithSupplement")).isNull(); + } + + @Test + void shouldNotRemoveSubmittedC1WithSupplementIfC1Application() { + AboutToStartOrSubmitCallbackResponse response = postAboutToSubmitEvent( + "fixtures/caseNonC1ApplicationWithSubmittedC1WithSupplement.json"); + assertThat(response.getData().get("submittedC1WithSupplement")).isNotNull(); + } + } diff --git a/service/src/integrationTest/resources/fixtures/caseCareAndStandaloneOrderTypeWithSubmittedC1WithSupplement.json b/service/src/integrationTest/resources/fixtures/caseCareAndStandaloneOrderTypeWithSubmittedC1WithSupplement.json new file mode 100644 index 00000000000..5750d46c1e3 --- /dev/null +++ b/service/src/integrationTest/resources/fixtures/caseCareAndStandaloneOrderTypeWithSubmittedC1WithSupplement.json @@ -0,0 +1,111 @@ +{ + "case_details": { + "id": "2313", + "case_data": { + "submittedC1WithSupplement": { + "document": { + "document_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/eaabb925-7657-4a30-b397-5995171d0506", + "document_filename": "A_DOC_1.docx", + "document_binary_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/eaabb925-7657-4a30-b397-5995171d0506/binary" + }, + "supplementsBundle": [ + { + "id": "b7293735-f126-425e-a814-d98dcc29127d", + "value": { + "name": "C13A_SPECIAL_GUARDIANSHIP", + "notes": "asd", + "document": { + "document_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/b0093881-90f1-47b5-8213-edf700f00f48", + "document_filename": "A_DOC_2.docx", + "document_binary_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/b0093881-90f1-47b5-8213-edf700f00f48/binary" + }, + "documentAcknowledge": [ + "ACK_RELATED_TO_CASE" + ] + } + } + ], + "isDocumentUploaded": "YES", + "urgencyTimeFrameType": "SAME_DAY", + "supportingEvidenceBundle": [ + { + "id": "6b0bf1bb-6f2b-49ff-92dd-9da37afa467e", + "value": { + "name": "qwe", + "notes": "qwe", + "document": { + "document_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/23764a1e-a8fa-4049-9543-76bdba089c81", + "document_filename": "A_DOC_3.docx", + "document_binary_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/23764a1e-a8fa-4049-9543-76bdba089c81/binary" + }, + "confidential": [], + "uploaderType": "DESIGNATED_LOCAL_AUTHORITY", + "needTranslation": "NO", + "uploaderCaseRoles": [ + "LASOLICITOR" + ], + "documentAcknowledge": [ + "ACK_RELATED_TO_CASE" + ], + "hasConfidentialAddress": "No" + } + } + ], + "clearSubmittedC1WithSupplement": "NO" + }, + "caseLocalAuthority": "test1", + "applicants": [ + { + "id": "99ceafd0-de4b-4725-b78b-7625342febed", + "value": { + "party": { + "email": { + "email": "applicant@email.com" + }, + "organisationName": "test organisation name" + } + } + } + ], + "respondents1": [ + { + "id": "d5eb6a70-d6d3-4eb6-b06e-9dc9d6360090", + "value": { + "party": { + "gender": "Male", + "address": { + "County": "", + "Country": "United Kingdom", + "PostCode": "RG4 7AA", + "PostTown": "Reading", + "AddressLine1": "Flat 2", + "AddressLine2": "Caversham House 15-17", + "AddressLine3": "Church Road" + }, + "lastName": "Bloggs", + "firstName": "Joe", + "dateOfBirth": "1980-01-01", + "placeOfBirth": "London", + "telephoneNumber": { + "telephoneNumber": "00000 000000" + }, + "relationshipToChild": "Uncle" + }, + "legalRepresentation": "Yes", + "solicitor": { + "firstName": "Tom", + "lastName": "Jones", + "email": "test@test.co.uk" + } + } + } + ], + "orders": { + "orderType": [ + "CARE_ORDER", + "CHILD_ASSESSMENT_ORDER" + ] + } + } + } +} diff --git a/service/src/integrationTest/resources/fixtures/caseNonC1ApplicationWithSubmittedC1WithSupplement.json b/service/src/integrationTest/resources/fixtures/caseNonC1ApplicationWithSubmittedC1WithSupplement.json new file mode 100644 index 00000000000..7f0ef796855 --- /dev/null +++ b/service/src/integrationTest/resources/fixtures/caseNonC1ApplicationWithSubmittedC1WithSupplement.json @@ -0,0 +1,111 @@ +{ + "case_details": { + "id": "2313", + "case_data": { + "submittedC1WithSupplement": { + "document": { + "document_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/eaabb925-7657-4a30-b397-5995171d0506", + "document_filename": "A_DOC_1.docx", + "document_binary_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/eaabb925-7657-4a30-b397-5995171d0506/binary" + }, + "supplementsBundle": [ + { + "id": "b7293735-f126-425e-a814-d98dcc29127d", + "value": { + "name": "C13A_SPECIAL_GUARDIANSHIP", + "notes": "asd", + "document": { + "document_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/b0093881-90f1-47b5-8213-edf700f00f48", + "document_filename": "A_DOC_2.docx", + "document_binary_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/b0093881-90f1-47b5-8213-edf700f00f48/binary" + }, + "documentAcknowledge": [ + "ACK_RELATED_TO_CASE" + ] + } + } + ], + "isDocumentUploaded": "YES", + "urgencyTimeFrameType": "SAME_DAY", + "supportingEvidenceBundle": [ + { + "id": "6b0bf1bb-6f2b-49ff-92dd-9da37afa467e", + "value": { + "name": "qwe", + "notes": "qwe", + "document": { + "document_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/23764a1e-a8fa-4049-9543-76bdba089c81", + "document_filename": "A_DOC_3.docx", + "document_binary_url": "http://dm-store-aat.service.core-compute-aat.internal/documents/23764a1e-a8fa-4049-9543-76bdba089c81/binary" + }, + "confidential": [], + "uploaderType": "DESIGNATED_LOCAL_AUTHORITY", + "needTranslation": "NO", + "uploaderCaseRoles": [ + "LASOLICITOR" + ], + "documentAcknowledge": [ + "ACK_RELATED_TO_CASE" + ], + "hasConfidentialAddress": "No" + } + } + ], + "clearSubmittedC1WithSupplement": "NO" + }, + "caseLocalAuthority": "test1", + "applicants": [ + { + "id": "99ceafd0-de4b-4725-b78b-7625342febed", + "value": { + "party": { + "email": { + "email": "applicant@email.com" + }, + "organisationName": "test organisation name" + } + } + } + ], + "respondents1": [ + { + "id": "d5eb6a70-d6d3-4eb6-b06e-9dc9d6360090", + "value": { + "party": { + "gender": "Male", + "address": { + "County": "", + "Country": "United Kingdom", + "PostCode": "RG4 7AA", + "PostTown": "Reading", + "AddressLine1": "Flat 2", + "AddressLine2": "Caversham House 15-17", + "AddressLine3": "Church Road" + }, + "lastName": "Bloggs", + "firstName": "Joe", + "dateOfBirth": "1980-01-01", + "placeOfBirth": "London", + "telephoneNumber": { + "telephoneNumber": "00000 000000" + }, + "relationshipToChild": "Uncle" + }, + "legalRepresentation": "Yes", + "solicitor": { + "firstName": "Tom", + "lastName": "Jones", + "email": "test@test.co.uk" + } + } + } + ], + "orders": { + "orderType": [ + "OTHER" + ], + "court": "117" + } + } + } +} diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementController.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementController.java new file mode 100644 index 00000000000..15985282534 --- /dev/null +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/EnterC1WithSupplementController.java @@ -0,0 +1,64 @@ +package uk.gov.hmcts.reform.fpl.controllers; + +import io.swagger.annotations.Api; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import uk.gov.hmcts.reform.ccd.client.model.AboutToStartOrSubmitCallbackResponse; +import uk.gov.hmcts.reform.ccd.client.model.CallbackRequest; +import uk.gov.hmcts.reform.ccd.client.model.CaseDetails; +import uk.gov.hmcts.reform.fpl.enums.YesNo; +import uk.gov.hmcts.reform.fpl.model.CaseData; +import uk.gov.hmcts.reform.fpl.model.common.SubmittedC1WithSupplementBundle; +import uk.gov.hmcts.reform.fpl.service.document.ManageDocumentService; + +import java.util.Optional; + +@Api +@RestController +@RequestMapping("/callback/enter-c1-with-supplement") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class EnterC1WithSupplementController extends CallbackController { + + private final ManageDocumentService manageDocumentService; + + private static final String SUBMITTED_C1_WITH_SUPPLEMENT_KEY = "submittedC1WithSupplement"; + + @PostMapping("/about-to-start") + public AboutToStartOrSubmitCallbackResponse handleAboutToStart( + @RequestBody CallbackRequest callbackRequest) { + final CaseData caseData = getCaseData(callbackRequest); + CaseDetails caseDetails = callbackRequest.getCaseDetails(); + + if (caseData.getSubmittedC1WithSupplement() != null) { + caseDetails.getData().put(SUBMITTED_C1_WITH_SUPPLEMENT_KEY, caseData.getSubmittedC1WithSupplement()); + } + + return respond(caseDetails); + } + + @PostMapping("/about-to-submit") + public AboutToStartOrSubmitCallbackResponse handleAboutToSubmit( + @RequestBody CallbackRequest callbackRequest) { + final CaseData caseData = getCaseData(callbackRequest); + CaseDetails caseDetails = callbackRequest.getCaseDetails(); + + if (YesNo.YES.getValue().equalsIgnoreCase(Optional.ofNullable(caseData.getSubmittedC1WithSupplement()) + .orElse(SubmittedC1WithSupplementBundle.builder().clearSubmittedC1WithSupplement(YesNo.NO.getValue()) + .build()) + .getClearSubmittedC1WithSupplement())) { + caseDetails.getData().remove(SUBMITTED_C1_WITH_SUPPLEMENT_KEY); + } else if (caseData.getSubmittedC1WithSupplement() != null) { + caseData.getSubmittedC1WithSupplement().getSupportingEvidenceBundle().forEach(seb -> { + seb.getValue().setUploaderCaseRoles(manageDocumentService.getUploaderCaseRoles(caseData)); + seb.getValue().setUploaderType(manageDocumentService.getUploaderType(caseData)); + }); + caseDetails.getData().put(SUBMITTED_C1_WITH_SUPPLEMENT_KEY, caseData.getSubmittedC1WithSupplement()); + } + + return respond(caseDetails); + } +} diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededController.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededController.java index f2b062facfe..dd52c310bcd 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededController.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/controllers/OrdersNeededController.java @@ -140,6 +140,8 @@ public AboutToStartOrSubmitCallbackResponse handleAboutToSubmitEvent( data.put("otherOrderType", "NO"); } + data.put("c1Application", YesNo.from(caseData.isC1Application()).getValue()); + if (caseData.getOrders() != null) { String courtCode = caseData.getOrders().getCourt(); Optional lookedUpCourt = courtLookUpService.getCourtByCode(courtCode); @@ -172,6 +174,10 @@ public AboutToStartOrSubmitCallbackResponse handleAboutToSubmitEvent( data.put("orders", data.get("ordersSolicitor")); } + if (caseData.isC1Application()) { + data.remove("submittedC1WithSupplement"); + } + return respond(caseDetails); } diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/Event.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/Event.java index 59946a301e2..9e1b759b247 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/Event.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/enums/Event.java @@ -29,7 +29,8 @@ public enum Event { APPLICATION_DOCUMENTS("uploadDocuments", "Upload documents"), SELECT_COURT("selectCourt", "Select court to issue"), ADD_URGENT_DIRECTIONS("addUrgentDirections", "Add urgent directions"), - JUDICIAL_GATEKEEPNIG("addGatekeepingOrder", "Judicial Gatekeeping"); + JUDICIAL_GATEKEEPNIG("addGatekeepingOrder", "Judicial Gatekeeping"), + C1_WITH_SUPPLEMENT("enterC1WithSupplement", "C1 with Supplement"); private final String id; private final String name; diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/model/CaseData.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/CaseData.java index 9c733729270..fa621b77075 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/model/CaseData.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/CaseData.java @@ -46,6 +46,7 @@ import uk.gov.hmcts.reform.fpl.model.common.EmailAddress; import uk.gov.hmcts.reform.fpl.model.common.JudgeAndLegalAdvisor; import uk.gov.hmcts.reform.fpl.model.common.OtherApplicationsBundle; +import uk.gov.hmcts.reform.fpl.model.common.SubmittedC1WithSupplementBundle; import uk.gov.hmcts.reform.fpl.model.common.dynamic.DynamicList; import uk.gov.hmcts.reform.fpl.model.configuration.Language; import uk.gov.hmcts.reform.fpl.model.document.SealType; @@ -282,6 +283,7 @@ public DynamicList buildRespondentDynamicList() { private final Hearing hearing; private final HearingPreferences hearingPreferences; private final InternationalElement internationalElement; + private final SubmittedC1WithSupplementBundle submittedC1WithSupplement; @JsonProperty("documents_socialWorkOther") private final List> otherSocialWorkDocuments; diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/model/common/SubmittedC1WithSupplementBundle.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/common/SubmittedC1WithSupplementBundle.java new file mode 100644 index 00000000000..a45213f192b --- /dev/null +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/model/common/SubmittedC1WithSupplementBundle.java @@ -0,0 +1,34 @@ +package uk.gov.hmcts.reform.fpl.model.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import uk.gov.hmcts.reform.fpl.enums.UrgencyTimeFrameType; +import uk.gov.hmcts.reform.fpl.enums.YesNo; +import uk.gov.hmcts.reform.fpl.model.Supplement; +import uk.gov.hmcts.reform.fpl.model.SupportingEvidenceBundle; + +import java.util.List; + +@Data +@Builder +@AllArgsConstructor +public class SubmittedC1WithSupplementBundle { + private final DocumentReference document; + private final UrgencyTimeFrameType urgencyTimeFrameType; + private List> supportingEvidenceBundle; + private final List> supplementsBundle; + private final String clearSubmittedC1WithSupplement; + private final String isDocumentUploaded; + + public String getClearSubmittedC1WithSupplement() { + if (clearSubmittedC1WithSupplement != null) { + return this.clearSubmittedC1WithSupplement; + } + return document != null ? YesNo.NO.getValue().toUpperCase() : null; + } + + public String getIsDocumentUploaded() { + return YesNo.from(document != null).getValue().toUpperCase(); + } +} diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java index e3b0ae39079..5c7aecd044e 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/TaskListRenderer.java @@ -24,6 +24,7 @@ import static org.apache.commons.lang3.ObjectUtils.isEmpty; import static uk.gov.hmcts.reform.fpl.enums.Event.ALLOCATION_PROPOSAL; import static uk.gov.hmcts.reform.fpl.enums.Event.APPLICATION_DOCUMENTS; +import static uk.gov.hmcts.reform.fpl.enums.Event.C1_WITH_SUPPLEMENT; import static uk.gov.hmcts.reform.fpl.enums.Event.CASE_NAME; import static uk.gov.hmcts.reform.fpl.enums.Event.CHILDREN; import static uk.gov.hmcts.reform.fpl.enums.Event.COURT_SERVICES; @@ -114,6 +115,7 @@ private List groupInSections(List allTasks, Optional getEvents(CaseData caseData) { if (!caseData.isC1Application()) { events.add(INTERNATIONAL_ELEMENT); events.add(LANGUAGE_REQUIREMENTS); + if (isNotEmpty(caseData.getOrders()) && isNotEmpty(caseData.getOrders().getOrderType())) { + events.add(C1_WITH_SUPPLEMENT); + } } return events; diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/document/ManageDocumentService.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/document/ManageDocumentService.java index 974dac08233..5836a7110d2 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/document/ManageDocumentService.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/document/ManageDocumentService.java @@ -200,8 +200,12 @@ private Object getDocumentListHolder(String fieldName, CaseData caseData) throws } } + public List getUploaderCaseRoles(CaseData caseData) { + return new ArrayList<>(userService.getCaseRoles(caseData.getId())); + } + public DocumentUploaderType getUploaderType(CaseData caseData) { - final Set caseRoles = userService.getCaseRoles(caseData.getId()); + final List caseRoles = getUploaderCaseRoles(caseData); if (caseRoles.stream().anyMatch(representativeSolicitors()::contains)) { return SOLICITOR; } @@ -393,7 +397,7 @@ private void uploadPlacementResponse(Map changes, DocumentUpload .type(recipientType) .response(e.getValue().getDocument()) .uploaderType(uploaderType) - .uploaderCaseRoles(new ArrayList<>(userService.getCaseRoles(caseData.getId()))) + .uploaderCaseRoles(getUploaderCaseRoles(caseData)) .translationRequirements(e.getValue().getTranslationRequirements()) .build())); caseData.setPlacementNoticeResponses(placementNoticeResponses); @@ -443,7 +447,7 @@ public void uploadGenericDocuments(Map changes, DocumentType dt, } UploadBundle bundle = UploadBundle.builder().document(e.getValue().getDocument()) .uploaderType(uploaderType) - .uploaderCaseRoles(new ArrayList<>(userService.getCaseRoles(caseData.getId()))) + .uploaderCaseRoles(getUploaderCaseRoles(caseData)) .translationRequirement(e.getValue().getTranslationRequirements()) .confidential(confidential) .build(); diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementChecker.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementChecker.java new file mode 100644 index 00000000000..c79a57e88ed --- /dev/null +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementChecker.java @@ -0,0 +1,43 @@ +package uk.gov.hmcts.reform.fpl.service.validators; + +import org.springframework.stereotype.Component; +import uk.gov.hmcts.reform.fpl.model.CaseData; +import uk.gov.hmcts.reform.fpl.model.common.SubmittedC1WithSupplementBundle; +import uk.gov.hmcts.reform.fpl.model.tasklist.TaskState; + +import java.util.List; + +import static java.util.Collections.emptyList; +import static org.apache.commons.lang3.ObjectUtils.isEmpty; +import static uk.gov.hmcts.reform.fpl.model.tasklist.TaskState.COMPLETED_FINISHED; +import static uk.gov.hmcts.reform.fpl.service.validators.EventCheckerHelper.anyEmpty; +import static uk.gov.hmcts.reform.fpl.service.validators.EventCheckerHelper.anyNonEmpty; + +@Component +public class C1WithSupplementChecker implements EventChecker { + + @Override + public List validate(CaseData caseData) { + return emptyList(); + } + + @Override + public boolean isStarted(CaseData caseData) { + final SubmittedC1WithSupplementBundle submittedC1WithSupplement = caseData.getSubmittedC1WithSupplement(); + if (isEmpty(submittedC1WithSupplement)) { + return false; + } + return anyNonEmpty(submittedC1WithSupplement.getDocument()); + } + + @Override + public boolean isCompleted(CaseData caseData) { + final SubmittedC1WithSupplementBundle submittedC1WithSupplement = caseData.getSubmittedC1WithSupplement(); + return !(submittedC1WithSupplement == null || anyEmpty(submittedC1WithSupplement.getDocument())); + } + + @Override + public TaskState completedState() { + return COMPLETED_FINISHED; + } +} diff --git a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/EventsChecker.java b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/EventsChecker.java index 995d0e67e77..3378a0bbfea 100644 --- a/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/EventsChecker.java +++ b/service/src/main/java/uk/gov/hmcts/reform/fpl/service/validators/EventsChecker.java @@ -14,6 +14,7 @@ import static java.util.Optional.ofNullable; import static uk.gov.hmcts.reform.fpl.enums.Event.ALLOCATION_PROPOSAL; import static uk.gov.hmcts.reform.fpl.enums.Event.APPLICATION_DOCUMENTS; +import static uk.gov.hmcts.reform.fpl.enums.Event.C1_WITH_SUPPLEMENT; import static uk.gov.hmcts.reform.fpl.enums.Event.CASE_NAME; import static uk.gov.hmcts.reform.fpl.enums.Event.CHILDREN; import static uk.gov.hmcts.reform.fpl.enums.Event.COURT_SERVICES; @@ -78,6 +79,9 @@ public class EventsChecker { @Autowired private InternationalElementChecker internationalElementChecker; + @Autowired + private C1WithSupplementChecker c1WithSupplementChecker; + @Autowired private OthersChecker othersChecker; @@ -110,6 +114,7 @@ public void init() { eventCheckers.put(FACTORS_AFFECTING_PARENTING, factorsAffectingParentingChecker); eventCheckers.put(OTHER_PROCEEDINGS, proceedingsChecker); eventCheckers.put(INTERNATIONAL_ELEMENT, internationalElementChecker); + eventCheckers.put(C1_WITH_SUPPLEMENT, c1WithSupplementChecker); eventCheckers.put(OTHERS, othersChecker); eventCheckers.put(COURT_SERVICES, courtServiceChecker); eventCheckers.put(LANGUAGE_REQUIREMENTS, languageRequirementsChecker); diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java index 21a7ce626a2..5052af8b43c 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/TaskListServiceTest.java @@ -12,6 +12,7 @@ import uk.gov.hmcts.reform.fpl.enums.Event; import uk.gov.hmcts.reform.fpl.enums.YesNo; import uk.gov.hmcts.reform.fpl.model.CaseData; +import uk.gov.hmcts.reform.fpl.model.Orders; import uk.gov.hmcts.reform.fpl.model.tasklist.Task; import uk.gov.hmcts.reform.fpl.model.tasklist.TaskState; import uk.gov.hmcts.reform.fpl.service.validators.EventsChecker; @@ -30,6 +31,7 @@ import static org.mockito.Mockito.when; import static uk.gov.hmcts.reform.fpl.enums.Event.ALLOCATION_PROPOSAL; import static uk.gov.hmcts.reform.fpl.enums.Event.APPLICATION_DOCUMENTS; +import static uk.gov.hmcts.reform.fpl.enums.Event.C1_WITH_SUPPLEMENT; import static uk.gov.hmcts.reform.fpl.enums.Event.CASE_NAME; import static uk.gov.hmcts.reform.fpl.enums.Event.CHILDREN; import static uk.gov.hmcts.reform.fpl.enums.Event.COURT_SERVICES; @@ -47,11 +49,12 @@ import static uk.gov.hmcts.reform.fpl.enums.Event.RISK_AND_HARM; import static uk.gov.hmcts.reform.fpl.enums.Event.SELECT_COURT; import static uk.gov.hmcts.reform.fpl.enums.Event.SUBMIT_APPLICATION; +import static uk.gov.hmcts.reform.fpl.enums.OrderType.CARE_ORDER; +import static uk.gov.hmcts.reform.fpl.enums.OrderType.CHILD_ASSESSMENT_ORDER; import static uk.gov.hmcts.reform.fpl.model.tasklist.Task.task; import static uk.gov.hmcts.reform.fpl.model.tasklist.TaskState.IN_PROGRESS; import static uk.gov.hmcts.reform.fpl.model.tasklist.TaskState.NOT_AVAILABLE; - @ExtendWith(SpringExtension.class) class TaskListServiceTest { @@ -193,6 +196,60 @@ void shouldReturnNotAvailableTasks(boolean multiCourts) { } } + @Nested + class C1Application { + @Test + void shouldNotContainC1WithSupplementEventIfNotC1Application() { + when(caseData.isC1Application()).thenReturn(true); + when(caseData.getOrders()).thenReturn(Orders.builder().orderType( + List.of(CHILD_ASSESSMENT_ORDER) + ).build()); + + when(eventsChecker.isInProgress(any(Event.class), eq(caseData))).thenReturn(true); + when(eventsChecker.isCompleted(any(Event.class), eq(caseData))).thenReturn(false); + + final List actualTasks = taskListService.getTasksForOpenCase(caseData); + assertThat(actualTasks).isNotEmpty().doesNotContain(task(C1_WITH_SUPPLEMENT, IN_PROGRESS)); + } + + @Test + void shouldNotContainC1WithSupplementEventIfOrderDoesNotExist() { + when(caseData.isC1Application()).thenReturn(false); + when(caseData.getOrders()).thenReturn(null); + + when(eventsChecker.isInProgress(any(Event.class), eq(caseData))).thenReturn(true); + when(eventsChecker.isCompleted(any(Event.class), eq(caseData))).thenReturn(false); + + final List actualTasks = taskListService.getTasksForOpenCase(caseData); + assertThat(actualTasks).isNotEmpty().doesNotContain(task(C1_WITH_SUPPLEMENT, IN_PROGRESS)); + } + + @Test + void shouldNotContainC1WithSupplementEventIfOrderTypeDoesNotExist() { + when(caseData.isC1Application()).thenReturn(false); + when(caseData.getOrders()).thenReturn(Orders.builder().orderType(null).build()); + + when(eventsChecker.isInProgress(any(Event.class), eq(caseData))).thenReturn(true); + when(eventsChecker.isCompleted(any(Event.class), eq(caseData))).thenReturn(false); + + final List actualTasks = taskListService.getTasksForOpenCase(caseData); + assertThat(actualTasks).isNotEmpty().doesNotContain(task(C1_WITH_SUPPLEMENT, IN_PROGRESS)); + } + + @Test + void shouldContainC1WithSupplementEventIfNotC1Application() { + when(caseData.isC1Application()).thenReturn(false); + when(caseData.getOrders()).thenReturn(Orders.builder().orderType( + List.of(CARE_ORDER) + ).build()); + + when(eventsChecker.isInProgress(any(Event.class), eq(caseData))).thenReturn(true); + when(eventsChecker.isCompleted(any(Event.class), eq(caseData))).thenReturn(false); + + final List actualTasks = taskListService.getTasksForOpenCase(caseData); + assertThat(actualTasks).isNotEmpty().contains(task(C1_WITH_SUPPLEMENT, IN_PROGRESS)); + } + } @Nested class DischargeOfCareOrder { diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementCheckerTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementCheckerTest.java new file mode 100644 index 00000000000..3db88169a01 --- /dev/null +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/C1WithSupplementCheckerTest.java @@ -0,0 +1,110 @@ +package uk.gov.hmcts.reform.fpl.service.validators; + +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.junit.jupiter.MockitoExtension; +import uk.gov.hmcts.reform.fpl.model.CaseData; +import uk.gov.hmcts.reform.fpl.model.common.DocumentReference; +import uk.gov.hmcts.reform.fpl.model.common.SubmittedC1WithSupplementBundle; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; +import static uk.gov.hmcts.reform.fpl.model.tasklist.TaskState.COMPLETED_FINISHED; + +@ExtendWith(MockitoExtension.class) +class C1WithSupplementCheckerTest { + + private static final CaseData ANY_CASE_DATA = mock(CaseData.class); + + @InjectMocks + private C1WithSupplementChecker c1WithSupplementChecker; + + @Test + void testValidate() { + assertThat(c1WithSupplementChecker.validate(ANY_CASE_DATA)).isEmpty(); + } + + @Test + void testCompletedState() { + assertThat(c1WithSupplementChecker.completedState()).isEqualTo(COMPLETED_FINISHED); + } + + @Nested + class IsCompleted { + + @Test + void shouldReturnEmptyErrorsAndNonCompletedStateIfSubmittedC1WithSupplementIsNull() { + final CaseData caseData = CaseData.builder() + .submittedC1WithSupplement(null) + .build(); + + final boolean isCompleted = c1WithSupplementChecker.isCompleted(caseData); + + assertThat(isCompleted).isFalse(); + } + + @Test + void shouldReturnEmptyErrorsAndNonCompletedState() { + final CaseData caseData = CaseData.builder() + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .document(null) + .build()) + .build(); + + final boolean isCompleted = c1WithSupplementChecker.isCompleted(caseData); + + assertThat(isCompleted).isFalse(); + } + + @Test + void shouldReturnEmptyErrorsAndCompletedState() { + final CaseData caseData = CaseData.builder() + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .document(DocumentReference.builder().filename("ABC.docx").build()) + .build()) + .build(); + + final boolean isCompleted = c1WithSupplementChecker.isCompleted(caseData); + + assertThat(isCompleted).isTrue(); + } + } + + @Nested + class IsStarted { + + @Test + void shouldReturnFalse() { + final CaseData caseData = CaseData.builder() + .caseName("Test") + .build(); + + assertThat(c1WithSupplementChecker.isStarted(caseData)).isFalse(); + } + + @Test + void shouldReturnTrue() { + final CaseData caseData = CaseData.builder() + .caseName("Test") + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .document(DocumentReference.builder().filename("ABC.docx").build()) + .build()) + .build(); + + assertThat(c1WithSupplementChecker.isStarted(caseData)).isTrue(); + } + + @Test + void shouldReturnFalseIfDocumentIsNull() { + final CaseData caseData = CaseData.builder() + .caseName("Test") + .submittedC1WithSupplement(SubmittedC1WithSupplementBundle.builder() + .build()) + .build(); + + assertThat(c1WithSupplementChecker.isStarted(caseData)).isFalse(); + } + } +} diff --git a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/EventsCheckerTest.java b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/EventsCheckerTest.java index c779f0e0a24..e1114a001e6 100644 --- a/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/EventsCheckerTest.java +++ b/service/src/test/java/uk/gov/hmcts/reform/fpl/service/validators/EventsCheckerTest.java @@ -27,6 +27,7 @@ import static org.mockito.Mockito.when; import static uk.gov.hmcts.reform.fpl.enums.Event.ALLOCATION_PROPOSAL; import static uk.gov.hmcts.reform.fpl.enums.Event.APPLICATION_DOCUMENTS; +import static uk.gov.hmcts.reform.fpl.enums.Event.C1_WITH_SUPPLEMENT; import static uk.gov.hmcts.reform.fpl.enums.Event.CASE_NAME; import static uk.gov.hmcts.reform.fpl.enums.Event.CHILDREN; import static uk.gov.hmcts.reform.fpl.enums.Event.COURT_SERVICES; @@ -89,6 +90,8 @@ class EventsCheckerTest { private LanguageRequirementsChecker languageRequirementsChecker; @MockBean private CourtSelectionChecker courtSelectionChecker; + @MockBean + private C1WithSupplementChecker c1WithSupplementChecker; @Autowired private EventsChecker eventsChecker; @@ -164,7 +167,8 @@ void verifyNoMoreInteractionsWithValidators() { courtServiceChecker, factorsAffectingParentingChecker, languageRequirementsChecker, - courtSelectionChecker); + courtSelectionChecker, + c1WithSupplementChecker); } private Stream getEventsValidators() { @@ -187,7 +191,8 @@ private Stream getEventsValidators() { Arguments.of(COURT_SERVICES, courtServiceChecker), Arguments.of(FACTORS_AFFECTING_PARENTING, factorsAffectingParentingChecker), Arguments.of(LANGUAGE_REQUIREMENTS, languageRequirementsChecker), - Arguments.of(SELECT_COURT, courtSelectionChecker)); + Arguments.of(SELECT_COURT, courtSelectionChecker), + Arguments.of(C1_WITH_SUPPLEMENT, c1WithSupplementChecker)); } }