Skip to content

Commit a76a2c9

Browse files
committed
Updates to envelope URIs and source/subject paths
1 parent ce8d53e commit a76a2c9

23 files changed

+882
-263
lines changed

internal/events/schemas/domain/letter.schema.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"title": "Letter",
3+
"description": "The status of a letter in the supplier-api domain.\n\nThis will include the current production status, any reason provided for the status, if applicable, and identifiers used for grouping in reports.",
24
"type": "object",
35
"properties": {
46
"domainId": {
@@ -11,30 +13,36 @@
1113
},
1214
"origin": {
1315
"title": "Letter origin",
14-
"description": "The origin domain identifier, source and subject of the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin in the subject of any corresponding events emitted by the supplier-api domain.",
16+
"description": "Identifiers captured from the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin domain in the subject of any corresponding events emitted by the supplier-api domain.",
1517
"examples": [
1618
{
1719
"domain": "letter-rendering",
18-
"source": "/data-plane/letter-rendering/prod/render-pdf",
19-
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5"
20+
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5",
21+
"event": "00f3b388-bbe9-41c9-9e76-052d37ee8988"
2022
}
2123
],
2224
"type": "object",
2325
"properties": {
2426
"domain": {
27+
"title": "Domain ID",
28+
"description": "The domain which requested this letter",
2529
"type": "string"
2630
},
27-
"source": {
31+
"subject": {
32+
"title": "Event subject",
33+
"description": "The subject of the event which created this letter",
2834
"type": "string"
2935
},
30-
"subject": {
36+
"event": {
37+
"title": "Event ID",
38+
"description": "The ID of the event which created this letter",
3139
"type": "string"
3240
}
3341
},
3442
"required": [
3543
"domain",
36-
"source",
37-
"subject"
44+
"subject",
45+
"event"
3846
]
3947
},
4048
"specificationId": {

internal/events/schemas/events/letter.ACCEPTED.schema.json

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,25 @@
2727
},
2828
"source": {
2929
"title": "Event Source",
30-
"description": "Logical event producer path starting /data-plane or /control-plane followed by lowercase segments.",
31-
"examples": [
32-
"/data-plane/ordering",
33-
"/control-plane/audit"
34-
],
30+
"description": "Logical event producer path within the supplier-api domain",
3531
"type": "string",
36-
"minLength": 12,
37-
"pattern": "^\\/(data-plane|control-plane)(?:\\/[a-z0-9-]+)*$"
32+
"pattern": "^\\/data-plane\\/supplier-api(?:\\/.*)?$"
3833
},
3934
"subject": {
4035
"title": "Event Subject",
4136
"description": "Resource path (no leading slash) within the source made of segments separated by '/'.",
4237
"examples": [
43-
"origin/920fca11-596a-4eca-9c47-99f624614658/order/769acdd4-6a47-496f-999f-76a6fd2c3959/item/4f5e17c0-ec57-4cee-9a86-14580cf5af7d"
38+
"letter-origin/letter-rendering/letter/f47ac10b-58cc-4372-a567-0e02b2c3d479"
4439
],
4540
"type": "string",
46-
"minLength": 5,
47-
"pattern": "^[^\\/]+(\\/[^\\/]+)*$"
41+
"pattern": "^letter-origin\\/[a-z0-9-]+\\/letter\\/[^/]+(?:\\/.*)?"
4842
},
4943
"type": {
44+
"title": "Letter ACCEPTED event type",
45+
"description": "Event type using reverse-DNS style",
46+
"examples": [
47+
"uk.nhs.notify.supplier-api.letter.ACCEPTED.v1"
48+
],
5049
"type": "string",
5150
"enum": [
5251
"uk.nhs.notify.supplier-api.letter.ACCEPTED.v1"
@@ -74,10 +73,17 @@
7473
]
7574
},
7675
"dataschema": {
76+
"title": "Data Schema URI",
77+
"description": "URI of a schema that describes the event data\n\nData schema version must match the major version indicated by the type",
78+
"examples": [
79+
"https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.ACCEPTED.1.0.0.schema.json"
80+
],
7781
"type": "string",
78-
"pattern": "^https:\\/\\/notify\\.nhs\\.uk\\/events\\/supplier-api\\/letter\\/ACCEPTED\\/1\\.\\d+\\.\\d+\\.json$"
82+
"pattern": "^https:\\/\\/notify\\.nhs\\.uk\\/cloudevents\\/schemas\\/supplier-api\\/letter.ACCEPTED.1\\.\\d+\\.\\d+\\.schema.json$"
7983
},
8084
"data": {
85+
"title": "Letter",
86+
"description": "The status of a letter in the supplier-api domain.\n\nThis will include the current production status, any reason provided for the status, if applicable, and identifiers used for grouping in reports.\n\nFor this event the status is always `ACCEPTED`",
8187
"type": "object",
8288
"properties": {
8389
"domainId": {
@@ -90,30 +96,36 @@
9096
},
9197
"origin": {
9298
"title": "Letter origin",
93-
"description": "The origin domain identifier, source and subject of the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin in the subject of any corresponding events emitted by the supplier-api domain.",
99+
"description": "Identifiers captured from the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin domain in the subject of any corresponding events emitted by the supplier-api domain.",
94100
"examples": [
95101
{
96102
"domain": "letter-rendering",
97-
"source": "/data-plane/letter-rendering/prod/render-pdf",
98-
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5"
103+
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5",
104+
"event": "00f3b388-bbe9-41c9-9e76-052d37ee8988"
99105
}
100106
],
101107
"type": "object",
102108
"properties": {
103109
"domain": {
110+
"title": "Domain ID",
111+
"description": "The domain which requested this letter",
104112
"type": "string"
105113
},
106-
"source": {
114+
"subject": {
115+
"title": "Event subject",
116+
"description": "The subject of the event which created this letter",
107117
"type": "string"
108118
},
109-
"subject": {
119+
"event": {
120+
"title": "Event ID",
121+
"description": "The ID of the event which created this letter",
110122
"type": "string"
111123
}
112124
},
113125
"required": [
114126
"domain",
115-
"source",
116-
"subject"
127+
"subject",
128+
"event"
117129
]
118130
},
119131
"specificationId": {
@@ -295,6 +307,8 @@
295307
]
296308
},
297309
"dataschemaversion": {
310+
"title": "Data Schema Version",
311+
"description": "Matches semantic versioning format with fixed major version (Not part of cloudevents spec?)",
298312
"type": "string",
299313
"pattern": "^1\\.\\d+\\.\\d+$"
300314
}

internal/events/schemas/events/letter.CANCELLED.schema.json

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,25 @@
2727
},
2828
"source": {
2929
"title": "Event Source",
30-
"description": "Logical event producer path starting /data-plane or /control-plane followed by lowercase segments.",
31-
"examples": [
32-
"/data-plane/ordering",
33-
"/control-plane/audit"
34-
],
30+
"description": "Logical event producer path within the supplier-api domain",
3531
"type": "string",
36-
"minLength": 12,
37-
"pattern": "^\\/(data-plane|control-plane)(?:\\/[a-z0-9-]+)*$"
32+
"pattern": "^\\/data-plane\\/supplier-api(?:\\/.*)?$"
3833
},
3934
"subject": {
4035
"title": "Event Subject",
4136
"description": "Resource path (no leading slash) within the source made of segments separated by '/'.",
4237
"examples": [
43-
"origin/920fca11-596a-4eca-9c47-99f624614658/order/769acdd4-6a47-496f-999f-76a6fd2c3959/item/4f5e17c0-ec57-4cee-9a86-14580cf5af7d"
38+
"letter-origin/letter-rendering/letter/f47ac10b-58cc-4372-a567-0e02b2c3d479"
4439
],
4540
"type": "string",
46-
"minLength": 5,
47-
"pattern": "^[^\\/]+(\\/[^\\/]+)*$"
41+
"pattern": "^letter-origin\\/[a-z0-9-]+\\/letter\\/[^/]+(?:\\/.*)?"
4842
},
4943
"type": {
44+
"title": "Letter CANCELLED event type",
45+
"description": "Event type using reverse-DNS style",
46+
"examples": [
47+
"uk.nhs.notify.supplier-api.letter.CANCELLED.v1"
48+
],
5049
"type": "string",
5150
"enum": [
5251
"uk.nhs.notify.supplier-api.letter.CANCELLED.v1"
@@ -74,10 +73,17 @@
7473
]
7574
},
7675
"dataschema": {
76+
"title": "Data Schema URI",
77+
"description": "URI of a schema that describes the event data\n\nData schema version must match the major version indicated by the type",
78+
"examples": [
79+
"https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.ACCEPTED.1.0.0.schema.json"
80+
],
7781
"type": "string",
78-
"pattern": "^https:\\/\\/notify\\.nhs\\.uk\\/events\\/supplier-api\\/letter\\/CANCELLED\\/1\\.\\d+\\.\\d+\\.json$"
82+
"pattern": "^https:\\/\\/notify\\.nhs\\.uk\\/cloudevents\\/schemas\\/supplier-api\\/letter.CANCELLED.1\\.\\d+\\.\\d+\\.schema.json$"
7983
},
8084
"data": {
85+
"title": "Letter",
86+
"description": "The status of a letter in the supplier-api domain.\n\nThis will include the current production status, any reason provided for the status, if applicable, and identifiers used for grouping in reports.\n\nFor this event the status is always `CANCELLED`",
8187
"type": "object",
8288
"properties": {
8389
"domainId": {
@@ -90,30 +96,36 @@
9096
},
9197
"origin": {
9298
"title": "Letter origin",
93-
"description": "The origin domain identifier, source and subject of the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin in the subject of any corresponding events emitted by the supplier-api domain.",
99+
"description": "Identifiers captured from the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin domain in the subject of any corresponding events emitted by the supplier-api domain.",
94100
"examples": [
95101
{
96102
"domain": "letter-rendering",
97-
"source": "/data-plane/letter-rendering/prod/render-pdf",
98-
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5"
103+
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5",
104+
"event": "00f3b388-bbe9-41c9-9e76-052d37ee8988"
99105
}
100106
],
101107
"type": "object",
102108
"properties": {
103109
"domain": {
110+
"title": "Domain ID",
111+
"description": "The domain which requested this letter",
104112
"type": "string"
105113
},
106-
"source": {
114+
"subject": {
115+
"title": "Event subject",
116+
"description": "The subject of the event which created this letter",
107117
"type": "string"
108118
},
109-
"subject": {
119+
"event": {
120+
"title": "Event ID",
121+
"description": "The ID of the event which created this letter",
110122
"type": "string"
111123
}
112124
},
113125
"required": [
114126
"domain",
115-
"source",
116-
"subject"
127+
"subject",
128+
"event"
117129
]
118130
},
119131
"specificationId": {
@@ -295,6 +307,8 @@
295307
]
296308
},
297309
"dataschemaversion": {
310+
"title": "Data Schema Version",
311+
"description": "Matches semantic versioning format with fixed major version (Not part of cloudevents spec?)",
298312
"type": "string",
299313
"pattern": "^1\\.\\d+\\.\\d+$"
300314
}

internal/events/schemas/events/letter.DELIVERED.schema.json

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,25 @@
2727
},
2828
"source": {
2929
"title": "Event Source",
30-
"description": "Logical event producer path starting /data-plane or /control-plane followed by lowercase segments.",
31-
"examples": [
32-
"/data-plane/ordering",
33-
"/control-plane/audit"
34-
],
30+
"description": "Logical event producer path within the supplier-api domain",
3531
"type": "string",
36-
"minLength": 12,
37-
"pattern": "^\\/(data-plane|control-plane)(?:\\/[a-z0-9-]+)*$"
32+
"pattern": "^\\/data-plane\\/supplier-api(?:\\/.*)?$"
3833
},
3934
"subject": {
4035
"title": "Event Subject",
4136
"description": "Resource path (no leading slash) within the source made of segments separated by '/'.",
4237
"examples": [
43-
"origin/920fca11-596a-4eca-9c47-99f624614658/order/769acdd4-6a47-496f-999f-76a6fd2c3959/item/4f5e17c0-ec57-4cee-9a86-14580cf5af7d"
38+
"letter-origin/letter-rendering/letter/f47ac10b-58cc-4372-a567-0e02b2c3d479"
4439
],
4540
"type": "string",
46-
"minLength": 5,
47-
"pattern": "^[^\\/]+(\\/[^\\/]+)*$"
41+
"pattern": "^letter-origin\\/[a-z0-9-]+\\/letter\\/[^/]+(?:\\/.*)?"
4842
},
4943
"type": {
44+
"title": "Letter DELIVERED event type",
45+
"description": "Event type using reverse-DNS style",
46+
"examples": [
47+
"uk.nhs.notify.supplier-api.letter.DELIVERED.v1"
48+
],
5049
"type": "string",
5150
"enum": [
5251
"uk.nhs.notify.supplier-api.letter.DELIVERED.v1"
@@ -74,10 +73,17 @@
7473
]
7574
},
7675
"dataschema": {
76+
"title": "Data Schema URI",
77+
"description": "URI of a schema that describes the event data\n\nData schema version must match the major version indicated by the type",
78+
"examples": [
79+
"https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.ACCEPTED.1.0.0.schema.json"
80+
],
7781
"type": "string",
78-
"pattern": "^https:\\/\\/notify\\.nhs\\.uk\\/events\\/supplier-api\\/letter\\/DELIVERED\\/1\\.\\d+\\.\\d+\\.json$"
82+
"pattern": "^https:\\/\\/notify\\.nhs\\.uk\\/cloudevents\\/schemas\\/supplier-api\\/letter.DELIVERED.1\\.\\d+\\.\\d+\\.schema.json$"
7983
},
8084
"data": {
85+
"title": "Letter",
86+
"description": "The status of a letter in the supplier-api domain.\n\nThis will include the current production status, any reason provided for the status, if applicable, and identifiers used for grouping in reports.\n\nFor this event the status is always `DELIVERED`",
8187
"type": "object",
8288
"properties": {
8389
"domainId": {
@@ -90,30 +96,36 @@
9096
},
9197
"origin": {
9298
"title": "Letter origin",
93-
"description": "The origin domain identifier, source and subject of the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin in the subject of any corresponding events emitted by the supplier-api domain.",
99+
"description": "Identifiers captured from the original event that introduced the letter to the supplier-api domain.\n\nThe identifier will be included as the origin domain in the subject of any corresponding events emitted by the supplier-api domain.",
94100
"examples": [
95101
{
96102
"domain": "letter-rendering",
97-
"source": "/data-plane/letter-rendering/prod/render-pdf",
98-
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5"
103+
"subject": "customer/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-rendering/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5",
104+
"event": "00f3b388-bbe9-41c9-9e76-052d37ee8988"
99105
}
100106
],
101107
"type": "object",
102108
"properties": {
103109
"domain": {
110+
"title": "Domain ID",
111+
"description": "The domain which requested this letter",
104112
"type": "string"
105113
},
106-
"source": {
114+
"subject": {
115+
"title": "Event subject",
116+
"description": "The subject of the event which created this letter",
107117
"type": "string"
108118
},
109-
"subject": {
119+
"event": {
120+
"title": "Event ID",
121+
"description": "The ID of the event which created this letter",
110122
"type": "string"
111123
}
112124
},
113125
"required": [
114126
"domain",
115-
"source",
116-
"subject"
127+
"subject",
128+
"event"
117129
]
118130
},
119131
"specificationId": {
@@ -295,6 +307,8 @@
295307
]
296308
},
297309
"dataschemaversion": {
310+
"title": "Data Schema Version",
311+
"description": "Matches semantic versioning format with fixed major version (Not part of cloudevents spec?)",
298312
"type": "string",
299313
"pattern": "^1\\.\\d+\\.\\d+$"
300314
}

0 commit comments

Comments
 (0)