File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
lambdas/mi-updates-transformer/src/mappers Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,15 @@ import { randomUUID, randomBytes } from 'crypto';
55export function mapMIToCloudEvent ( mi : MI ) : MISubmittedEvent {
66 const now = new Date ( ) . toISOString ( ) ;
77 const eventId = randomUUID ( ) ;
8+ const dataschemaversion = '1.0.0' ;
9+
810 return {
911 specversion : '1.0' ,
1012 id : eventId ,
1113 type : `uk.nhs.notify.supplier-api.mi.SUBMITTED.v1` ,
12- dataschema : `https://notify.nhs.uk/cloudevents/schemas/supplier-api/mi.SUBMITTED.1.0.0.schema.json` ,
14+ plane : 'data-plane' ,
15+ dataschema : `https://notify.nhs.uk/cloudevents/schemas/supplier-api/mi.SUBMITTED.${ dataschemaversion } .schema.json` ,
16+ dataschemaversion,
1317 source : '/data-plane/supplier-api/mi' ,
1418 subject : 'mi/' + mi . id ,
1519
@@ -26,6 +30,7 @@ export function mapMIToCloudEvent(mi: MI): MISubmittedEvent {
2630 stockRemaining : mi . stockRemaining
2731 } ,
2832 time : now ,
33+ datacontenttype : 'application/json' ,
2934 traceparent : `00-${ randomBytes ( 16 ) . toString ( 'hex' ) } -${ randomBytes ( 8 ) . toString ( 'hex' ) } -01` ,
3035 recordedtime : now ,
3136 severitynumber : 2 ,
You can’t perform that action at this time.
0 commit comments