Skip to content

Commit

Permalink
PET-1.1.2.3 (#403)
Browse files Browse the repository at this point in the history
* Ret-3814 continously improvement, resolving PDF Mapper sonar lint problems  (#393)

* RET-3506 (#370)

* RET-3476 Elastic search max limit update (#334)

* Updated elastic search max size to 10000

* Updated elastic search max size to 10000

* RET-3476 Resolving Vulnerabilities (#337)

* Updated elastic search max size to 10000

* Updated elastic search max size to 10000

* Updated elastic search max size to 10000

* RET-3476 Functional Test Update (#338)

* Updated elastic search max size to 10000

* Updated elastic search max size to 10000

* Updated elastic search max size to 10000

* Functional test update. A user case list should return only one case when any case_id is given.

* Functional test update. A user case list should return at least one case when any case_id is given.

* RET-3098 - Java and app insights update (#333)

* RET-3098

* RET-3098

* RET-3098

* RET-3098

* RET-3098

* RET-3098

* RET-3098

* RET-3098

* RET-3098

---------

Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: Mehmet Tahir Dede <105645217+JustMehmet@users.noreply.github.com>

* Ret 3098 (#339)

* RET-3495 Adding timeout to functional test (#345)

* Add timeout to functional test stage3GetAllCaseDetailsShouldReturnAllCaseDetails

* Bumping chart version/ fixing aliases

* Implemented line 81 as SECONDS.sleep, not to have LawOfDemeter problem on pmd check.

* Implemented line 81 as SECONDS.sleep, not to have LawOfDemeter problem on pmd check.

---------

Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>

* Merge master into pet (#349)

* Update all dependencies (#323)

* Update all dependencies

* Bumping chart version/ fixing aliases

* Update gradle-wrapper.properties

* Bumping chart version/ fixing aliases

* Fix breaking versions

* Bump commons-fileupload

* Remove suppression

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>

* ES Fix (#341)

* Add timeout to functional test (#344)

* Add timeout to functional test

* Remove body

* CVE Fixes (#348)

* Checkstyle

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* RET-3613 (#368)

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Updates for PDFMapperUtil and Code beautify.

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

* Merged Updates

---------

Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>
Co-authored-by: Cindy Chan <94921454+cindychmcts@users.noreply.github.com>

* RET-3702 (#384)

* CVE fix

* CVE fix

* CVE fix

* CVE fix

---------

Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>

* build fix (#389)

Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>

* Update build.gradle (#392)

* Update build.gradle

* Update build.gradle

* Update suppressions.xml

* Changed packages of the exception(PdfServiceException) and model(PdfDecodedMultipartFile) classes

* Changed name of the class PdfMapperEmploymentUtil to PdfMapperEmploymentDetailsUtil

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

* Sonar Lint Updates

---------

Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>
Co-authored-by: Cindy Chan <94921454+cindychmcts@users.noreply.github.com>

* Update for correction of No Acas Certificate reason

* Update for correction of No Acas Certificate reason

* Update for correction of No Acas Certificate reason

* Update for correction of No Acas Certificate reason

* Update for correction of No Acas Certificate reason

* Update for the name of the field Respondent 4 Address as 13 R4 number

* Pet 1.1.2.3  mergemaster (#417)

* Update terraform provider version (#416)

* Release-1.2  (#242)

* chore(deps): update all dependencies (#159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* RET-2643 (#185)

* chore(deps): update all dependencies (#159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* RET-2643

* RET-2643

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>

* caseTypeId removed from log as it is null (#186)

* Added pound symbol and line seperators (#188)

* RET-2792 (#192)

* RET-2792 - revert changes (#197)

* RET-2792 (#196)

* RET-2731: Mock out ACAS Service tests and improve logging in et-sya-api (#190)

* RET-2731: Mock AcasService tests

* RET-2731: Add logs to AcasService attemptWithRetriesToFetchAcasCertificates()

* RET-2731: change acas apie key to dummy

* RET-2731: Checkstyle fixes

* RET-2731: Remove disabled annotation

Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>

* Ret 2800 (#195)

* RET-2800: Supporting Document not present in documentCollection

* RET-2800: Fixed pmd

* moved method to CaseDocumentService

* Ret 2783 Welsh translation content - Generate Welsh pdf claim form (#191)

* RET-2783: Added welsh PDF case file generation if the user has selected to be contacted in welsh

* Fix broken unit tests

* added welsh tests

* fixed welsh tests to work with differant language generations

* minor review comments

* fixed breaking change, changing pdf document name

* fixed build issues

Co-authored-by: Jack Brogan <jack.brogan@hmcts.net>
Co-authored-by: paul.peasegood <paul.peasegood@version1.com>

* Ret 2800 2 (#198)

* RET-2800: Supporting Document not present in documentCollection

* RET-2800: Fixed pmd

* moved method to CaseDocumentService

* RET-2800: Added test coverage

* Ret 2792 new (#200)

* Ret 2792 new (#201)

* Ret 2846 (#202)

* Updates for PDF Creation

* Updates for PDF Creation

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Removed suppressed vulnerability and changed spring-cloud-starter-openfeign version from 3.1.2 to 3.1.5

* Removed suppressed vulnerability

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.13.4.1' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding   implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Ret 2864 postcode and test updates - javadoc Implementation (#205)

* Updates for PDF Creation

* Updates for PDF Creation

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Removed suppressed vulnerability and changed spring-cloud-starter-openfeign version from 3.1.2 to 3.1.5

* Removed suppressed vulnerability

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.13.4.1' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding   implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Updated tests added new postcode formatter to PdfMapperUtil

* Updated tests added new postcode formatter to PdfMapperUtil

* Added Javadocs to PdfMapperUtil

* Added Javadocs to PdfMapperUtil

* Added Javadocs to PdfMapperUtil

* Changed convertFirstCharactersToCapitalCase method name to convertFirstCharactersOfWordsToCapitalCase

* Updates for country list of UK. (#206)

* Handling null values (#204)

* Fixed missing imports

* Refactored test

* Merge1.1.0.2 into welsh (#208)

* RET-2643 (#185)

* chore(deps): update all dependencies (#159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* RET-2643

* RET-2643

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>

* caseTypeId removed from log as it is null (#186)

* Added pound symbol and line seperators (#188)

* RET-2792 (#192)

* RET-2792 - revert changes (#197)

* RET-2731: Mock out ACAS Service tests and improve logging in et-sya-api (#190)

* RET-2731: Mock AcasService tests

* RET-2731: Add logs to AcasService attemptWithRetriesToFetchAcasCertificates()

* RET-2731: change acas apie key to dummy

* RET-2731: Checkstyle fixes

* RET-2731: Remove disabled annotation

Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>

* Ret 2800 (#195)

* RET-2800: Supporting Document not present in documentCollection

* RET-2800: Fixed pmd

* moved method to CaseDocumentService

* Ret 2800 2 (#198)

* RET-2800: Supporting Document not present in documentCollection

* RET-2800: Fixed pmd

* moved method to CaseDocumentService

* RET-2800: Added test coverage

* Ret 2846 (#202)

* Updates for PDF Creation

* Updates for PDF Creation

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Removed suppressed vulnerability and changed spring-cloud-starter-openfeign version from 3.1.2 to 3.1.5

* Removed suppressed vulnerability

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.13.4.1' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding   implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Ret 2864 postcode and test updates - javadoc Implementation (#205)

* Updates for PDF Creation

* Updates for PDF Creation

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Suppressed jackson core - jackson databind@2.13.4
NOTE: this is a new vulnerability defined on 17/NOV/2022 details are defined in the url https://nvd.nist.gov/vuln/detail/CVE-2022-42003

* Removed suppressed vulnerability and changed spring-cloud-starter-openfeign version from 3.1.2 to 3.1.5

* Removed suppressed vulnerability

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.13.4.1' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Vulnerability CVE-2022-42003 is resolved by adding   implementation group: 'com.fasterxml.jackson.core', name:  'jackson-databind', version: '2.14.0' to the dependencies section of build.gradle at line 220. Besides upgraded depreciated main definition on line 326

* Updated tests added new postcode formatter to PdfMapperUtil

* Updated tests added new postcode formatter to PdfMapperUtil

* Added Javadocs to PdfMapperUtil

* Added Javadocs to PdfMapperUtil

* Added Javadocs to PdfMapperUtil

* Changed convertFirstCharactersToCapitalCase method name to convertFirstCharactersOfWordsToCapitalCase

* Updates for country list of UK. (#206)

* Update CaseService.java

Update CaseService.java

* Refactored test

* Checkstyle

Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: ikirsanov <105438011+ikirsanov@users.noreply.github.com>
Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>
Co-authored-by: robin-ieong <101253854+robin-ieong@users.noreply.github.com>
Co-authored-by: Mehmet Tahir Dede <105645217+JustMehmet@users.noreply.github.com>

* Test fix

* Test fix

Test fix

* RET-2750: Add functional tests to controllers classes (#203)

* RET-2750: Add DocumentUpload functional test

* RET-2750: Chekstyle fix

* RET-2750: Chekstyle fix

* RET-2750: Add vulnerability issue fix

* RET-2750: Change multipart params

* RET-2750: CheckStyle

* RET-2750: multipart content type

* RET-2750: Add functional tests to DocumentUploadController

* RET-2750: Add functional tests for DocumentController

* RET-2750: Fix DocumentControllerFunctionalTest

* RET-2750: Add AcasControllerFunctionalTest

Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>

* RET-2574: Add manageOffice assignment before case submitted (#178)

* chore(deps): update all dependencies (#159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* RET-2574: Add manageOffice assignment before case submitted

* RET-2574: Rename case assignment to local office service and move it to service package

* RET-2574: checkStyle test fixes

* RET-2574: checkStyle test fixes

* RET-2574: Fix assigning case to local office logic, remove unused imports

* RET-2574: Add suppressions for spring security and tomcat

* RET-2574: Set @disable to AcasService tests

* RET-2574: Add in convertCaseRequestToCaseDataWithTribunalOffice managingOffice assignment to caseRequest

* RET-2574: getManagingOffice returns Unassigned if invalidPostcodeException thrown

* RET-2574: checkstyle fix

* RET-2574: Remove suppressions

* RET-2574: AcasServiceTest fix

* RET-2574: AcasServiceTest fix

* RET-2574: Refactor condition in assingCaseToLocalOfficeService

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>

* Fix disability claim (#209)

* claimantInd null values (#214)

* Keeping sonar happy (#215)

* claimantInd null values

* sonar checks

* sonar checks

* RET-2877 - Null check for contact language (#212)

* Null check for contact language

* Refactor notification service

* Use Welsh language constant

* RET-2871 fix (#217)

* RET-2818. Update et-data-model version to add hearing language preference. (#211)

* cve (#220)

* cve

* cve suppressions

* cve suppressions

* cve suppressions

* RET-2848 (#219)

* Et data model update (#225)

* Ret 2864 add java docs to public/protected elements (#224)

* 2864: add javadocs to classes

* 2864: add jdocs

* 2864: add more jdocs

* 2864: add jdocs and fix issues

* 2864: fix merge and pmd

* Release 1.1.0.2 (#207) (#226)

All code merged for Release 1.1.0.2.

- Referral Enhancements
- Initial Consideration Enhancements
- Bug Fixes
- ECM fixes/enhancements

Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: Marc Judge <marc.judge@version1.com>

* Add file extension (#227)

* Add file extension

* Fix checkstyle

* Bump spring boot

Co-authored-by: Marc Judge <marc.judge@version1.com>

* Acas cert logging removed (#232)

* welsh doc template updated (#233)

* Allow all test responses (#239)

Co-authored-by: Marc Judge <marc.judge@version1.com>

* RET-3045: Fix for respondent details being reset (#238)

* RET-3045: Fix for respondent details being reset

* Fix for CVEs

* Fix for CVEs

* Fix for checkstyle

* Refactered to not use var type

* 1.2 - Dependency bump (#240)

* Bump patch

* Add CVE

* New CVEs

* bump additional

* Remove CVE and bump tomcat

* Remove outdated suppressions

* Bump spring-security-crypto

* Remove outdated supressions

* Remove spring suppressions

Co-authored-by: Marc Judge <marc.judge@version1.com>

* RET-2616. Create submit-claimant-application endpoint. (#245)

* RET-2616. Create submit-claimant-application endpoint.

* Bump et-data-model

Co-authored-by: Marc Judge <marc.judge@version1.com>

* Bump data model (#257)

* Update Welsh email template to prod (#259)

* RET-2289: Et-common version bump to 1.0.11 (#260)

* RET-2289 (#261)

* RET-2289: Et-common version bump to 1.0.11

* RET-2289: et-common version bump to 1.0.13

* RET-2296 (#262)

* RET-2296

RET-2296

RET-2296

Update Chart.yaml

* Chart update

* Ret 2816 - Create PDF CYA page for 'Contact the Tribunal about something else' (#243)

* RET-2616/7. Interim commit - define caseEvent for submitting an application - need to actually create the endpoints for the frontend that triggers the event.

* 2816: add Tse SYA pdf create

* 2816: add test

* 2816: add tests

* 2816: refactor code to upload pdf to dm-store

* 2816: refactor code into function

* 2816: add tests for new changes

* 2816: create fixes for gradle build issues

* FRET-2816. Fix PMD

* FRET-2816. Move tse pdf generation to the tse endpoint

* FRET-2816. Fix tests.

* RET-2816. Fix imports.

* RET-2816. Clean with builder

* RET-2816. Fix checkstyle

* RET-2816. Try bumping chart up

* Add application form to document collection

* RET-2816. Fix tests

* RET-2816. Add logic deciding when to generate and upload the document

* RET-2816. Fix PMD issue

* Order imports

* Initialize empty document collection

* Change is_type_c to type_c

---------

Co-authored-by: Itay-Kirsh <Itayk747@gmail.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>

* RET-2758 (#270)

* Send acknowledgement email to claimant

* RET-2758: Add Changes to NotificationsHelper, ManageCaseControllerTest, CaseServiceTest and caseDetails.json files to fix the unit tests

* RET-2758: Remove spacings, uncomment the sendnotifications lines

* RET-2758: Format NotificationServiceTest

* RET-2758: Fix checkstyle

* RET-2758: Merge conflict solving

* RET-2758: Fix checkstyle

* RET-2758: Fix PMD rules

* Simplify notification service

---------

Co-authored-by: Marc Judge <marc.judge@version1.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>

* Fix caseId (#273)

* Ret 2816 fix uploading of documents

* RET-2816 upload the supporting document to the document list

* Fix checkstyles

* Fix type of document to be one of the set list.

* Make sure supporting document uploaded regardless of application overview pdf.

* Fix returning new case details when submitting application

* Fix build (#276)

* Add null check (#277)

* RET-2815 + RET-2814 (#278)

* Add emails to respondent and tribunal

* Add test coverage

* Add application service tests

* Fix code smells

* Add Notifications Helper tests

* Add hearing date tests

* Fix more smells

* Get CYA doc from doc collection

* Fix tribunal email

* Fix up issues

* Add logging and handling (#280)

* Suppress CVE (#282)

* CVEs

* CVEs

* Fix respondent email sending

* Chart

* Update app insights key (#284)

* Chart

* Bump packages (#286)

* Bump minor + checkstyle + pmd

* Add all plugin updated and new PMD rules

* Fix merge commit (#290)

* Fix merge issues (#288)

* Ret 2785 - Endpoint for saving claimant response to application from respondent (#289)

* Create Respond to Application endpoint

* Add unit tests and refactor

* Small fixes

* Add integration tests

* Use SUBMIT_CLAIAMNT_TSE event (#295)

* Update all dependencies (#296)

* Update all dependencies

* Remove breaking updates

* remove suppressions

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>

* Ret 2786 final (#299)

* Use SUBMIT_CLAIAMNT_TSE event

* Use CLAIMANT_TSE_RESPOND event

* Fix saving doc upload (#300)

* ACAS Claimant Request Docs

* Revert "ACAS Claimant Request Docs"

This reverts commit 703d25d.

* ACAS Claimant Request Docs

* Send response email to Tribunal (#302)

Co-authored-by: Marc Judge <marc.judge@version1.com>

* Update all dependencies (#301)

* Update all dependencies

* Update gradle-wrapper.properties

* Update build.gradle

* Update snake yaml cve

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: Marc Judge <marc.judge@version1.com>

* RET-3356: Fix for View All Application page not displaying full app type (#304)

* RET-3356: Fix for View All Application page not displaying full app type

* Fixed checkstyle

* Fixed PMD

* RET-3055 (#313)

* RET-3055: Change retention period to 78 weeks from 52

* RET-3055: Fix dependencies versions

* RET-3055, add suppressions

* RET-3055, bump tomcat version

* RET-3055, add suppressions

* RET-3055, remove suppression

* RET 2827 - email to Claimant for Responding to an application (#315)

* add email acknowledgement

* test: add unit tests for added notification service method

* add missing java doc param

* bump spring framework version

* bump tomcat-embed versions to 9.0.73

* add claimant portal url to email

* Update all dependencies (#318)

* Update all dependencies

* Update gradle-wrapper.properties

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>

* Ret 2826 (#316)

* Create pdf of claimant response to application

* Fix checkstyle and pmd

* Add unit tests

* Add java docs

* RET-2927 (#319)

* RET-2729: Update sendNotification state to 'viewed'

* RET-2729: Fix tests imports

* RET-2729: Fix checkstyle

* RET-2729: Fix checkstyle

* RET-2729: PMD rules

* RET-2729: Code review changes on SendNotificationService logic-added startEventResponse before submitUpdate

* Ret 2829 Apps & Case Mgmt common – Generate email notification to Respondent when Claimant responds to an application (#321)

* RET-2829 added sendResponseEmailToRespondent

* RET-2829 added unit tests

* RET-2829 review comments

* RET-2829 fix PMD issues

* RET-2829 reivew comments

* RET-2829 update ruleset

* RET-2829 minor formating

---------

Co-authored-by: Paul.Peasegood@hmcts.net <paulp@LAPTOP4439.V1.com>

* Update values.yaml

* RET-3464 - Mergefix (#327)

* PET-1.1.1.2 ET-PET PI29 Sprint 3 (#297)

* Update for the service getAllUserCases to convert it to elastic search (#293)

* RET-2961 - wrong pdf template (#298)

* Update CaseServiceTest.java

* ret-3168 implementation reimported to new branch (#305)

* ret-3168 implementation reimported to new branch

* Bumping chart version/ fixing aliases

* template ids updated

Template ids are updated for case submission emails. Also, new id is added for doc upload error email.  All three email template ids are for prod environment.

* user selected language check logic corrected

* prod template ids restored

---------

Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>

* PET 1.1.1.2 fix (#308)

* PET 1.1.1.2 fix

* PET 1.1.1.2 fix (#309)

* PET 1.1.1.2 fix

* PET 1.1.1.2 fix

* RET-3168 (#314)

* Updates for the task RET-3168

* Updates for the task RET-3168

* Updates for the task RET-3168

* Updates for the task RET-3168

* Updates for the task RET-3168

* Updates for the task RET-3168

* Ret-3168 Update for Code Quality (#317)

* Updates for code quality.

* Updates for code quality.

* Updates for code quality.

* Updates for code quality.

* Updates for code quality.

* Updates for code quality.

* Updates for code quality.

* Code Smell Updates (#320)

* Code Smell Updates

* Updates for SUBMIT_CASE_EMAIL_TEMPLATE_ID, CY_SUBMIT_CASE_EMAIL_TEMPLATE_ID, SUBMIT_CASE_DOC_UPLOAD_ERROR_EMAIL_TEMPLATE_ID for sending emails with files.

---------

Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: btensay <tensay.bulcha@gmail.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>

* Fix Emails (#326)

* Fortify issue fix (#324)

* Fortify issue fix

* Fortify issue fix

* Fix notification service test

* Bumping chart version/ fixing aliases

* Remove duplicate

---------

Co-authored-by: Mehmet Tahir Dede <105645217+JustMehmet@users.noreply.github.com>
Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: btensay <tensay.bulcha@gmail.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>

* Fix branch

* Ret 3396: Update Templates with Dynamic Links (#322)

* RET-3396: Merge Claimant Response to Tribunal emails into one email

* RET-3396: Update Claimant Application to use dynamic link

* RET-3396: Update Claimant Application email to Respondent to use dynamic link

* RET-3396: Update Claimant Application email to Claimant to use dynamic link

* RET-3396: Some code tidy up

* RET-3396: Post merge tidy up

* Update et-model-data version number (#332)

* Ret 2829 Apps & Case Mgmt common – Generate email notification to Respondent when Claimant responds to an application (CitizenUI) (#328)

* RET-2829 added sendResponseEmailToRespondent

* RET-2829 added unit tests

* RET-2829 review comments

* RET-2829 fix PMD issues

* RET-2829 reivew comments

* RET-2829 update ruleset

* RET-2829 minor formating

* RET-2829 fix bug on sending responant email on a no response

* RET-2829 fix checkstyle issues

* RET-2829 reivew comment

---------

Co-authored-by: Paul.Peasegood@hmcts.net <paulp@LAPTOP4439.V1.com>

* RET-3480 - Retrieve all cases (#340)

* Retrieve all cases

* Add commons-fileupload 1.5

* Bump chart (#343)

* Ret 2929 Provide something Tribunal asked for - CYA page for response to order/request from Tribunal (CitizenUI) (#342)

* RET-2929 added add-response-send-notification

* RET-2929 added unit tests

* Bumping chart version/ fixing aliases

* RET-2929 added javaDocs

* RET-2929 fix java docs

* RET-2929: Add to response 'Claimant', 'Date', 'Reponse size' and change sendNotificationState

---------

Co-authored-by: Paul.Peasegood@hmcts.net <paulp@LAPTOP4439.V1.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: ikirsanov <ivan.kirsanov@version1.com>

* Ret 2931/2932 - send email notifications for response to a notification (#347)

* RET-2929 added add-response-send-notification

* RET-2929 added unit tests

* Bumping chart version/ fixing aliases

* RET-2929 added javaDocs

* RET-2929 fix java docs

* RET-2929: Add to response 'Claimant', 'Date', 'Reponse size' and change sendNotificationState

* RET-2931 added sendResponseNotificationEmailToTribunal

* RET-2932 added sendResponseNotificationEmailToRespondent

* RET-2930 added sendResponseNotificationEmailToClaimant

* RET-2931 small fixes after testing

* ret-2931 fix checkstyle issues

* RET-2931 fix failing unit test

---------

Co-authored-by: Paul.Peasegood@hmcts.net <paulp@LAPTOP4439.V1.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: ikirsanov <ivan.kirsanov@version1.com>

* RET-2929_bug_fix (#350)

* RET-2929_bug_fix: change status of notification to VIEWED when respond added to notification

* RET-2929_bug_fix: removed unused import

* Ret 3513 (#355)

* RET-3513. Remove application.properties

* RET-3513. Use dev template ids

* RET-3549: Align with data-model 2 (#361)

* Ret 3233 - View an application/case judgment from CitizenUI hub page (#360)

* Create new doclist if it is null

* interim commit - not sure it works by now

* Adding admin decision state

* Adding admin decision notification state test

* Fixed failing test

* Bump model

* Reset data model

* Fix checkstyle

* checksyle fixes

---------

Co-authored-by: Itay-Kirsh <Itayk747@gmail.com>

* Ret 3502 (#356). Fix NPE Document collection.

* Create new doclist if it is null

* interim commit - not sure it works by now

---------

Co-authored-by: lvo700 <lorr05@qub.ac.uk>

* RET-3513. Fix submit claim emails (#362)

* RET-3513. Fix submit claim emails
- Missing Welsh template
- Both templates outdated - new pdf-template added locally.
- Welsh missing case id in citizen portal link
- Remove values.yaml values that are already in application.yaml

* Bumping chart version/ fixing aliases

---------

Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>

* Ret 3513. Update error email template (#363)

* Remove testing of spring properties - useless tests.

* Update template id for error email. Remove from Values.yaml

* Tested error email being sent to all parties, had to have actual email defaults for dev.

* Chart bump

* Update Chart.yaml

* Update Chart.yaml

* RET-3153. Clean application.yaml and charts (#367)

* Move properties around

* Remove Values.yaml properties that are in both values.yaml and application.yaml

* interim - bring back:
- locally overridden tse properties
- non-locally overridden pse properties

* Todo

* Start separating PSE and TSE

* Finish separating TSE and PSE and clean a little.

* bump chart ver

* Remove duplicated requestCaseDataListEnglandAcas

* Fix checkstyle and sonarlint issues

* RET-3596: Rule 92 Screen displayed when other party is not a system user (#378)

* RET-3596: Rule 92 Screen displayed when other party is not a system user

* Bumping chart version/ fixing aliases

* Refactored for pmd

---------

Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>

* Ret-3697. Change status of applications when claimant responds to respondent (#379)

* When claimant responds to respondent's application, set status to waitingForTheTribunal

* Add test

* Update test to include more appropriate data

* Update application state request for a claimant viewing an application
Also added testing around finding an application by its id

* Add empty document list if doesn't exist

* Clean test code

* Clean imports

* Fix PMD

* RET-3626 Bug fix - claimant response to application without an upload (#381)

* allow response to application  with either text or upload file, upload not mandatory

* fix checkstyle, pmd

* change null check for uploading file

* remove unused import

* Updated springboot patch version and suppressed vuns that don't have newer versions (#387)

* Ret 3684. Status update for respondents applications. (#382)

* Transition "view an application" to "change application status"

* Upgrade data-model version so that I can keep track of whether claimant / respondent responded

* Upgrade data-model version again

* RET-3684 Claimant responding to tribunal request for information (#391)

* Scenario 4

* Update datamodel version with fix for booleans -> Booleans for default value to null

* Fix tests so that they run against claimantResponseRequired, not respondentResponseRequired

* ResponseRequired might be null, swap order of equals comparison, add another test

* PMD fix

* Suppress owasp vulnerability

* Parameterize the ApplicationServiceTest tests

* Suppress "UnusedPrivateMethod" as done in the callbacks

* RET 3796, 3797 Emails to tribunal, claimant on response to tribunal order within an application (#395)

* add 3796, 3797

* add unit tests

* change unit test to use ParameterizedTest

* RET-3796 v2 (#398)

* change Boolean to boolean

* update getter for isRespondingToRequestOrOrder

* Ret 3798. Email respondent when claimant replies to tribunal  (#394). Lots of generic cleaning as well

* Clean code

* Methods and class don't need to be public

* Class might need to be public (unless we move the exception to the same package)

* Send new email out to respondent if claimant replies and rule 92 is yes

* Clean and add tests. Also fix it just simply not working
(I changed status to not needing to respond and then checked it later when sending emails)

* Clean imports

* Fix PMD main

* Rearrange related RespondToApplication tests to be together in the nested class and fix PMD issues

* Clean code and remove duplication

* Clean code with CoreEmailDetails

* Align law of demeter properties with callbacks

* Fix PMD

* Fixed tests and add task to clean template ids

* Rename application.yaml properties to match a consistent pattern

* Use constant - pmd issue fix

* Reorder notification properties

* Early return to remove else

* Remove patterns for concatenating strings

* Use string join instead of simple concatenation

* clean code

* Resolve Conflicts after PET release (#396)

* conflicts

* Fix decision state update (#400)

* RET-3890. Add identical shortDescription for supporting document of claimant TSE apps (#402)

* RET-3798. Fix url parameter to include link directly to case page (#406)

* RET-3792 - Add endpoint for setting admin response as viewed (#408)

* Add endpoint for setting admin response as viewed

* Add java docs

* Update src/main/java/uk/gov/hmcts/reform/et/syaapi/service/ApplicationService.java

Co-authored-by: JackReevies <43950645+JackReevies@users.noreply.github.com>

---------

Co-authored-by: JackReevies <43950645+JackReevies@users.noreply.github.com>

* Add short description to supporting material response doc (#410)

* Add short description to supporting material response doc

* Update tests

* Add functional test artifacts  (#407)

* Test functional

* Removed unneeded artifacts

* Added functional tests for ManageCaseController

* Fix PMD

* Added sad path test

* Fix PMD

* Update application.properties

* Fixed test

* Fixed test

* Add timeout

* Fix checkstyle

* added role for functional test account

* Fix checkstyle

* Added response validations and sad paths to FTs

* Fix pmd

* Make tests run against preview and staging pods

* Set tests to point to demo as aat is not set for release 1.2

---------

Co-authored-by: dharmendra kumar <dharmendra.kumar@hmcts.net>

* Change the url to point to aat

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: ikirsanov <105438011+ikirsanov@users.noreply.github.com>
Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>
Co-authored-by: robin-ieong <101253854+robin-ieong@users.noreply.github.com>
Co-authored-by: paul-peasegood <116294451+paul-peasegood@users.noreply.github.com>
Co-authored-by: Jack Brogan <jack.brogan@hmcts.net>
Co-authored-by: paul.peasegood <paul.peasegood@version1.com>
Co-authored-by: Mehmet Tahir Dede <105645217+JustMehmet@users.noreply.github.com>
Co-authored-by: Itay-Kirsh <Itayk747@gmail.com>
Co-authored-by: Daryl Boam <104851463+DarylBoam@users.noreply.github.com>
Co-authored-by: Marc Judge <marc.judge@version1.com>
Co-authored-by: lvo700 <lorr05@qub.ac.uk>
Co-authored-by: brendanmchugh <95289167+brendanmchugh@users.noreply.github.com>
Co-authored-by: Paul.Peasegood@hmcts.net <paulp@LAPTOP4439.V1.com>
Co-authored-by: btensay <tensay.bulcha@gmail.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: fergusoshea <114142469+fergusoshea@users.noreply.github.com>
Co-authored-by: ikirsanov <ivan.kirsanov@version1.com>
Co-authored-by: JackReevies <43950645+JackReevies@users.noreply.github.com>
Co-authored-by: Jack Reeve <jack@reevies.tech>
Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>
Co-authored-by: dharmendra kumar <dharmendra.kumar@hmcts.net>

* RET-2857 Pact Test Updates (#415)

* Updates to activate Pact-Tests

* Update to consumer tests

* Update to consumer tests

* Update to consumer tests

* Master conflicts

---------

Co-authored-by: dharmendra kumar <dharmendra.kumar@hmcts.net>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: ikirsanov <105438011+ikirsanov@users.noreply.github.com>
Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>
Co-authored-by: robin-ieong <101253854+robin-ieong@users.noreply.github.com>
Co-authored-by: paul-peasegood <116294451+paul-peasegood@users.noreply.github.com>
Co-authored-by: Jack Brogan <jack.brogan@hmcts.net>
Co-authored-by: paul.peasegood <paul.peasegood@version1.com>
Co-authored-by: Mehmet Tahir Dede <105645217+JustMehmet@users.noreply.github.com>
Co-authored-by: Itay-Kirsh <Itayk747@gmail.com>
Co-authored-by: Daryl Boam <104851463+DarylBoam@users.noreply.github.com>
Co-authored-by: Marc Judge <marc.judge@version1.com>
Co-authored-by: lvo700 <lorr05@qub.ac.uk>
Co-authored-by: brendanmchugh <95289167+brendanmchugh@users.noreply.github.com>
Co-authored-by: Paul.Peasegood@hmcts.net <paulp@LAPTOP4439.V1.com>
Co-authored-by: btensay <tensay.bulcha@gmail.com>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: fergusoshea <114142469+fergusoshea@users.noreply.github.com>
Co-authored-by: ikirsanov <ivan.kirsanov@version1.com>
Co-authored-by: JackReevies <43950645+JackReevies@users.noreply.github.com>
Co-authored-by: Jack Reeve <jack@reevies.tech>
Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>

---------

Co-authored-by: GauravChawlaMOJ <58194626+GauravChawlaMOJ@users.noreply.github.com>
Co-authored-by: gauravchawla <gaurav-chawla@hotmail.com>
Co-authored-by: Harpreet Jhita <harpreet.jhita@justice.gov.uk>
Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: marcjudge <98343606+marcjudge@users.noreply.github.com>
Co-authored-by: marcjudge <marc.judge@hmcts.net>
Co-authored-by: Cindy Chan <94921454+cindychmcts@users.noreply.github.com>
Co-authored-by: dharmendra kumar <dharmendra.kumar@hmcts.net>
Co-authored-by: ikirsanov <105438011+ikirsanov@users.noreply.github.com>
Co-authored-by: KirsanovI <ivan.kirsanov@hmcts.net>
Co-authored-by: robin-ieong <101253854+robin-ieong@users.noreply.github.com>
Co-authored-by: paul-peasegood <116294451+paul-peasegood@users.noreply.github.com>
Co-authored-by: Jack Brogan <jack.brogan@hmcts.net>
Co-authored-by: paul.peasegood <paul.peasegood@version1.com>
Co-authored-by: Itay-Kirsh <Itayk747@gmail.com>
Co-authored-by: Daryl Boam <104851463+DarylBoam@users.noreply.github.com>
Co-authored-by: Marc Judge <marc.judge@version1.com>
Co-authored-by: lvo700 <lorr05@qub.ac.uk>
Co-authored-by: brendanmchugh <95289167+brendanmchugh@users.noreply.github.com>
Co-authored-by: Paul.Peasegood@hmcts.net <paulp@LAPTOP4439.V1.com>
Co-authored-by: btensay <tensay.bulcha@gmail.com>
Co-authored-by: fergusoshea <114142469+fergusoshea@users.noreply.github.com>
Co-authored-by: ikirsanov <ivan.kirsanov@version1.com>
Co-authored-by: JackReevies <43950645+JackReevies@users.noreply.github.com>
Co-authored-by: Jack Reeve <jack@reevies.tech>
  • Loading branch information
1 parent 80e473d commit 5d6b878
Show file tree
Hide file tree
Showing 30 changed files with 1,182 additions and 631 deletions.
39 changes: 39 additions & 0 deletions src/main/java/uk/gov/hmcts/reform/et/syaapi/enums/ClaimType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package uk.gov.hmcts.reform.et.syaapi.enums;

import uk.gov.hmcts.reform.et.syaapi.constants.ClaimTypesConstants;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperConstants;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public enum ClaimType {

DISCRIMINATION(ClaimTypesConstants.DISCRIMINATION, PdfMapperConstants.Q8_TYPE_OF_CLAIM_DISCRIMINATION),
PAY_RELATED(ClaimTypesConstants.PAY_RELATED_CLAIM, null),
UNFAIR_DISMISSAL(ClaimTypesConstants.UNFAIR_DISMISSAL, PdfMapperConstants.Q8_TYPE_OF_CLAIM_UNFAIRLY_DISMISSED),
WHISTLE_BLOWING(ClaimTypesConstants.WHISTLE_BLOWING, PdfMapperConstants.Q8_TYPE_OF_CLAIM_WHISTLE_BLOWING),
OTHER_TYPES_OF_CLAIMS(ClaimTypesConstants.OTHER_TYPES, PdfMapperConstants.Q8_TYPE_OF_CLAIM_OTHER_TYPES_OF_CLAIMS);

private static final Map<String, ClaimType> BY_LABEL = new ConcurrentHashMap<>();

static {
for (ClaimType ct : values()) {
BY_LABEL.put(ct.label, ct);
}
}

public final String label;
public final String pdfFieldName;

ClaimType(String label, String pdfFieldName) {
this.label = label;
this.pdfFieldName = pdfFieldName;
}

public static ClaimType valueOfLabel(String label) {
if (BY_LABEL.containsKey(label)) {
return BY_LABEL.get(label);
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package uk.gov.hmcts.reform.et.syaapi.enums;

import uk.gov.hmcts.reform.et.syaapi.constants.ClaimTypesConstants;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperConstants;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public enum DiscriminationType {
AGE(ClaimTypesConstants.AGE, PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_AGE),
DISABILITY(ClaimTypesConstants.DISABILITY, PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_DISABILITY),
ETHNICITY(ClaimTypesConstants.ETHNICITY, PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_RACE),
RACE(ClaimTypesConstants.RACE, PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_RACE),
GENDER_REASSIGNMENT(ClaimTypesConstants.GENDER_REASSIGNMENT,
PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_GENDER_REASSIGNMENT),
MARRIAGE_OR_CIVIL_PARTNERSHIP(ClaimTypesConstants.MARRIAGE_OR_CIVIL_PARTNERSHIP,
PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_MARRIAGE_OR_CIVIL_PARTNERSHIP),
PREGNANCY_OR_MATERNITY(ClaimTypesConstants.PREGNANCY_OR_MATERNITY,
PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_PREGNANCY_OR_MATERNITY),
RELIGION_OR_BELIEF(ClaimTypesConstants.RELIGION_OR_BELIEF,
PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_RELIGION_OR_BELIEF),
SEX(ClaimTypesConstants.SEX, PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_SEX),
SEXUAL_ORIENTATION(ClaimTypesConstants.SEXUAL_ORIENTATION,
PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_SEXUAL_ORIENTATION);

private static final Map<String, DiscriminationType> BY_LABEL = new ConcurrentHashMap<>();

static {
for (DiscriminationType dt : values()) {
BY_LABEL.put(dt.label, dt);
}
}

public final String label;
public final String pdfFieldName;

DiscriminationType(String label, String pdfFieldName) {
this.label = label;
this.pdfFieldName = pdfFieldName;
}

public static DiscriminationType valueOfLabel(String label) {
if (BY_LABEL.containsKey(label)) {
return BY_LABEL.get(label);
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package uk.gov.hmcts.reform.et.syaapi.enums;

import uk.gov.hmcts.reform.et.syaapi.constants.ClaimTypesConstants;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperConstants;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public enum PayClaimType {

ARREARS(ClaimTypesConstants.ARREARS, PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_ARREARS),
HOLIDAY_PAY(ClaimTypesConstants.HOLIDAY_PAY, PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_HOLIDAY_PAY),
NOTICE_PAY(ClaimTypesConstants.NOTICE_PAY, PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_NOTICE_PAY),
OTHER_PAYMENTS(ClaimTypesConstants.OTHER_PAYMENTS, PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_OTHER_PAYMENTS),
REDUNDANCY_PAY(ClaimTypesConstants.REDUNDANCY_PAY, PdfMapperConstants.Q8_TYPE_OF_CLAIM_REDUNDANCY_PAYMENT);

private static final Map<String, PayClaimType> BY_LABEL = new ConcurrentHashMap<>();

static {
for (PayClaimType pt : values()) {
BY_LABEL.put(pt.label, pt);
}
}

public final String label;
public final String pdfFieldName;

PayClaimType(String label, String pdfFieldName) {
this.label = label;
this.pdfFieldName = pdfFieldName;
}

public static PayClaimType valueOfLabel(String label) {
if (BY_LABEL.containsKey(label)) {
return BY_LABEL.get(label);
}
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import uk.gov.hmcts.et.common.model.ccd.CaseData;
import uk.gov.hmcts.reform.et.syaapi.constants.ClaimTypesConstants;
import uk.gov.hmcts.reform.et.syaapi.service.utils.GenericServiceUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperClaimDescriptionUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperClaimDetailsUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperConstants;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperEmploymentUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperEmploymentDetailsUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperHearingPreferencesUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperPersonalDetailsUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperRepresentativeUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperRespondentUtil;
import uk.gov.hmcts.reform.et.syaapi.service.utils.PdfMapperServiceUtil;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
Expand All @@ -33,9 +33,6 @@
*/
@Slf4j
@Service
@SuppressWarnings({"PMD.GodClass",
"PMD.CyclomaticComplexity", "PMD.TooManyMethods", "PMD.CognitiveComplexity", "PMD.CollapsibleIfStatements",
"PMD.AvoidDeeplyNestedIfStmts"})
public class PdfMapperService {

private static final String YES_LOWERCASE = "yes";
Expand All @@ -59,13 +56,18 @@ public Map<String, Optional<String>> mapHeadersToPdf(CaseData caseData) {
PdfMapperHearingPreferencesUtil.putHearingPreferences(caseData, printFields);
PdfMapperRespondentUtil.putRespondents(caseData, printFields);
putMultipleClaimsDetails(caseData, printFields);
PdfMapperEmploymentUtil.putEmploymentDetails(caseData, printFields);
PdfMapperEmploymentDetailsUtil.putEmploymentDetails(caseData, printFields);
PdfMapperClaimDetailsUtil.putClaimDetails(caseData, printFields);
try {
printFields.putAll(printTypeAndDetailsOfClaim(caseData));
printFields.putAll(printCompensation(caseData));
printFields.putAll(printWhistleBlowing(caseData));
} catch (Exception e) {
log.error("Exception occurred in PDF MAPPER \n" + e.getMessage(), e);
GenericServiceUtil.logException("An error occurred while printing compensation and "
+ "whistle blowing to pdf file",
caseData.getEthosCaseReference(),
e.getMessage(),
"PdfMapperService",
"mapHeadersToPdf");
}
return printFields;
}
Expand Down Expand Up @@ -97,139 +99,6 @@ private static void putMultipleClaimsDetails(
}
}


private Map<String, Optional<String>> printTypeAndDetailsOfClaim(CaseData caseData) {
return new ConcurrentHashMap<>(retrieveTypeOfClaimsPrintFields(caseData));
}

private static Map<String, Optional<String>> retrieveTypeOfClaimsPrintFields(CaseData caseData) {
Map<String, Optional<String>> printFields = new ConcurrentHashMap<>();
if (caseData.getTypesOfClaim() == null || caseData.getTypesOfClaim().isEmpty()) {
return printFields;
}
for (String typeOfClaim : caseData.getTypesOfClaim()) {
mapPrintFields(printFields, typeOfClaim, caseData);
}
return printFields;
}

private static void mapPrintFields(Map<String, Optional<String>> printFields,
String typeOfClaim,
CaseData caseData) {
switch (typeOfClaim) {
case "discrimination":
printFields.put(PdfMapperConstants.Q8_TYPE_OF_CLAIM_DISCRIMINATION, Optional.of(YES));
if (caseData.getClaimantRequests() != null
&& caseData.getClaimantRequests().getDiscriminationClaims() != null) {
printFields.putAll(retrieveDiscriminationClaimsPrintFields(
caseData.getClaimantRequests().getDiscriminationClaims()));
}
break;
case "payRelated":
if (caseData.getClaimantRequests() != null && caseData.getClaimantRequests().getPayClaims() != null) {
printFields.putAll(retrievePayClaimsPrintFields(caseData.getClaimantRequests().getPayClaims()));
}
break;
case "unfairDismissal":
printFields.put(PdfMapperConstants.Q8_TYPE_OF_CLAIM_UNFAIRLY_DISMISSED, Optional.of(YES));
break;
case "whistleBlowing":
printFields.put(PdfMapperConstants.Q8_TYPE_OF_CLAIM_WHISTLE_BLOWING, Optional.of(YES));
break;
case "otherTypesOfClaims":
printFields.put(PdfMapperConstants.Q8_TYPE_OF_CLAIM_OTHER_TYPES_OF_CLAIMS, Optional.of(YES));
if (caseData.getClaimantRequests() != null) {
printFields.put(
PdfMapperConstants.Q8_ANOTHER_TYPE_OF_CLAIM_TEXT_AREA,
ofNullable(caseData.getClaimantRequests().getOtherClaim())
);
}
break;
default:
break;
}
}

private static Map<String, Optional<String>> retrieveDiscriminationClaimsPrintFields(
List<String> discriminationClaims) {
Map<String, Optional<String>> printFields = new ConcurrentHashMap<>();
for (String discriminationType : discriminationClaims) {
switch (discriminationType) {
case ClaimTypesConstants.AGE:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_AGE, Optional.of(YES));
break;
case ClaimTypesConstants.DISABILITY:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_DISABILITY, Optional.of(YES));
break;
case ClaimTypesConstants.ETHNICITY, ClaimTypesConstants.RACE:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_RACE, Optional.of(YES));
break;
case ClaimTypesConstants.GENDER_REASSIGNMENT:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_GENDER_REASSIGNMENT, Optional.of(YES));
break;
case ClaimTypesConstants.MARRIAGE_OR_CIVIL_PARTNERSHIP:
printFields.put(
PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_MARRIAGE_OR_CIVIL_PARTNERSHIP,
Optional.of(YES)
);
break;
case ClaimTypesConstants.PREGNANCY_OR_MATERNITY:
printFields.put(
PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_PREGNANCY_OR_MATERNITY,
Optional.of(YES)
);
break;
case ClaimTypesConstants.RELIGION_OR_BELIEF:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_RELIGION_OR_BELIEF, Optional.of(YES));
break;
case ClaimTypesConstants.SEX:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_SEX, Optional.of(YES));
break;
case ClaimTypesConstants.SEXUAL_ORIENTATION:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_DISCRIMINATION_SEXUAL_ORIENTATION, Optional.of(YES));
break;
default:
break;
}
}
return printFields;
}

private static Map<String, Optional<String>> retrievePayClaimsPrintFields(
List<String> payClaims) {
Map<String, Optional<String>> printFields = new ConcurrentHashMap<>();
for (String payClaimType : payClaims) {
switch (payClaimType) {
case ClaimTypesConstants.ARREARS:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_ARREARS, Optional.of(YES));
checkIAmOwedBox(printFields);
break;
case ClaimTypesConstants.HOLIDAY_PAY:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_HOLIDAY_PAY, Optional.of(YES));
checkIAmOwedBox(printFields);
break;
case ClaimTypesConstants.NOTICE_PAY:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_NOTICE_PAY, Optional.of(YES));
checkIAmOwedBox(printFields);
break;
case ClaimTypesConstants.OTHER_PAYMENTS:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_PAY_CLAIMS_OTHER_PAYMENTS, Optional.of(YES));
checkIAmOwedBox(printFields);
break;
case ClaimTypesConstants.REDUNDANCY_PAY:
printFields.put(PdfMapperConstants.Q8_TYPE_OF_CLAIM_REDUNDANCY_PAYMENT, Optional.of(YES));
break;
default:
break;
}
}
return printFields;
}

private static void checkIAmOwedBox(Map<String, Optional<String>> printFields) {
printFields.computeIfAbsent(PdfMapperConstants.Q8_TYPE_OF_CLAIM_I_AM_OWED, key -> Optional.of(YES));
}

private Map<String, Optional<String>> printCompensation(CaseData caseData) {
Map<String, Optional<String>> printFields = new ConcurrentHashMap<>();
if (caseData.getClaimantRequests() != null
Expand Down Expand Up @@ -298,6 +167,4 @@ private Map<String, Optional<String>> printWhistleBlowing(CaseData caseData) {
return printFields;
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ private PdfMapperClaimDescriptionUtil() {
}

public static void putClaimDescription(CaseData caseData, ConcurrentMap<String, Optional<String>> printFields) {
if (ObjectUtils.isNotEmpty(caseData.getClaimantRequests())
&& StringUtils.isNotBlank(caseData.getClaimantRequests().getClaimDescription())) {
printFields.put(PdfMapperConstants.Q8_CLAIM_DESCRIPTION,
ofNullable(caseData.getClaimantRequests().getClaimDescription()));
try {
if (ObjectUtils.isNotEmpty(caseData.getClaimantRequests())
&& StringUtils.isNotBlank(caseData.getClaimantRequests().getClaimDescription())) {
printFields.put(
PdfMapperConstants.Q8_CLAIM_DESCRIPTION,
ofNullable(caseData.getClaimantRequests().getClaimDescription())
);
}
} catch (Exception e) {
GenericServiceUtil.logException("An error occurred while printing claim description to pdf file",
caseData.getEthosCaseReference(),
e.getMessage(),
"PdfMapperClaimDescriptionUtil",
"putClaimDescription");
}
}

Expand Down
Loading

0 comments on commit 5d6b878

Please sign in to comment.