{"id":48554221,"url":"https://github.com/onsdigital/rm-sample-service","last_synced_at":"2026-04-08T10:00:48.783Z","repository":{"id":37431153,"uuid":"85964165","full_name":"ONSdigital/rm-sample-service","owner":"ONSdigital","description":"This microservice manages the survey sample.","archived":false,"fork":false,"pushed_at":"2026-03-26T07:55:35.000Z","size":5438,"stargazers_count":2,"open_issues_count":7,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-03-27T02:43:23.500Z","etag":null,"topics":["gov","java","microservices","response-management","spring-boot"],"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/ONSdigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-03-23T15:12:38.000Z","updated_at":"2026-03-23T08:45:37.000Z","dependencies_parsed_at":"2026-03-18T19:01:30.142Z","dependency_job_id":null,"html_url":"https://github.com/ONSdigital/rm-sample-service","commit_stats":null,"previous_names":[],"tags_count":160,"template":false,"template_full_name":null,"purl":"pkg:github/ONSdigital/rm-sample-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Frm-sample-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Frm-sample-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Frm-sample-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Frm-sample-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ONSdigital","download_url":"https://codeload.github.com/ONSdigital/rm-sample-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ONSdigital%2Frm-sample-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31549900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gov","java","microservices","response-management","spring-boot"],"created_at":"2026-04-08T10:00:39.496Z","updated_at":"2026-04-08T10:00:48.774Z","avatar_url":"https://github.com/ONSdigital.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample Service\nThis repository contains the Sample service. This microservice is a RESTful web service implemented using [Spring Boot](http://projects.spring.io/spring-boot/) and has the following responsibilities:\n\n* Storing the summary of that sample in its own database schema\n* Storing the details of each sample unit in the sample (a business survey reporting unit)\n* Sending sample units to [rm-case-service](https://github.com/ONSdigital/rm-case-service) to create cases\n\n## How to use it\n\n### Running\n\nThere are two ways of running this service\n\n* The easiest way is via docker (https://github.com/ONSdigital/ras-rm-docker-dev)\n* Alternatively running the service up in isolation\n    ```bash\n    mvn clean install\n    mvn spring-boot:run\n    ```\n\nNote. If you need to skip the integration tests due to port clashes run\n\n```bash\nmvn clean install -Ddocker.skip -DskipITs\n```\n\n### Running tests\n\nTests can be run with  maven using the following command\n\n```bash\nmvn clean verify\n```\n\n### API\nSee [openapi.yaml](https://github.com/ONSdigital/rm-sample-service/blob/main/openapi.yaml) for API documentation.\n\n### Code Styler\nTo use the code styler please goto this url (https://github.com/google/google-java-format) and follow the Intellij\ninstructions or Eclipse depending on what you use\n\nThe code styler can be run independently of the tests with the following command:\n```bash\nmvn fmt:format\n```\n\n## What it does\n\n### Communicates with\n- [ras-party](https://github.com/ONSdigital/ras-party) via a rest call to request reporting unit data and to link a sample summary to a collection exercise.\n- [ras-collection-instrument](https://github.com/ONSdigital/ras-collection-instrument) to get the collection_instrument_id \nfor the sample unit.\n- [rm-collection-exercise-service](https://github.com/ONSdigital/rm-collection-exercise-service) via PubSub to inform \nhow the enrichment and distribution of sample units to case is going.\n- [rm-case-service](https://github.com/ONSdigital/rm-case-service) via PubSub to send sample units, that will end up\nbecoming cases.\n\n  \n### Sample and Sample summary creation\n- Sample summary is created with the INIT state\n- samples are individually set up against a sample summary (in the INIT state?)\n- Response-operations-ui (or any service) hits the endpoint to check if all sample units have been loaded.  If so, move\n  sample summary to ACTIVE state\n\n### Sending samples to case for case creation\n- Listens on the \u003ctopic\u003e for a sample activation message\n- Validates and enriches each sample by getting the partyId and collectionInstrumentId for each sample. It enriches by \ngetting this data and validates by failing if it can't get both of these bits of data.\n- Once validation and enrichment is complete, a message is sent on \u003ctopic\u003e to inform rm-collection-exercise-service of\nthis fact.\n- Distributes each sample that makes up a sample summary to case by putting them on \u003ctopic\u003e that rm-case-service listens \nto\n- Once distribution is complete, a message is sent on \u003ctopic\u003e to inform rm-collection-exercise-service of this fact\n\n## Quick guide\n\n- Sample Unit: A single row within the sample file\n- Sample Summary: The entire collection of Sample Units in a sample file (Counting unique refs only, duplicates are\n  discarded, only the first is kept)\n\n\n## Copyright\nCopyright (C) 2017 Crown Copyright (Office for National Statistics)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsdigital%2Frm-sample-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonsdigital%2Frm-sample-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonsdigital%2Frm-sample-service/lists"}