Skip to content

Commit 09e7f68

Browse files
committed
make supplierId required
1 parent c7f8807 commit 09e7f68

File tree

7 files changed

+16
-14
lines changed

7 files changed

+16
-14
lines changed

internal/events/src/domain/letter.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,11 @@ The identifier will be included as the origin domain in the subject of any corre
108108
examples: ["Undeliverable", "Recipient moved"],
109109
}),
110110

111-
supplierId: z
112-
.string()
113-
.optional()
114-
.meta({
115-
title: "Supplier ID",
116-
description:
117-
"Optional identifier for the supplier handling this letter, if applicable.",
118-
examples: ["supplier-12345"],
119-
}),
111+
supplierId: z.string().meta({
112+
title: "Supplier ID",
113+
description: "Identifier for the supplier handling this letter.",
114+
examples: ["supplier-12345"],
115+
}),
120116
})
121117
.meta({
122118
title: "Letter",

internal/events/src/events/__tests__/letter-status-change-events.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ describe("LetterStatus event validations", () => {
4242
specificationId: "1y3q9v1zzzz",
4343
groupId: "client_template",
4444
status,
45+
supplierId: "supplier_12345",
4546
}),
4647
}),
4748
);

internal/events/src/events/__tests__/testData/letter.accepted-with-invalid-major-version.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"subject": "client/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5"
1010
},
1111
"specificationId": "1y3q9v1zzzz",
12-
"status": "ACCEPTED"
12+
"status": "ACCEPTED",
13+
"supplierId": "supplier_12345"
1314
},
1415
"datacontenttype": "application/json",
1516
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.accepted.0.1.0.schema.json",

internal/events/src/events/__tests__/testData/letter.accepted-with-missing-fields.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"source": "/data-plane/letter-rendering/prod/letter-renderer"
99
},
1010
"specificationId": "1y3q9v1zzzz",
11-
"status": "ACCEPTED"
11+
"status": "ACCEPTED",
12+
"supplierId": "supplier_12345"
1213
},
1314
"datacontenttype": "application/json",
1415
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.accepted.1.0.0.schema.json",

internal/events/src/events/__tests__/testData/letter.accepted.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"subject": "client/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5"
1010
},
1111
"specificationId": "1y3q9v1zzzz",
12-
"status": "ACCEPTED"
12+
"status": "ACCEPTED",
13+
"supplierId": "supplier_12345"
1314
},
1415
"datacontenttype": "application/json",
1516
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.accepted.1.0.0.schema.json",

internal/events/src/events/__tests__/testData/letter.forwarded.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"reasonCode": "RNIB",
1212
"reasonText": "RNIB",
1313
"specificationId": "1y3q9v1zzzz",
14-
"status": "FORWARDED"
14+
"status": "FORWARDED",
15+
"supplierId": "supplier_12345"
1516
},
1617
"datacontenttype": "application/json",
1718
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.forwarded.1.0.0.schema.json",

internal/events/src/events/__tests__/testData/letter.returned.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"reasonCode": "R07",
1212
"reasonText": "No such address",
1313
"specificationId": "1y3q9v1zzzz",
14-
"status": "RETURNED"
14+
"status": "RETURNED",
15+
"supplierId": "supplier_12345"
1516
},
1617
"datacontenttype": "application/json",
1718
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.returned.1.0.0.schema.json",

0 commit comments

Comments
 (0)