From 122d7a86ddb952d7b71c69a62dcf858a2558a0e1 Mon Sep 17 00:00:00 2001 From: Matthew Ryall Date: Thu, 21 Sep 2023 14:26:39 +0100 Subject: [PATCH] PI-1480: Document Manage Offences and Delius service --- projects/manage-offences-and-delius/README.md | 18 +++++++++++++-- .../source/async-api-reference.html.md.erb | 9 ++++++++ .../tech-docs/spec/async-api.yaml | 23 +++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 projects/manage-offences-and-delius/tech-docs/source/async-api-reference.html.md.erb create mode 100644 projects/manage-offences-and-delius/tech-docs/spec/async-api.yaml diff --git a/projects/manage-offences-and-delius/README.md b/projects/manage-offences-and-delius/README.md index 0db07b027e..e5088eb53e 100644 --- a/projects/manage-offences-and-delius/README.md +++ b/projects/manage-offences-and-delius/README.md @@ -1,3 +1,17 @@ -# manage-offences-and-delius +# Manage Offences and Delius -// TODO Describe the service \ No newline at end of file +## Business Need + +Inbound service that responds to events raised by the HMPPS Manage Offences service when there are changes to the set of [CJS Offence Codes](https://www.criminaljusticehub.org.uk/jargon-buster/cjs-offence-code/) managed by that service. Any changes to the set of offence codes is reflected in the Delius database. This ensures that Delius is up-to-date with the common set of offence codes used across HMPPS Digital services. + +## Interfaces + +### Message Formats + +The service responds to an HMPPS Domain Event message via an +[SQS Queue](https://github.com/ministryofjustice/cloud-platform-environments/blob/main/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-probation-integration-services-prod/resources/manage-offences-and-delius-queue.tf). +The events are raised by the [Manage Offences API](https://github.com/ministryofjustice/hmpps-manage-offences-api) when a CJS offence code is either created or updated. + +| Business Event | Message Class | Message Event Type / Filter | +|----------------------------|--------------------|---------------------------------| +| Change to CJS offence code | HMPPS Domain Event | manage-offences.offence.changed | diff --git a/projects/manage-offences-and-delius/tech-docs/source/async-api-reference.html.md.erb b/projects/manage-offences-and-delius/tech-docs/source/async-api-reference.html.md.erb new file mode 100644 index 0000000000..d124207aaf --- /dev/null +++ b/projects/manage-offences-and-delius/tech-docs/source/async-api-reference.html.md.erb @@ -0,0 +1,9 @@ +--- +title: AsyncAPI Reference +source_url: 'https://github.com/ministryofjustice/hmpps-probation-integration-services/blob/main/projects/manage-offences-and-delius/tech-docs/source/async-api-reference.html.md.erb' +weight: 30 +--- + +# ASyncAPI Reference + +* [ASyncAPI Spec](https://studio.asyncapi.com/?url=https://raw.githubusercontent.com/ministryofjustice/hmpps-probation-integration-services/main/projects/manage-offences-and-delius/tech-docs/spec/async-api.yaml&readOnly) diff --git a/projects/manage-offences-and-delius/tech-docs/spec/async-api.yaml b/projects/manage-offences-and-delius/tech-docs/spec/async-api.yaml new file mode 100644 index 0000000000..1442eda755 --- /dev/null +++ b/projects/manage-offences-and-delius/tech-docs/spec/async-api.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.6.0 +info: + title: Manage Offences and Delius + description: Reflect changes to CJS offence codes in Delius + version: 0.1.0 + +servers: + development: + url: https://sqs.eu-west-2.amazonaws.com/754256621582/probation-integration-dev-manage-offences-and-delius-queue + protocol: sqs + preproduction: + url: https://sqs.eu-west-2.amazonaws.com/754256621582/probation-integration-preprod-manage-offences-and-delius-queue + protocol: sqs + production: + url: https://sqs.eu-west-2.amazonaws.com/754256621582/probation-integration-prod-manage-offences-and-delius-queue + protocol: sqs + +channels: + hmpps-domain-events/manage-offences-and-delius/offence-changed: + subscribe: + operationId: + message: + $ref: https://raw.githubusercontent.com/ministryofjustice/hmpps-domain-events/main/spec/schemas/manage-offences/offence-changed.yml