This case api service provides a range of Restful endpoints that -
- Retrieve case details by case id, case ref, UPRN or QID
- Retrieve a QID by case id
- Create and return a new Uac Qid Link
The service relies on, and makes no changes to the casev2 schema maintained by census-rm-case-processor
GET /cases/uprn/<uprn>
(returns a list)GET /cases/<case_id>
GET /cases/qid/<qid>
GET /cases/ref/<reference>
All endpoints include an optional caseevents
boolean query parameter (default = "false"), that can be used to specify that the JSON response includes an array of associated case events. For example:
GET /cases/<case_id>?caseevents=true
If this query parameter is omitted these case events will not be returned with the case details.
{
"abpCode": "RD06",
"addressLevel": "U",
"addressLine1": "Flat 53 Francombe House",
"addressLine2": "Commercial Road",
"addressLine3": "",
"caseEvents": [],
"caseRef": "31283399",
"addressType": "HH",
"collectionExerciseId": "77c26716-5936-43e8-b56b-f5ca71765603",
"createdDateTime": "2019-10-25T08:34:34.680556Z",
"estabType": "Household",
"id": "040f4608-d054-4ae9-b12f-1eee7e0fa284",
"lad": "E06000023",
"latitude": "51.4463421",
"longitude": "-2.5924477",
"lsoa": "E01014542",
"msoa": "E02003043",
"oa": "E00073438",
"organisationName": "",
"postcode": "XX1 0XX",
"region": "E12000009",
"surveyType": "CENSUS",
"townName": "Windleybury",
"uprn": "10008677190",
"estabUprn": "103434302134"
}
GET /cases/<case_id>/qid
Returns a newly generated QID/UAC pair based on the case type and links it to the case by eventual consistency (not synchronously)
{
"qid": "0130000000000200",
"uac": "f7hhksdgtk4vj59h"
}
GET /cases/ccs/<case_id>/qid
Returns the single assigned CCS telephone capture QID for a CCS case
{
"active": "True",
"qid": "7130000000020300",
"formType": "H"
}
By default settings in src/main/resources/application.yml are used to configure census-rm-case-api
For production the configuration is overridden by the K8S apply script
The service requires several other services to be running started from census-rm-docker-dev
- Start census-rm-docker-dev services with the following line in section caseapi | environment in rm-services.yml
-
- JAVA_OPTS=-Xmx512m -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8162
- In IntelliJ, create a "Remote" configuration, set port = 8162 and run in debug mode
- Stop the census-rm-case-api service if already running
- In IntelliJ, create a SpringBoot Run configuration and run in debug mode
From the project root directory, run "mvn clean install", this -
- Runs all unit tests
- Builds a new local docker image
- Brings up this image with all required services and runs all integration tests
- From census-rm-acceptance-tests, run "make test"