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.
Browse files
Browse the repository at this point in the history
* PI-2187 Add tech docs for domain events and Delius * PI-2187 Fix the paths to the generated images in the tech docs
- Loading branch information
1 parent
f9d6fe6
commit 7f45d38
Showing
5 changed files
with
1,069 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,30 @@ | ||
# domain-events-and-delius | ||
# Domain events and Delius | ||
This domain event service enables enhancement of domain events from Delius. The domain events are retrieved from the database in batches, enhanced and published to SNS. | ||
|
||
// TODO Describe the service | ||
The supported domain event enhancers are: | ||
|
||
| Message event type | Description | | ||
| --------------------------------- | --------------------------------------------- | | ||
| probation-case.engagement.created | Adds a detail URL to retrieve engagement data | | ||
|
||
# Data dependencies | ||
Domain event service depends on Delius for retrieving batches of domain events waiting to be processed. Each domain event will contain a unique ID, message body and message attributes. The message body will contain the event type. | ||
|
||
## Context map - Domain Event Data | ||
|
||
![](./tech-docs/source/img/domain-events-context-map.svg) | ||
|
||
# Workflows | ||
## Enhancing a domain event | ||
Domain events are retrieved from the database in batches. Each domain event will be processed in order. The domain event will contain an event type within the message body. The event type is mapped to an enhancement if one exists, otherwise it is matched to a no enhancement catch-all which will just publish the original domain event. Once a domain event has been enhanced it will be published to SNS. | ||
|
||
![](./tech-docs/source/img/domain-events-enhancement-workflow.svg) | ||
|
||
# API Access Control | ||
API endpoints are available to retrieve additional information related to a domain event. These URLs will be added to the domain event message by enhancers within the domain event service. | ||
|
||
The API endpoints are secured by roles supplied by the HMPPS Auth client used in the requests. | ||
|
||
| API endpoint | Required role | | ||
| --------------------------------------- | ------------------------------------------ | | ||
| probation-case.engagement.created/{crn} | PROBATION_API_\_DOMAIN_EVENTS_\_ENGAGEMENT | |
33 changes: 33 additions & 0 deletions
33
projects/domain-events-and-delius/tech-docs/diag/domain-events-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,33 @@ | ||
|
||
style { ...@../../../../script/style.style } | ||
vars { ...@../../../../script/style.vars } | ||
** { ...@../../../../script/style.all-style } | ||
|
||
context-delius: Delius Context { | ||
|
||
entities: Entities { | ||
grid-columns: 2 | ||
person: Person on Probation | ||
event: Domain event { | ||
message: Message body | ||
attributes: Message attributes | ||
} | ||
} | ||
} | ||
|
||
context-notification: Notification Context { | ||
|
||
interface: Delius and\n Notification { | ||
type: Anti-Corruption\nLayer | ||
} | ||
|
||
entities: Entities { | ||
grid-columns: 2 | ||
notification: Notification { | ||
message: Message | ||
attributes: Attributes | ||
} | ||
} | ||
} | ||
|
||
context-delius--context-notification.interface: Upstream\n\n\nDownstream |
30 changes: 30 additions & 0 deletions
30
projects/domain-events-and-delius/tech-docs/diag/domain-events-enhancement-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,30 @@ | ||
# Domain Event Workflow: Domain Event Enhancement | ||
|
||
direction: right | ||
|
||
style { ...@../../../../script/style.style } | ||
vars { ...@../../../../script/style.vars } | ||
** { ...@../../../../script/style.all-style } | ||
|
||
# Domain Event Enhancement | ||
domain-event-enhancement: Domain Event Enhancement { | ||
style.font-size: 24 | ||
grid-columns: 2 | ||
|
||
d_get_events: Get domain events batch | ||
d_enhance_events: Enhance domain event | ||
d_publish: Publish notification | ||
|
||
d_get_events -> d_enhance_events -> d_publish | ||
|
||
explanation: |md | ||
## Enhance an event | ||
- Get batch of domain events | ||
- If event type is supported,\ | ||
enhance the event | ||
- Transform the event to\ | ||
a notification | ||
- Publish the notification | ||
| | ||
|
||
} |
Oops, something went wrong.