{"id":20726701,"url":"https://github.com/hmcts/sscs-case-loader","last_synced_at":"2025-04-23T18:46:23.973Z","repository":{"id":37412967,"uuid":"117238362","full_name":"hmcts/sscs-case-loader","owner":"hmcts","description":"Loader service for HMCTS Cases","archived":false,"fork":false,"pushed_at":"2025-04-23T11:18:23.000Z","size":11577,"stargazers_count":4,"open_issues_count":13,"forks_count":1,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-23T12:23:54.939Z","etag":null,"topics":["codacy","docker","govuk","gradle","java8","jenkins-cft","jenkins-cft-j-z","springboot","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmcts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit.json","citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-12T12:25:52.000Z","updated_at":"2025-04-23T11:10:05.000Z","dependencies_parsed_at":"2023-10-23T19:29:24.897Z","dependency_job_id":"cd657a4a-666e-4dd7-b790-3e72332b968f","html_url":"https://github.com/hmcts/sscs-case-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fsscs-case-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fsscs-case-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fsscs-case-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fsscs-case-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmcts","download_url":"https://codeload.github.com/hmcts/sscs-case-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250495447,"owners_count":21440180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codacy","docker","govuk","gradle","java8","jenkins-cft","jenkins-cft-j-z","springboot","travis-ci"],"created_at":"2024-11-17T04:26:44.242Z","updated_at":"2025-04-23T18:46:23.945Z","avatar_url":"https://github.com/hmcts.png","language":"Java","readme":"# SSCS Case Loader Application\n\n[![Build Status](https://travis-ci.org/hmcts/spring-boot-template.svg?branch=master)](https://travis-ci.org/hmcts/spring-boot-template)\n[![codecov](https://codecov.io/gh/hmcts/sscs-case-loader/branch/master/graph/badge.svg)](https://codecov.io/gh/hmcts/sscs-case-loader)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9717adfc9bca44ab98e836c97f28659f)](https://www.codacy.com/app/HMCTS/sscs-case-loader)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/9717adfc9bca44ab98e836c97f28659f)](https://www.codacy.com/app/HMCTS/sscs-case-loader)\n\n## Purpose\n\nThe purpose of this App is to take cases coming from the legacy Gaps2 and create/update them in the CCD app.\n\n## What's inside\n\nIt contains:\n * common plugins and libraries\n * docker setup\n * swagger configuration for api documentation ([see how to publish your api documentation to shared repository](https://github.com/hmcts/reform-api-docs#publish-swagger-docs))\n * code quality tools already set up\n * integration with Travis CI\n * Hystrix circuit breaker enabled\n * Hystrix dashboard\n * MIT license and contribution information\n\nThe application exposes health endpoint (http://localhost:8082/health) and metrics endpoint\n(http://localhost:8082/metrics).\n\n## Plugins\n\nThe project contains the following plugins:\n\n  * checkstyle\n\n    https://docs.gradle.org/current/userguide/checkstyle_plugin.html\n\n    Performs code style checks on Java source files using Checkstyle and generates reports from these checks.\n    The checks are included in gradle's *check* task (you can run them by executing `./gradlew check` command).\n\n  * pmd\n\n    https://docs.gradle.org/current/userguide/pmd_plugin.html\n\n    Performs static code analysis to finds common programming flaws. Incuded in gradle `check` task.\n\n\n  * jacoco\n\n    https://docs.gradle.org/current/userguide/jacoco_plugin.html\n\n    Provides code coverage metrics for Java code via integration with JaCoCo.\n    You can create the report by running the following command:\n\n    ```bash\n      ./gradlew jacocoTestReport\n    ```\n\n    The report will be created in build/reports subdirectory in your project directory.\n\n  * io.spring.dependency-management\n\n    https://github.com/spring-gradle-plugins/dependency-management-plugin\n\n    Provides Maven-like dependency management. Allows you to declare dependency management\n    using `dependency 'groupId:artifactId:version'`\n    or `dependency group:'group', name:'name', version:version'`.\n\n  * org.springframework.boot\n\n    http://projects.spring.io/spring-boot/\n\n    Reduces the amount of work needed to create a Spring application\n\n  * org.owasp.dependencycheck\n\n    https://jeremylong.github.io/DependencyCheck/dependency-check-gradle/index.html\n\n    Provides monitoring of the project's dependent libraries and creating a report\n    of known vulnerable components that are included in the build. To run it\n    execute `gradle dependencyCheck` command.\n\n  * com.github.ben-manes.versions\n\n    https://github.com/ben-manes/gradle-versions-plugin\n\n    Provides a task to determine which dependencies have updates. Usage:\n\n    ```bash\n      ./gradlew dependencyUpdates -Drevision=release\n    ```\n\n## Building and deploying the application\n\n### Building the application\n\nThe project uses [Gradle](https://gradle.org) as a build tool. It already contains\n`./gradlew` wrapper script, so there's no need to install gradle.\n\nTo build the project execute the following command:\n\n```bash\n  ./gradlew build\n```\n\n### Running the application\n\nRun the application by executing:\n\n```\n  ./gradlew bootRun\n```\n\n### Running the application in Docker\n\nDockerisation is a work in progress.\n\n### Setting up a Dockerised SFTP server for developing purpose\n\nThis setup is required if files need to be processed via sftp server\n\n* To simply build the SFTP server\n```bash\ndocker-compose rm -f \u0026\u0026 docker-compose -f docker-compose-sftp.yml build \u0026\u0026 docker-compose -f docker-compose-sftp.yml up\n```\n\n* To login into a container which is currently running on your system and view transferred files\n\nPlace file to be transferred under `docker/sftp/data/incoming` and make sure `docker/sftp/data/incoming/processed` folder should contain atleast one file then:\n\n```\nTo connect into sftp container from sscs-case-loader container use:\n```bash\nsftp -P 22 -o StrictHostKeyChecking=no -i /home/webapp/sscs-sftp-key sftp@sscs-sftp:incoming\n```\n\nTo connect into sftp container from host (your computer):\nBefore first use\n```bash\nchmod 600 ./docker/sftp-docker\n```\nand put some files in here\n```bash\n./docker/sftp/data/incoming/\n```\nfinally\n```bash\nsftp -P 2222 -o StrictHostKeyChecking=no -i ./docker/sftp-docker sftp@localhost:incoming\n```\n\n```bash\nConnected to sscs-sftp.\nChanging to: /incoming\nsftp\u003e dir\nSSCS_Extract_Reference_2017-06-30-09-01-31.xml\n```\n## Testing event/case updates manually locally\n* do the above steps\n* Create/copy the extract delta xml you need\n* ensure that there is no gaps caseId (Appeal_Case_RefNum), but there is a ccdId (Additional_Ref) that already exsits on your local db\n* ensure that the newest Major_Status element has the type of event you are tring to test (see GapsEvent class)\n* ensure that for event updates the list of Major_Status is different to that already on your ccd case locally\n* Run the CaseLoaderApp in your ide\n* This should pick up the delta file you changed\n* (I found that the last action of moving to the processed folder did not work because of directory permissions, but that may only be an Ubuntu thing)\n\n\n## Running e2e locally\n\n* Bring up the upstream systems using sscs-docker (https://github.com/hmcts/sscs-docker) project.\nPlease follow the instructions given in the README document.\n\n* Run the application using the \"local\" profile:\n```bash\nSPRING_PROFILES_ACTIVE=local ./gradlew bootRun\n```\n\n* Turn on debugging by editing sscs-case-loader/src/main/resources/application.yaml\n```bash\nlogging.level:\n    org.springframework.web: ${LOG_LEVEL_SPRING_WEB:debug}\n    uk.gov.hmcts.reform.sscs: ${LOG_LEVEL_SSCS:debug}\n```\n* Bring up the SFTP server\n```bash\ndocker-compose rm -f \u0026\u0026 docker-compose -f docker-compose-sftp.yml build \u0026\u0026 docker-compose -f docker-compose-sftp.yml up\n```\n* Open IntelliJ and import the Lombok plugin and enable annotation processing\n* Run this test within IntelliJ\n```bash\nhttps://github.com/hmcts/sscs-case-loader/blob/master/src/e2e/java/uk.gov.hmcts.reform.sscs/olde2e/ProcessFileAndSaveIntoCcd.java#L20\n```\n* Refresh the browser to view the cases in CCD\n```bash\nhttp://localhost:3451\n```\n\n* Running  Functional test locally\n\n1. Make sure you bring up local SFTP and run sscs-docker dependencies\n2. Run\n\n```\n SPRING_PROFILES_ACTIVE=local ./gradlew functionalPreDeploy\n SPRING_PROFILES_ACTIVE=local ./gradlew bootRun\n SPRING_PROFILES_ACTIVE=local ./gradlew functionalPostDeploy\n```\n\n## Hystrix\n\n[Hystrix](https://github.com/Netflix/Hystrix/wiki) is a library that helps you control the interactions\nbetween your application and other services by adding latency tolerance and fault tolerance logic. It does this\nby isolating points of access between the services, stopping cascading failures across them,\nand providing fallback options. We recommend you to use Hystrix in your application if it calls any services.\n\n### Hystrix circuit breaker\n\nThis template API has [Hystrix Circuit Breaker](https://github.com/Netflix/Hystrix/wiki/How-it-Works#circuit-breaker)\nalready enabled. It monitors and manages all the`@HystrixCommand` or `HystrixObservableCommand` annotated methods\ninside `@Component` or `@Service` annotated classes.\n\n### Hystrix dashboard\n\nWhen this API is running, you can monitor Hystrix metrics in real time using\n[Hystrix Dashboard](https://github.com/Netflix/Hystrix/wiki/Dashboard).\nIn order to do this, visit http://localhost:4550/hystrix and provide http://localhost:4550/hystrix.stream\nas the Hystrix event stream URL. Keep in mind that you'll only see data once some\nof your Hystrix commands have been executed. Otherwise *'Loading...'* message will be displayed\non the monitoring page.\n\n### Other\n\nHystrix offers much more than Circuit Breaker pattern implementation or command monitoring.\nHere are some other functionalities it provides:\n * [Separate, per-dependency thread pools](https://github.com/Netflix/Hystrix/wiki/How-it-Works#isolation)\n * [Semaphores](https://github.com/Netflix/Hystrix/wiki/How-it-Works#semaphores), which you can use to limit\n the number of concurrent calls to any given dependency\n * [Request caching](https://github.com/Netflix/Hystrix/wiki/How-it-Works#request-caching), allowing\n different code paths to execute Hystrix Commands without worrying about duplicating work\n\n## Data migration\n* Export mapped data sheet as csv and save it as \"\u003cYYYYMMDD\u003e_mapped_language_data.csv\" at the root of the project.\n* The following columns are required: \"reference\", \"state\",\" \"interpreter\", \"mapped_language_value\", \"existing_language_value\".\n* Update the name of the migration file in the \"MigrationDataEncoderApp\" class.\n* Run the \"MigrationDataEncoderApp\" to generate the encoded migration data string, which will be saved in a file named\n  \"\u003cYYYYMMDD\u003e_encoded_migration_data.txt\" at the root of the project.\n* Copy the encoded string into the \"encoded_migration_data_string\" secret in the relevant keyvault sscs-\u003cenv\u003e\n* This completes the setup required for the data migration cron job.\n* When the job runs it will read the encoded string from the vault, decode it, extract the migration data and update the\n  language values for all cases included the migration sheet.\n\n## Troubleshooting\n\n### IDE Settings\n\n#### Project Lombok Plugin\nWhen building the project in your IDE (eclipse or IntelliJ), Lombok plugin will be required to compile.\n\nFor IntelliJ IDEA, please add the Lombok IntelliJ plugin:\n* Go to `File \u003e Settings \u003e Plugins`\n* Click on `Browse repositories...`\n* Search for `Lombok Plugin`\n* Click on `Install plugin`\n* Restart IntelliJ IDEA\n\nPlugin setup for other IDE's are available on [https://projectlombok.org/setup/overview]\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmcts%2Fsscs-case-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmcts%2Fsscs-case-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmcts%2Fsscs-case-loader/lists"}