This is a Spring Boot application, written in Kotlin, providing data access to support the Offender Categorisation application.
Start the postrgres form-builder database and localstack from the offender categorisation project. Create a run configuration and apply the following environment variables:
DB_SERVER=localhost;DB_NAME=form-builder;DB_USER=form-builder;DB_PASS=form-builder
You may need to create the Risk Profiler schema. Best way would be to run the reset.sql test script to create the schema and the previous_profile database table that is used to gather data for SAR.
Set active profile to local and set the user id an token for api.client.admin.id property
User requires role ROLE_SAR_DATA_ACCESS to access SAR information. Without the role a 401 will be returned
The current service exposes only SAR GET Rest Endpoint. This endpoint is standardised in uk.gov.justice.hmpps.kotlin.sar.HmppsPrisonSubjectAccessRequestService which is part of uk.gov.justice.service.hmpps:hmpps-kotlin-spring-boot-starter dependency - see build.gradle.kts).
Open API specification - https://hmpps-offender-categorisation-api-dev.hmpps.service.justice.gov.uk/swagger-ui/index.html?configUrl=/v3/api-docs
Health - https://hmpps-offender-categorisation-api-dev.hmpps.service.justice.gov.uk/health
SAR Request - https://hmpps-offender-categorisation-api-dev.hmpps.service.justice.gov.uk/subject-access-request?prn=5555
All unit and integration tests should run straight out of the box.