Skip to content

Commit 963b3eb

Browse files
committed
CCM-17052: Add new DigitalLetterUnsuccessful event
1 parent 453b908 commit 963b3eb

5 files changed

Lines changed: 64 additions & 5 deletions

File tree

docs/collections/_diagrams/c4code-nhsapp-status-handler.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ architecture-beta
1111
service lambda(logos:aws-lambda)[App Status Handler] in AppStatusHandler
1212
service sqs(logos:aws-sqs)[App Status Queue] in AppStatusHandler
1313
service ddb(aws:arch-amazon-dynamodb)[Items With TTL] in AppStatusHandler
14-
service docReadEvent(aws:res-amazon-eventbridge-event)[DigitalLetterRead Event]
14+
service letterReadEvent(aws:res-amazon-eventbridge-event)[DigitalLetterRead Event]
15+
service letterUnsuccessfulEvent(aws:res-amazon-eventbridge-event)[DigitalLetterUnsuccessful Event]
16+
junction j1
1517
1618
optedOutEvent:R --> L:sqs
1719
sqs:R --> L:lambda
1820
lambda:B --> T:ddb
19-
lambda:R --> L:docReadEvent
21+
lambda:R -- L:j1
22+
j1:R --> L:letterReadEvent
23+
j1:B --> L:letterUnsuccessfulEvent
2024
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: queue-digital-letter-unsuccessful
3+
type: uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1
4+
nice_name: DigitalLetterUnsuccessful
5+
service: Queue Services
6+
schema_envelope: https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1.schema.json
7+
schema_data: https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-queue-digital-letter-unsuccessful-data.schema.json
8+
---
9+
10+
This indicates that a digital letter has failed to send to the NHS App.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
$schema: https://json-schema.org/draft/2020-12/schema
2+
title: DigitalLetterUnsuccessful Data
3+
description: Data payload of the DigitalLetterUnsuccessful event
4+
type: object
5+
additionalProperties: false
6+
properties:
7+
messageReference:
8+
$ref: ../defs/requests.schema.yaml#/properties/messageReference
9+
senderId:
10+
$ref: ../defs/requests.schema.yaml#/properties/senderId
11+
failureCode:
12+
$ref: ../defs/core.schema.yaml#/properties/failureCode
13+
failureReason:
14+
$ref: ../defs/core.schema.yaml#/properties/failureReason
15+
required:
16+
- messageReference
17+
- senderId
18+
- failureCode
19+
- failureReason

src/cloudevents/domains/digital-letters/2025-10-draft/defs/core.schema.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ properties:
1515
type: string
1616
description: "A code representing the reason for failure"
1717
examples:
18-
- "CM_NOT_ALLOWED"
19-
- "CM_NO_SUCH_ROUTING_PLAN"
20-
- "CM_DUPLICATE_REQUEST"
18+
- "CFR_SUPE_0001"
19+
failureReason:
20+
type: string
21+
description: "A human readable desription of the reason for failure"
22+
examples:
23+
- "Failed reason: Not registered with NHS App"
2124
time:
2225
title: "Event Time"
2326
description: "Timestamp when the event occurred (RFC 3339)."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
$schema: https://json-schema.org/draft/2020-12/schema
2+
title: DigitalLetterUnsuccessful
3+
type: object
4+
allOf:
5+
- $ref: ../digital-letters-queue-profile.schema.yaml
6+
properties:
7+
type:
8+
type: string
9+
const: uk.nhs.notify.digital.letters.queue.digital.letter.unsuccessful.v1
10+
description: Concrete versioned event type string for this event (.vN suffix).
11+
source:
12+
type: string
13+
pattern: ^/nhs/england/notify/(production|staging|development|uat)/(primary|secondary|dev-[0-9]+)/digitalletters/queue
14+
description: Event source for digital letters.
15+
16+
dataschema:
17+
type: string
18+
const: ../data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml
19+
description: Canonical URI of the event's data schema.
20+
examples:
21+
- digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml
22+
data:
23+
$ref: ../data/digital-letters-queue-digital-letter-unsuccessful-data.schema.yaml

0 commit comments

Comments
 (0)