This API handles callbacks from CCD for the Criminal Injuries Compensation (CIC) (and other services, in the future e.g. Mental Health) case type for Special Tribunals (ST).
┌──────────────────┐
│ │
│ SPTRIBS-CASE-API │
│ │
└───────▲──────────┘
│
│
┌───────▼────────┐
│ │
┌─────► CCD ◄─────┐
│ │ │ │
│ └────────────────┘ │
│ │
┌───────┴───────────┐ ┌───────┴───────┐
│ │ │ │
│ SPTRIBS-FRONTEND │ │ XUI │
│ │ │ │
└───────────────────┘ └───────────────┘
The project uses Gradle as a build tool. It already contains
./gradlew
wrapper script, so there's no need to install gradle.
To build the project, execute the following command:
./gradlew build
You will need access to the sptribs-aat vault, and an active VPN to run locally, as it depends on services running on AAT.
Run the application by executing the following command:
./gradlew bootRun
This will start the API container exposing the application's port
(set to 4013
in this template app).
In order to test if the application is up, you can call its health endpoint:
curl http://localhost:4013/health
You should get a response similar to this:
{"status":"UP","diskSpace":{"status":"UP","total":249644974080,"free":137188298752,"threshold":10485760}}
If you would like to run the full CCD and XUI stack locally you can use:
./gradlew bootWithCcd
Then you can access XUI on http://localhost:3000
Generating the CCD JSON files will happen on every ./gradlew bootWithCcd
but you can manually trigger this with:
./gradlew generateCCDConfig
./gradlew generateTypeScript
You can manually run a cron task from the cli:
TASK_NAME=[task] java -jar sptribs-case-api.jar run
# E.g.
TASK_NAME=SystemProgressHeldCasesTask java -jar sptribs-case-api.jar
# or
TASK_NAME=SystemProgressHeldCasesTask ./gradlew bootRun
To configure a new cron in AAT please check out the cnp-flux-config repository and run:
./bin/add-cron.sh SystemProgressHeldCasesTask ~/cnp-flux-config "0/10 * * * *"
Then create a PR in the cnp-flux-config repository.
Note that the cron will only run in the aat-00 cluster as we don't have a way to run the job once over multiple clusters. Let's hope that cluster doesn't go down.
This project is licensed under the MIT License - see the LICENSE file for details.