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.
Merge branch 'main' into feature/PI-2096-get-secure-offenders-crn-crn…
…-convictions
- Loading branch information
Showing
9 changed files
with
2,008 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,47 @@ | ||
# cas2-and-delius | ||
# CAS2 and Delius | ||
|
||
// TODO Describe the service | ||
Service that responds to Community Accommodation Services Tier 2 (CAS2) domain events. The service is responsible for updating Delius with progress of referrals to short-term accommodation for people released from custody on Home Detention Curfew or bail. | ||
|
||
## Business Need | ||
|
||
Ensuring the Probation Practitioner has an up-to-date view of activity in the CAS2 service when interacting with the probation case via Delius. | ||
|
||
## Context Map | ||
|
||
![Context Map](./tech-docs/source/img/cas2-and-delius-context-map.svg) | ||
|
||
## Workflows | ||
|
||
CAS2 domain events are raised in real time as referral applications are processed. There is a single update domain event to inform of progress or changes to the referral application. | ||
|
||
### Create a CAS2 Referral Application | ||
|
||
A referral application is created in the CAS2 service which is reflected in a Delius contact. An `EXTERNAL_REFERENCE` URN is added to the contact in the form `urn:hmpps:cas2:application-submitted:{referralId}` using the CAS2 referral ID as a unique reference. | ||
|
||
| Business Event | Message Event Type / Filter | | ||
|---------------------------------------------------------------|----------------------------------------------| | ||
| Submission of a accommodation referral application | applications.cas2.application.submitted | | ||
|
||
![Context Map](./tech-docs/source/img/cas2-and-delius-workflow-application.svg) | ||
|
||
### Update the Status of a CAS2 Referral Application | ||
|
||
A referral application is updated in the CAS2 service which is reflected in a Delius contact. Only a single update contact exists in Delius for any single CAS2 referral and the contact is updated with the latest status. An `EXTERNAL_REFERENCE` URN is added to the contact in the form `urn:hmpps:cas2:application-status-updated:{referralId}` using the CAS2 referral ID as a unique reference. | ||
|
||
| Business Event | Message Event Type / Filter | | ||
|---------------------------------------------------------------|----------------------------------------------| | ||
| Update to the status of an accommodation referral application | applications.cas2.application.status-updated | | ||
|
||
![Context Map](./tech-docs/source/img/cas2-and-delius-workflow-application-update.svg) | ||
|
||
## Interfaces | ||
|
||
### Message Interface | ||
|
||
The service responds to HMPPS Domain Event messages via the | ||
[Queue](https://github.com/ministryofjustice/cloud-platform-environments/blob/main/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-probation-integration-services-prod/resources/cas2-and-delius-queue.tf). | ||
The events are raised by the [HMPPS Approved Premises API](https://github.com/ministryofjustice/hmpps-approved-premises-api/) which handles backend integration for the [CAS2 UI](https://github.com/ministryofjustice/hmpps-community-accommodation-tier-2-ui) | ||
|
||
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/2aeb8aeb7b7798cbe12bc81b14d01aaa707041f1/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-probation-integration-services-prod/resources/cas2-and-delius-queue.tf#L5-L10) |
28 changes: 28 additions & 0 deletions
28
projects/cas2-and-delius/tech-docs/diag/cas2-and-delius-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,28 @@ | ||
|
||
style { ...@../../../../script/style.style } | ||
vars { ...@../../../../script/style.vars } | ||
** { ...@../../../../script/style.all-style } | ||
|
||
context-cas2: CAS2 Context { | ||
entities: Entities { | ||
grid-columns: 2 | ||
pop: Person on Probation | ||
referral: Accommodation Referral | ||
} | ||
} | ||
|
||
context-delius: Delius Context { | ||
|
||
interface: CAS2 and Delius { | ||
type: Anti-Corruption\nLayer | ||
} | ||
|
||
entities: Entities { | ||
grid-columns: 2 | ||
pop: Person on Probation | ||
contact: Contact | ||
manager: Offender Manager | ||
} | ||
} | ||
|
||
context-cas2--context-delius.interface: Upstream\n\n\nDownstream |
42 changes: 42 additions & 0 deletions
42
projects/cas2-and-delius/tech-docs/diag/cas2-and-delius-workflow-application-update.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,42 @@ | ||
# CAS2 Workflow: Referral Application Status Update | ||
|
||
style { ...@../../../../script/style.style } | ||
vars { ...@../../../../script/style.vars } | ||
** { ...@../../../../script/style.all-style } | ||
|
||
direction: right | ||
|
||
# What triggers the workflow? | ||
cas2: CAS2 { | ||
style.font-size: 24 | ||
|
||
explanation: |md | ||
## Referral Application Workflow | ||
Updates to referral applications raise domain events | ||
| | ||
|
||
application_updated: Application Updated | ||
} | ||
|
||
domain_event_1: "applications.cas2\n.application.status-updated" { | ||
style.font-size: 12 | ||
shape: queue | ||
} | ||
|
||
# What happens in Delius? | ||
delius: Delius { | ||
style.font-size: 24 | ||
|
||
explanation: |md | ||
## Delius Workflow | ||
Referral application status contact is created\ | ||
or updated Delius to reflect referral application changes | ||
| | ||
|
||
d_contact_create: Create Contact | ||
d_contact_update: Update Contact | ||
} | ||
|
||
cas2 -> domain_event_1 | ||
|
||
domain_event_1 -> delius |
41 changes: 41 additions & 0 deletions
41
projects/cas2-and-delius/tech-docs/diag/cas2-and-delius-workflow-application.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,41 @@ | ||
# CAS2 Workflow: Referral Application | ||
|
||
style { ...@../../../../script/style.style } | ||
vars { ...@../../../../script/style.vars } | ||
** { ...@../../../../script/style.all-style } | ||
|
||
direction: right | ||
|
||
# What triggers the workflow? | ||
cas2: CAS2 { | ||
style.font-size: 24 | ||
|
||
explanation: |md | ||
## Referral Application Workflow | ||
Referral application actions raise domain events | ||
| | ||
|
||
application_submitted: Application Submitted | ||
} | ||
|
||
domain_event_1: "applications.cas2\n.application.submitted" { | ||
style.font-size: 12 | ||
shape: queue | ||
} | ||
|
||
# What happens in Delius? | ||
delius: Delius { | ||
style.font-size: 24 | ||
|
||
explanation: |md | ||
## Delius Workflow | ||
Contact is added to Delius \ | ||
to indicate referral application creation | ||
| | ||
|
||
d_contact: Create Contact | ||
} | ||
|
||
cas2 -> domain_event_1 | ||
|
||
domain_event_1 -> delius |
120 changes: 120 additions & 0 deletions
120
projects/cas2-and-delius/tech-docs/source/img/cas2-and-delius-context-map.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
854 changes: 854 additions & 0 deletions
854
...and-delius/tech-docs/source/img/cas2-and-delius-workflow-application-update.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.