|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "type": "object", |
| 4 | + "properties": { |
| 5 | + "id": { |
| 6 | + "description": "Unique ID for this event", |
| 7 | + "type": "string", |
| 8 | + "maxLength": 1000 |
| 9 | + }, |
| 10 | + "time": { |
| 11 | + "description": "Time the event was generated", |
| 12 | + "type": "string", |
| 13 | + "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$" |
| 14 | + }, |
| 15 | + "type": { |
| 16 | + "type": "string", |
| 17 | + "const": "uk.nhs.notify.template-management.RoutingConfigCompleted.v1" |
| 18 | + }, |
| 19 | + "source": { |
| 20 | + "description": "Source of the event", |
| 21 | + "type": "string" |
| 22 | + }, |
| 23 | + "specversion": { |
| 24 | + "description": "Version of the envelope event schema", |
| 25 | + "type": "string", |
| 26 | + "const": "1.0" |
| 27 | + }, |
| 28 | + "datacontenttype": { |
| 29 | + "description": "Always application/json", |
| 30 | + "type": "string", |
| 31 | + "const": "application/json" |
| 32 | + }, |
| 33 | + "subject": { |
| 34 | + "description": "Unique identifier for the item in the event data", |
| 35 | + "type": "string", |
| 36 | + "format": "uuid", |
| 37 | + "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" |
| 38 | + }, |
| 39 | + "dataschema": { |
| 40 | + "type": "string", |
| 41 | + "const": "https://notify.nhs.uk/events/schemas/RoutingConfigCompleted/v1.json" |
| 42 | + }, |
| 43 | + "dataschemaversion": { |
| 44 | + "type": "string", |
| 45 | + "pattern": "^1\\..*" |
| 46 | + }, |
| 47 | + "plane": { |
| 48 | + "type": "string", |
| 49 | + "const": "control" |
| 50 | + }, |
| 51 | + "data": { |
| 52 | + "$ref": "#/$defs/RoutingConfigCompletedEventData" |
| 53 | + } |
| 54 | + }, |
| 55 | + "required": [ |
| 56 | + "id", |
| 57 | + "time", |
| 58 | + "type", |
| 59 | + "source", |
| 60 | + "specversion", |
| 61 | + "datacontenttype", |
| 62 | + "subject", |
| 63 | + "dataschema", |
| 64 | + "dataschemaversion", |
| 65 | + "plane", |
| 66 | + "data" |
| 67 | + ], |
| 68 | + "$defs": { |
| 69 | + "RoutingConfigCompletedEventData": { |
| 70 | + "allOf": [ |
| 71 | + { |
| 72 | + "type": "object", |
| 73 | + "properties": { |
| 74 | + "clientId": { |
| 75 | + "description": "The client that owns the routing config", |
| 76 | + "type": "string" |
| 77 | + }, |
| 78 | + "campaignId": { |
| 79 | + "description": "The campaign that is associated with the routing config", |
| 80 | + "type": "string" |
| 81 | + }, |
| 82 | + "id": { |
| 83 | + "type": "string", |
| 84 | + "pattern": "^[\\dA-Fa-f]{8}(?:-[\\dA-Fa-f]{4}){3}-[\\dA-Fa-f]{12}$" |
| 85 | + }, |
| 86 | + "name": { |
| 87 | + "description": "User-provided name identifying the routing config", |
| 88 | + "type": "string" |
| 89 | + }, |
| 90 | + "defaultCascadeGroup": { |
| 91 | + "description": "Default cascade group name", |
| 92 | + "type": "string" |
| 93 | + }, |
| 94 | + "createdAt": { |
| 95 | + "description": "Timestamp for when the routing config was created", |
| 96 | + "type": "string", |
| 97 | + "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$" |
| 98 | + }, |
| 99 | + "cascade": { |
| 100 | + "description": "Array defining the order of channels for the routing config and how they are configured", |
| 101 | + "type": "array", |
| 102 | + "items": { |
| 103 | + "$ref": "#/$defs/CascadeItem" |
| 104 | + } |
| 105 | + }, |
| 106 | + "cascadeGroupOverrides": { |
| 107 | + "description": "Config defining non-default cascade groups and the conditons under which they will be used", |
| 108 | + "type": "array", |
| 109 | + "items": { |
| 110 | + "$ref": "#/$defs/CascadeGroupOverride" |
| 111 | + } |
| 112 | + }, |
| 113 | + "status": { |
| 114 | + "description": "Routing config status", |
| 115 | + "type": "string", |
| 116 | + "enum": [ |
| 117 | + "DELETED", |
| 118 | + "DRAFT", |
| 119 | + "COMPLETED" |
| 120 | + ] |
| 121 | + } |
| 122 | + }, |
| 123 | + "required": [ |
| 124 | + "clientId", |
| 125 | + "campaignId", |
| 126 | + "id", |
| 127 | + "name", |
| 128 | + "defaultCascadeGroup", |
| 129 | + "createdAt", |
| 130 | + "cascade", |
| 131 | + "cascadeGroupOverrides", |
| 132 | + "status" |
| 133 | + ] |
| 134 | + }, |
| 135 | + { |
| 136 | + "type": "object", |
| 137 | + "properties": { |
| 138 | + "status": { |
| 139 | + "type": "string", |
| 140 | + "enum": [ |
| 141 | + "COMPLETED" |
| 142 | + ] |
| 143 | + } |
| 144 | + }, |
| 145 | + "required": [ |
| 146 | + "status" |
| 147 | + ] |
| 148 | + } |
| 149 | + ] |
| 150 | + }, |
| 151 | + "CascadeItem": { |
| 152 | + "type": "object", |
| 153 | + "properties": { |
| 154 | + "channel": { |
| 155 | + "description": "Communication type for this cascade item", |
| 156 | + "type": "string", |
| 157 | + "enum": [ |
| 158 | + "NHS_APP", |
| 159 | + "EMAIL", |
| 160 | + "SMS", |
| 161 | + "LETTER" |
| 162 | + ] |
| 163 | + }, |
| 164 | + "channelType": { |
| 165 | + "description": "Channel type for this cascade item", |
| 166 | + "type": "string", |
| 167 | + "enum": [ |
| 168 | + "primary", |
| 169 | + "secondary" |
| 170 | + ] |
| 171 | + }, |
| 172 | + "defaultTemplateId": { |
| 173 | + "description": "Unique identifier for the template to use if no conditions for conditionalTemplates are satisfied", |
| 174 | + "type": "string", |
| 175 | + "pattern": "^[\\dA-Fa-f]{8}(?:-[\\dA-Fa-f]{4}){3}-[\\dA-Fa-f]{12}$" |
| 176 | + }, |
| 177 | + "supplierReferences": { |
| 178 | + "description": "Supplier references that identify the template", |
| 179 | + "type": "object", |
| 180 | + "propertyNames": { |
| 181 | + "type": "string" |
| 182 | + }, |
| 183 | + "additionalProperties": { |
| 184 | + "type": "string" |
| 185 | + } |
| 186 | + }, |
| 187 | + "conditionalTemplates": { |
| 188 | + "type": "array", |
| 189 | + "items": { |
| 190 | + "$ref": "#/$defs/ConditionalTemplate" |
| 191 | + } |
| 192 | + }, |
| 193 | + "cascadeGroups": { |
| 194 | + "description": "List of cascade groups that the cascade item will be included in", |
| 195 | + "type": "array", |
| 196 | + "items": { |
| 197 | + "type": "string" |
| 198 | + } |
| 199 | + } |
| 200 | + }, |
| 201 | + "required": [ |
| 202 | + "channel", |
| 203 | + "channelType", |
| 204 | + "cascadeGroups" |
| 205 | + ] |
| 206 | + }, |
| 207 | + "ConditionalTemplate": { |
| 208 | + "type": "object", |
| 209 | + "properties": { |
| 210 | + "language": { |
| 211 | + "description": "Language override for the template", |
| 212 | + "type": "string", |
| 213 | + "enum": [ |
| 214 | + "ar", |
| 215 | + "bg", |
| 216 | + "bn", |
| 217 | + "de", |
| 218 | + "el", |
| 219 | + "en", |
| 220 | + "es", |
| 221 | + "fa", |
| 222 | + "fr", |
| 223 | + "gu", |
| 224 | + "hi", |
| 225 | + "hu", |
| 226 | + "it", |
| 227 | + "ku", |
| 228 | + "lt", |
| 229 | + "lv", |
| 230 | + "ne", |
| 231 | + "pa", |
| 232 | + "pl", |
| 233 | + "pt", |
| 234 | + "ro", |
| 235 | + "ru", |
| 236 | + "sk", |
| 237 | + "so", |
| 238 | + "sq", |
| 239 | + "ta", |
| 240 | + "tr", |
| 241 | + "ur", |
| 242 | + "zh" |
| 243 | + ] |
| 244 | + }, |
| 245 | + "accessibleFormat": { |
| 246 | + "description": "Communication preference override for the template", |
| 247 | + "type": "string", |
| 248 | + "enum": [ |
| 249 | + "x1" |
| 250 | + ] |
| 251 | + }, |
| 252 | + "supplierReferences": { |
| 253 | + "description": "Supplier references that identify the template", |
| 254 | + "type": "object", |
| 255 | + "propertyNames": { |
| 256 | + "type": "string" |
| 257 | + }, |
| 258 | + "additionalProperties": { |
| 259 | + "type": "string" |
| 260 | + } |
| 261 | + }, |
| 262 | + "templateId": { |
| 263 | + "description": "Unique identifier for the template", |
| 264 | + "type": "string", |
| 265 | + "pattern": "^[\\dA-Fa-f]{8}(?:-[\\dA-Fa-f]{4}){3}-[\\dA-Fa-f]{12}$" |
| 266 | + } |
| 267 | + }, |
| 268 | + "required": [ |
| 269 | + "templateId" |
| 270 | + ] |
| 271 | + }, |
| 272 | + "CascadeGroupOverride": { |
| 273 | + "type": "object", |
| 274 | + "properties": { |
| 275 | + "name": { |
| 276 | + "type": "string" |
| 277 | + }, |
| 278 | + "accessibleFormat": { |
| 279 | + "type": "array", |
| 280 | + "items": { |
| 281 | + "type": "string" |
| 282 | + } |
| 283 | + }, |
| 284 | + "language": { |
| 285 | + "type": "array", |
| 286 | + "items": { |
| 287 | + "type": "string" |
| 288 | + } |
| 289 | + } |
| 290 | + }, |
| 291 | + "required": [ |
| 292 | + "name" |
| 293 | + ] |
| 294 | + } |
| 295 | + }, |
| 296 | + "$id": "https://notify.nhs.uk/events/schemas/RoutingConfigCompleted/v1.json" |
| 297 | +} |
0 commit comments