Skip to content

Commit 17d0576

Browse files
CCM-7943: Add template event schemas
1 parent 6fb11ca commit 17d0576

File tree

3 files changed

+1189
-0
lines changed

3 files changed

+1189
-0
lines changed
Lines changed: 394 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,394 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"properties": {
5+
"id": {
6+
"type": "string"
7+
},
8+
"time": {
9+
"type": "string",
10+
"format": "date-time",
11+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
12+
},
13+
"type": {
14+
"type": "string",
15+
"const": "uk.nhs.notify.template-management.TemplateCompleted.v1"
16+
},
17+
"source": {
18+
"type": "string"
19+
},
20+
"specversion": {
21+
"type": "string",
22+
"const": "1.0"
23+
},
24+
"datacontenttype": {
25+
"type": "string",
26+
"const": "application/json"
27+
},
28+
"subject": {
29+
"type": "string"
30+
},
31+
"dataschema": {
32+
"type": "string",
33+
"const": "https://notify.nhs.uk/events/schemas/TemplateCompleted/v1.json"
34+
},
35+
"data": {
36+
"allOf": [
37+
{
38+
"anyOf": [
39+
{
40+
"type": "object",
41+
"properties": {
42+
"owner": {
43+
"type": "string"
44+
},
45+
"id": {
46+
"type": "string"
47+
},
48+
"clientId": {
49+
"type": "string"
50+
},
51+
"createdAt": {
52+
"type": "string"
53+
},
54+
"createdBy": {
55+
"type": "string"
56+
},
57+
"name": {
58+
"type": "string"
59+
},
60+
"templateStatus": {
61+
"type": "string",
62+
"enum": [
63+
"DELETED",
64+
"NOT_YET_SUBMITTED",
65+
"PENDING_PROOF_REQUEST",
66+
"PENDING_UPLOAD",
67+
"PENDING_VALIDATION",
68+
"PROOF_AVAILABLE",
69+
"SUBMITTED",
70+
"VALIDATION_FAILED",
71+
"VIRUS_SCAN_FAILED",
72+
"WAITING_FOR_PROOF"
73+
]
74+
},
75+
"updatedAt": {
76+
"type": "string"
77+
},
78+
"updatedBy": {
79+
"type": "string"
80+
},
81+
"message": {
82+
"type": "string"
83+
},
84+
"subject": {
85+
"type": "string"
86+
},
87+
"templateType": {
88+
"type": "string",
89+
"const": "EMAIL"
90+
}
91+
},
92+
"required": [
93+
"owner",
94+
"id",
95+
"createdAt",
96+
"name",
97+
"templateStatus",
98+
"updatedAt",
99+
"message",
100+
"subject",
101+
"templateType"
102+
]
103+
},
104+
{
105+
"type": "object",
106+
"properties": {
107+
"owner": {
108+
"type": "string"
109+
},
110+
"id": {
111+
"type": "string"
112+
},
113+
"clientId": {
114+
"type": "string"
115+
},
116+
"createdAt": {
117+
"type": "string"
118+
},
119+
"createdBy": {
120+
"type": "string"
121+
},
122+
"name": {
123+
"type": "string"
124+
},
125+
"templateStatus": {
126+
"type": "string",
127+
"enum": [
128+
"DELETED",
129+
"NOT_YET_SUBMITTED",
130+
"PENDING_PROOF_REQUEST",
131+
"PENDING_UPLOAD",
132+
"PENDING_VALIDATION",
133+
"PROOF_AVAILABLE",
134+
"SUBMITTED",
135+
"VALIDATION_FAILED",
136+
"VIRUS_SCAN_FAILED",
137+
"WAITING_FOR_PROOF"
138+
]
139+
},
140+
"updatedAt": {
141+
"type": "string"
142+
},
143+
"updatedBy": {
144+
"type": "string"
145+
},
146+
"message": {
147+
"type": "string"
148+
},
149+
"templateType": {
150+
"type": "string",
151+
"const": "NHS_APP"
152+
}
153+
},
154+
"required": [
155+
"owner",
156+
"id",
157+
"createdAt",
158+
"name",
159+
"templateStatus",
160+
"updatedAt",
161+
"message",
162+
"templateType"
163+
]
164+
},
165+
{
166+
"type": "object",
167+
"properties": {
168+
"owner": {
169+
"type": "string"
170+
},
171+
"id": {
172+
"type": "string"
173+
},
174+
"clientId": {
175+
"type": "string"
176+
},
177+
"createdAt": {
178+
"type": "string"
179+
},
180+
"createdBy": {
181+
"type": "string"
182+
},
183+
"name": {
184+
"type": "string"
185+
},
186+
"templateStatus": {
187+
"type": "string",
188+
"enum": [
189+
"DELETED",
190+
"NOT_YET_SUBMITTED",
191+
"PENDING_PROOF_REQUEST",
192+
"PENDING_UPLOAD",
193+
"PENDING_VALIDATION",
194+
"PROOF_AVAILABLE",
195+
"SUBMITTED",
196+
"VALIDATION_FAILED",
197+
"VIRUS_SCAN_FAILED",
198+
"WAITING_FOR_PROOF"
199+
]
200+
},
201+
"updatedAt": {
202+
"type": "string"
203+
},
204+
"updatedBy": {
205+
"type": "string"
206+
},
207+
"files": {
208+
"type": "object",
209+
"properties": {
210+
"proofs": {
211+
"type": "object",
212+
"propertyNames": {
213+
"type": "string"
214+
},
215+
"additionalProperties": {
216+
"type": "object",
217+
"properties": {
218+
"supplier": {
219+
"type": "string"
220+
}
221+
},
222+
"required": [
223+
"supplier"
224+
]
225+
}
226+
}
227+
}
228+
},
229+
"templateType": {
230+
"type": "string",
231+
"const": "LETTER"
232+
},
233+
"language": {
234+
"type": "string",
235+
"enum": [
236+
"ar",
237+
"bg",
238+
"bn",
239+
"de",
240+
"el",
241+
"en",
242+
"es",
243+
"fa",
244+
"fr",
245+
"gu",
246+
"hi",
247+
"hu",
248+
"it",
249+
"ku",
250+
"lt",
251+
"lv",
252+
"ne",
253+
"pa",
254+
"pl",
255+
"pt",
256+
"ro",
257+
"ru",
258+
"sk",
259+
"so",
260+
"sq",
261+
"ta",
262+
"tr",
263+
"ur",
264+
"zh"
265+
]
266+
},
267+
"letterType": {
268+
"type": "string",
269+
"enum": [
270+
"q4",
271+
"x0",
272+
"x1"
273+
]
274+
},
275+
"personalisationParameters": {
276+
"type": "string"
277+
}
278+
},
279+
"required": [
280+
"owner",
281+
"id",
282+
"createdAt",
283+
"name",
284+
"templateStatus",
285+
"updatedAt",
286+
"files",
287+
"templateType",
288+
"language",
289+
"letterType",
290+
"personalisationParameters"
291+
]
292+
},
293+
{
294+
"type": "object",
295+
"properties": {
296+
"owner": {
297+
"type": "string"
298+
},
299+
"id": {
300+
"type": "string"
301+
},
302+
"clientId": {
303+
"type": "string"
304+
},
305+
"createdAt": {
306+
"type": "string"
307+
},
308+
"createdBy": {
309+
"type": "string"
310+
},
311+
"name": {
312+
"type": "string"
313+
},
314+
"templateStatus": {
315+
"type": "string",
316+
"enum": [
317+
"DELETED",
318+
"NOT_YET_SUBMITTED",
319+
"PENDING_PROOF_REQUEST",
320+
"PENDING_UPLOAD",
321+
"PENDING_VALIDATION",
322+
"PROOF_AVAILABLE",
323+
"SUBMITTED",
324+
"VALIDATION_FAILED",
325+
"VIRUS_SCAN_FAILED",
326+
"WAITING_FOR_PROOF"
327+
]
328+
},
329+
"updatedAt": {
330+
"type": "string"
331+
},
332+
"updatedBy": {
333+
"type": "string"
334+
},
335+
"message": {
336+
"type": "string"
337+
},
338+
"templateType": {
339+
"type": "string",
340+
"const": "SMS"
341+
}
342+
},
343+
"required": [
344+
"owner",
345+
"id",
346+
"createdAt",
347+
"name",
348+
"templateStatus",
349+
"updatedAt",
350+
"message",
351+
"templateType"
352+
]
353+
}
354+
]
355+
},
356+
{
357+
"type": "object",
358+
"properties": {
359+
"templateStatus": {
360+
"type": "string",
361+
"enum": [
362+
"SUBMITTED"
363+
]
364+
}
365+
},
366+
"required": [
367+
"templateStatus"
368+
]
369+
}
370+
]
371+
},
372+
"dataschemaversion": {
373+
"type": "string",
374+
"pattern": "^1\\..*"
375+
},
376+
"plane": {
377+
"type": "string",
378+
"const": "control"
379+
}
380+
},
381+
"required": [
382+
"id",
383+
"time",
384+
"type",
385+
"source",
386+
"specversion",
387+
"datacontenttype",
388+
"subject",
389+
"dataschema",
390+
"data",
391+
"dataschemaversion",
392+
"plane"
393+
]
394+
}

0 commit comments

Comments
 (0)