Skip to content

Commit 99583ca

Browse files
committed
feat: update priority field range for letter variants to 1-99
1 parent 33d961d commit 99583ca

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/events/src/domain/letter-variant.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ export const $LetterVariant = z
4444
"This is used to restrict a particular variant to a single supplier, " +
4545
"for example individual admail campaigns.",
4646
}),
47-
priority: z.int().min(1).max(100).default(50).meta({
47+
priority: z.int().min(1).max(99).default(50).meta({
4848
title: "Priority",
4949
description:
50-
"Integer priority used to order letters for dispatch to suppliers on a 1 to 100 scale, where lower values indicate higher priority. Defaults to 50 when omitted.",
50+
"Integer priority used to order letters for dispatch to suppliers on a 1 to 99 scale, where lower values indicate higher priority. Defaults to 50 when omitted.",
5151
}),
5252
packSpecificationIds: z.array(idRef($PackSpecification)).nonempty().meta({
5353
title: "Pack Specifications",

packages/events/src/events/__tests__/letter-variant-events.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ describe("LetterVariant Events", () => {
221221
...validProdEvent,
222222
data: {
223223
...validProdEvent.data,
224-
priority: 100,
224+
priority: 99,
225225
},
226226
};
227227

228228
const result = $LetterVariantEvent.safeParse(eventAtLowestPriority);
229229
expect(result.success).toBe(true);
230-
expect(result.data?.data.priority).toBe(100);
230+
expect(result.data?.data.priority).toBe(99);
231231
});
232232

233233
it("should reject priority lower than the allowed range", () => {
@@ -248,7 +248,7 @@ describe("LetterVariant Events", () => {
248248
...validProdEvent,
249249
data: {
250250
...validProdEvent.data,
251-
priority: 101,
251+
priority: 100,
252252
},
253253
};
254254

packages/file-store/src/__tests__/config-store-validator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jest.mock("@nhsdigital/nhs-notify-event-schemas-supplier-config", () => {
1414
}),
1515
$LetterVariant: z.object({
1616
id: z.string(),
17-
priority: z.number().int().min(1).max(100).default(50),
17+
priority: z.number().int().min(1).max(99).default(50),
1818
packSpecificationIds: z.array(z.string()).min(1),
1919
}),
2020
$PackSpecification: z.object({
@@ -171,7 +171,7 @@ describe("validateConfigStore", () => {
171171
records: [
172172
makeRecord("letter-variant", "lv-1", {
173173
id: "lv-1",
174-
priority: 101,
174+
priority: 100,
175175
packSpecificationIds: ["pack-spec-1"],
176176
}),
177177
],

0 commit comments

Comments
 (0)