generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PI-2742 Add tech docs for court case and Delius
- Loading branch information
1 parent
2f24e4f
commit 9da2dfe
Showing
5 changed files
with
1,178 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,49 @@ | ||
# court-case-and-delius | ||
# Court Case and Delius | ||
|
||
// TODO Describe the service | ||
This service listens for domain events containing case notes. The notes are merged with an existing case note or a new case note is created if one does not exist. If a case note arrives out of order, a warning will be logged and it will be ignored. | ||
|
||
This service also provides a read-only API for authorised users to get information about a **Court case** and the **Conviction**. | ||
|
||
# Business need | ||
|
||
The consumer is used to update the Delius system when a case note is published for a Court case. The Delius system is used to inform practitioners, who manage cases, when there has been an update to the case notes. | ||
|
||
The service also provides an API which is used by the Prepare a Case for Sentence service to get Court case details. | ||
|
||
# Data dependencies | ||
This service enables adding or updating data for case notes (contact entity in Delius) only. It provides read-only access relating to a **Person on Probation**, the **Event** (convictions, offences and Court appearances outcomes) and the **Court case** details. | ||
|
||
## Context Map - Court Case data | ||
|
||
![Context Map](./tech-docs/source/img/court-case-context-map.svg) | ||
|
||
# Workflows | ||
## Court case notes submitted | ||
The notes are merged with an existing case note or a new case note is created if one does not exist. If a case note arrives out of order, a warning will be logged and it will be ignored. | ||
|
||
| Business Event | Message Event Type / Filter | | ||
| ------------------------- | ---------------------------- | | ||
| Court case note published | court-case.comment.published | | ||
|
||
![Context Map](./tech-docs/source/img/court-case-notes-submitted-workflow.svg) | ||
|
||
# Interface | ||
## Message formats | ||
|
||
The service responds to HMPPS Domain Event messages via the | ||
[Court Case and Delius Queue](https://github.com/ministryofjustice/cloud-platform-environments/blob/main/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-probation-integration-services-prod/resources/court-case-and-delius-queue.tf). | ||
The events are raised by TODO. | ||
|
||
Example [messages](./src/dev/resources/messages/) are in the development source tree. | ||
|
||
Incoming messages are filtered on `eventType` by the [SQS queue policy](https://github.com/ministryofjustice/cloud-platform-environments/blob/main/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-probation-integration-services-prod/resources/court-case-and-delius-queue.tf) | ||
|
||
# API Access Control | ||
|
||
API endpoints are secured by roles supplied by the HMPPS Auth client used in | ||
the requests | ||
|
||
| API Endpoint | Required Role | | ||
| ---------------------- | ----------------------------------------- | | ||
| /secure/offenders/ | PROBATION_API_\_COURT_CASE_\_CASE_DETAILS | | ||
| /probation-case/{urn}/ | PROBATION_API_\_COURT_CASE_\_CASE_DETAILS | |
63 changes: 63 additions & 0 deletions
63
projects/court-case-and-delius/tech-docs/diag/court-case-context-map.d2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
style { ...@../../../../script/style.style } | ||
vars { ...@../../../../script/style.vars } | ||
** { ...@../../../../script/style.all-style } | ||
|
||
context-cc: Court Case Context { | ||
entities: Entities { | ||
grid-columns: 4 | ||
pop: Person on Probation | ||
pm: Person manager | ||
conviction: Conviction | ||
attendances: Attendances | ||
registrations: Registrations | ||
court-reports: Court reports | ||
probation-record: Probation record | ||
document: Document | ||
status: Sentence status | ||
lc: Licence conditions | ||
cr: Conviction requirements | ||
pr: PSS requirements | ||
nsi: NSI details | ||
} | ||
} | ||
|
||
context-delius: Delius Context { | ||
|
||
interface: Court Case\n and Delius { | ||
type: Anti-Corruption\nLayer | ||
} | ||
|
||
entities: Entities { | ||
grid-columns: 5 | ||
person: Person on Probation | ||
person-manager: Person manager | ||
prison-manager: Prison manager | ||
order-manager: Order manager | ||
report-manager: Report manager | ||
staff: Staff | ||
contact: Contact | ||
event: Event | ||
offence: Offence | ||
registration: Registration | ||
deregistration: Deregistration | ||
probation-area: Probation area | ||
institution: Institution | ||
court: Court | ||
court-attendance: Court appearance | ||
court-report: Court report | ||
cr: Conviction requirement | ||
pr: PSS requirement | ||
lc: Licence condition | ||
requirement: Requirement | ||
attendance: Attendance | ||
disposal: Disposal | ||
release: Release | ||
provision: Provision | ||
as: Additional sentence | ||
document: Document | ||
nsi: NSI | ||
} | ||
} | ||
|
||
context-cc--context-delius.interface: Upstream\n\n\nDownstream |
49 changes: 49 additions & 0 deletions
49
projects/court-case-and-delius/tech-docs/diag/court-case-notes-submitted-workflow.d2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Court Case Workflow: Case Note Published | ||
|
||
direction: right | ||
|
||
style { ...@../../../../script/style.style } | ||
vars { ...@../../../../script/style.vars } | ||
** { ...@../../../../script/style.all-style } | ||
|
||
# What triggers the workflow? | ||
case-notes-published: Court Case Note Published { | ||
style.font-size: 24 | ||
|
||
explanation: |md | ||
## Court Case Note Published | ||
- A Court case note is\ | ||
published | ||
| | ||
|
||
case_note_published: Court Case Note Published | ||
} | ||
|
||
domain_event: "court-case-and-delius\n.court-case.comment.published" { | ||
style.font-size: 12 | ||
shape: queue | ||
} | ||
|
||
# What happens in Delius? | ||
delius: Delius { | ||
style.font-size: 24 | ||
grid-columns: 2 | ||
|
||
d_check_date: Check date of note | ||
d_merge_notes: Add/Merge case note | ||
|
||
d_check_date -> d_merge_notes | ||
|
||
explanation: |md | ||
## Merge case notes | ||
- Check whether the notes have\ | ||
arrived out of order. If so,\ | ||
log a warning and ignore notes | ||
- If case notes exist, merge the\ | ||
case notes | ||
- Otherwise, add new case notes | ||
| | ||
|
||
} | ||
|
||
case-notes-published -> domain_event -> delius |
Oops, something went wrong.