Skip to content

Commit 776d01b

Browse files
Further fixes to tech docs
1 parent 7cbde67 commit 776d01b

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

docs/assets/diagrams/phase1.png

822 Bytes
Loading

docs/collections/_consumers/acceptance.md

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ You can receive the full list of allocated letters each day, ready for print pro
100100

101101
**Endpoints:**
102102

103-
- GET /letters - Retrieve allocated letters list.
103+
- GET /letters - Retrieve allocated letters list
104104

105105
**Objectives:**
106106

@@ -131,7 +131,7 @@ Your system safely retrieves the daily list of allocated letters more than once
131131

132132
**Endpoints:**
133133

134-
- GET /letters - retrieve allocated list of letters that are ready to be printed.
134+
- GET /letters - retrieve allocated list of letters that are ready to be printed
135135

136136
**Objectives:**
137137

@@ -144,7 +144,7 @@ Demonstrate that your system can:
144144

145145
| Criteria | Description |
146146
|---|---|
147-
| **Steps** | 1. Call GET /letters?limit=2500 to retrieve the full list of allocated letters<br>3. Call GET /letters again immediately to retrieve the same list of letters<br>4. Compare the second list to the first<br>5. Confirm that:<br> a) The same 2,500 unique IDs are returned.<br> b) No new processing jobs are triggered for already seen letters<br> c) Your system ignores duplicates. |
147+
| **Steps** | 1. Call GET /letters?limit=2500 to retrieve the full list of allocated letters<br>2. Call GET /letters again immediately to retrieve the same list of letters<br>3. Compare the second list to the first<br>4. Confirm that:<br> a) The same 2,500 unique IDs are returned.<br> b) No new processing jobs are triggered for already seen letters<br> c) Your system ignores duplicates. |
148148
| **Acceptance** | - Each letter is processed once.<br>- Duplicate retrievals do not cause re-printing, re-queuing, or duplicate API updates. |
149149
| **Evidence** | - Retrieval logs showing both API calls and ID comparisons<br>- Processing logs showing no duplicate triggers<br>- Summary of total unique IDs vs. total retrieved records. |
150150
| **Business value** | Confirms your system can safely retry or re-fetch letter lists without duplicate processing, ensuring data integrity and resilience to transient network or API errors. |
@@ -192,7 +192,7 @@ Letters that were ACCEPTED are successfully printed and reported as PRINTED, pro
192192

193193
**Endpoints:**
194194

195-
- PATCH /letters/{id}/ to update the status of the letter
195+
- PATCH /letters/{id} to update the status of the letter
196196
- POST /letters for bulk status updates
197197
- GET /letters/{id} to verify that the status updated
198198

@@ -201,7 +201,7 @@ Prove your system records the point of physical print completion.
201201

202202
| Criteria | Description |
203203
|---|---|
204-
| **Steps** | 1. Identify letters with status ACCEPTED<br>2. Send a PATCH /letters/{id}/ request to update targeted letters to PRINTED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to PRINTED. |
204+
| **Steps** | 1. Identify letters with status ACCEPTED<br>2. Send a PATCH /letters/{id} request to update targeted letters to PRINTED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to PRINTED. |
205205
| **Acceptance** | - Only letters currently ACCEPTED are targeted<br>- All targeted letters are updated to PRINTED (no skips, no duplicates)<br>- API returns successful responses. |
206206
| **Evidence** | API responses and before/after samples show correct transition. |
207207
| **Business value** | Shows print workflow completion. |
@@ -220,11 +220,11 @@ Letters that have been successfully printed and enclosed in envelopes are report
220220
- Letters retrieved via GET /letters
221221
- **Eligible statuses:**
222222
- ACCEPTED
223-
- PRINTED.
223+
- PRINTED
224224

225225
**Endpoints:**
226226

227-
- PATCH /letters/{id}/ to update the status of the letter
227+
- PATCH /letters/{id} to update the status of the letter
228228
- POST /letters for bulk status updates
229229
- GET /letters/{id} to verify that the status updated
230230

@@ -233,7 +233,7 @@ Demonstrate that your system can record the completion of envelope-insertion and
233233

234234
| Criteria | Description |
235235
|---|---|
236-
| **Steps** | 1. Identify letters with status ACCEPTED or PRINTED<br>2. Send a PATCH /letters/{id}/ request to update targeted letters to ENCLOSED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to ENCLOSED. |
236+
| **Steps** | 1. Identify letters with status ACCEPTED or PRINTED<br>2. Send a PATCH /letters/{id} request to update targeted letters to ENCLOSED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to ENCLOSED. |
237237
| **Acceptance** | - Only letters currently in ACCEPTED or PRINTED are targeted<br>- All targeted letters are updated to ENCLOSED<br>- API returns successful response. |
238238
| **Evidence** | API responses and before/after samples show correct transition. |
239239
| **Business value** | Ensures enclosures are tracked prior to dispatch. |
@@ -255,7 +255,7 @@ Your system records the postal hand-off of each letter.
255255

256256
**Endpoints:**
257257

258-
- PATCH /letters/{id}/ to update the status of the letter
258+
- PATCH /letters/{id} to update the status of the letter
259259
- POST /letters for bulk status updates
260260
- GET /letters/{id} to verify that the status updated
261261

@@ -264,7 +264,7 @@ Validate that your system promptly reports all dispatched letters by updating th
264264

265265
| Criteria | Description |
266266
|---|---|
267-
| **Steps** | 1. Identify letters with status 'ACCEPTED', 'PRINTED', 'ENCLOSED' <br>2. Send a PATCH /letters/{id}/ request to update targeted letters to DISPATCHED or send a POST /letters for a bulk update <br>3. Verify via GET /letters/{id} that status updated to DISPATCHED. |
267+
| **Steps** | 1. Identify letters with status 'ACCEPTED', 'PRINTED', 'ENCLOSED' <br>2. Send a PATCH /letters/{id} request to update targeted letters to DISPATCHED or send a POST /letters for a bulk update <br>3. Verify via GET /letters/{id} that status updated to DISPATCHED. |
268268
| **Acceptance** | - Only letters currently in ACCEPTED, PRINTED, or ENCLOSED state are targeted<br>- All targeted letters are updated to DISPATCHED<br>- API returns a successful response. |
269269
| **Evidence** | API responses and before/after samples show correct transition. |
270270
| **Business value** | Demonstrates postal hand-off tracking. |
@@ -289,7 +289,7 @@ Letters that have completed postal delivery are updated to DELIVERED, confirming
289289

290290
**Endpoints:**
291291

292-
- PATCH /letters/{id}/ to update the status of the letter
292+
- PATCH /letters/{id} to update the status of the letter
293293
- POST /letters for bulk status updates
294294
- GET /letters/{id} to verify that the status updated
295295

@@ -298,7 +298,7 @@ Show that the printed letters have been delivered to patients
298298

299299
| Criteria | Description |
300300
|---|---|
301-
| **Steps** | 1. Identify letters with status ACCEPTED, PRINTED, ENCLOSED, or DISPATCHED<br>2. Send a PATCH /letters/{id}/ request to update targeted letters to DELIVERED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to DELIVERED. |
301+
| **Steps** | 1. Identify letters with status ACCEPTED, PRINTED, ENCLOSED, or DISPATCHED<br>2. Send a PATCH /letters/{id} request to update targeted letters to DELIVERED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to DELIVERED. |
302302
| **Acceptance** | - Only letters currently in ACCEPTED, PRINTED, ENCLOSED, or DISPATCHED state are targeted<br>- All targeted letters are updated to DELIVERED<br>- API returns a successful response. |
303303
| **Evidence** | API responses and before/after samples show correct transition. |
304304
| **Business value** | Ensures that letters are delivered to patients. |
@@ -318,15 +318,15 @@ Letters that cannot be delivered in their standard format are forwarded to a spe
318318

319319
**Endpoints:**
320320

321-
- PATCH /letters/{id}/ to update the status of the letter
321+
- PATCH /letters/{id} to update the status of the letter
322322
- POST /letters for bulk status updates
323323
- GET /letters/{id} to verify that the status updated
324324

325325
**Objectives:**
326326

327327
Prove that your system can correctly:
328328

329-
- Identify letters that require forwarding.
329+
- Identify letters that require forwarding
330330
- Update their status to FORWARDED including specifying the reason why the letter was forwarded
331331
- Stop further local processing or dispatch
332332

@@ -354,7 +354,7 @@ This enables accurate reconciliation, improves address data quality, and support
354354

355355
**Endpoints:**
356356

357-
- PATCH /letters/{id}/ to update the status of the letter
357+
- PATCH /letters/{id} to update the status of the letter
358358
- POST /letters for bulk status updates
359359
- GET /letters/{id} to verify that the status updated
360360

@@ -380,7 +380,7 @@ Demonstrate that returned mail is correctly:
380380

381381
| Criteria | Description |
382382
|---|---|
383-
| **Steps** | 1. Identify letters with status DELIVERED OR DISPATCHED <br>2. Send a PATCH /letters/{id}/ request to update targeted letters to RETURNED or send a POST / letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to RETURNED. |
383+
| **Steps** | 1. Identify letters with status DELIVERED OR DISPATCHED <br>2. Send a PATCH /letters/{id} request to update targeted letters to RETURNED or send a POST / letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to RETURNED. |
384384
| **Acceptance** | - All targeted letters are successfully updated to RETURNED<br>- API returns a successful response. |
385385
| **Evidence** | API logs showing state transitions, timestamps. |
386386
| **Business value** | Supports address-quality feedback. |
@@ -396,7 +396,7 @@ Your system successfully handles cancellation notifications, removes the affecte
396396

397397
- **Input data:**
398398
- A list of letter IDs provided externally by NHS Notify for cancellation
399-
- Requests are not received via API (e.g., via email, or manual instruction).
399+
- Requests are not received via API (e.g., via email, or manual instruction)
400400
- **Eligible statuses:**
401401
- ACCEPTED
402402
- FORWARDED
@@ -405,7 +405,7 @@ Your system successfully handles cancellation notifications, removes the affecte
405405

406406
**Endpoints:**
407407

408-
- PATCH /letters/{id}/ to update the status of the letter
408+
- PATCH /letters/{id} to update the status of the letter
409409
- POST /letters for bulk status updates
410410
- GET /letters/{id} to verify that the status updated
411411

@@ -414,12 +414,12 @@ Your system successfully handles cancellation notifications, removes the affecte
414414
Demonstrate that your system:
415415

416416
- Receives and validates external cancellation requests
417-
- Updates affected letters to CANCELLED status
417+
- Updates affected letters to CANCELLED status, including a code and a reason for cancellation
418418
- Prevents any further production, printing, or dispatch of those letters
419419

420420
| Criteria | Description |
421421
|---|---|
422-
| **Steps** | 1. Get the letter that needs to be cancelled (list provided by NHS Notify)<br>2. Send a PATCH /letters/{id}/ request to update targeted letters to CANCELLED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to CANCELLED. |
422+
| **Steps** | 1. Get the letter that needs to be cancelled (list provided by NHS Notify)<br>2. Send a PATCH /letters/{id} request to update targeted letters to CANCELLED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to CANCELLED. |
423423
| **Acceptance** | - Only letters not yet dispatched or delivered may be cancelled<br>- All targeted letters are successfully updated to CANCELLED<br>- API returns a successful response. |
424424
| **Evidence** | API audit trail and before/after validation samples. |
425425
| **Business value** | Prevents unnecessary printing and protects data integrity. |
@@ -436,17 +436,16 @@ This ensures that Notify is aware of any items that could not be completed and c
436436

437437
- Letters retrieved via GET /letters
438438
- Eligible statuses:
439-
- PENDING
440439
- ACCEPTED
441440
- PRINTED
442441
- ENCLOSED
443442
- FORWARDED
444443
- **Trigger conditions:**
445-
- Structural validation failures (e.g., corrupted PDF, invalid address).
444+
- Structural validation failures (e.g., corrupted PDF, invalid address)
446445

447446
**Endpoints:**
448447

449-
- PATCH /letters/{id}/ to update the status of the letter
448+
- PATCH /letters/{id} to update the status of the letter
450449
- POST /letters for bulk status updates
451450
- GET /letters/{id} to verify that the status updated
452451

@@ -455,18 +454,18 @@ This ensures that Notify is aware of any items that could not be completed and c
455454
Demonstrate that your system:
456455

457456
- Detects and logs production failures
458-
- Updates affected letters to FAILED
457+
- Updates affected letters to FAILED, including a code and a reason for failure
459458
- Records failure codes and reasons consistently
460459
- Communicates these to NHS Notify for transparency and incident reporting
461460

462461
| Criteria | Description |
463462
|---|---|
464-
| **Steps** | 1. Identify the letters that failed production requirements<br>2. Send a PATCH /letters/{id}/ request to update targeted letters to FAILED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to FAILED. |
463+
| **Steps** | 1. Identify the letters that failed production requirements<br>2. Send a PATCH /letters/{id} request to update targeted letters to FAILED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to FAILED. |
465464
| **Acceptance** | - All targeted letters are successfully updated to FAILED<br>- API response confirms successful updates<br>- Failure code and failure reason are updated. |
466465
| **Evidence** | API logs showing state transitions, timestamps. |
467466
| **Business value** | Provides transparent incident reporting by informing of the reason why the letter cannot be processed. |
468467

469-
### AT13 – Reject Invalid Letters
468+
### AT13 – Reject invalid letters
470469

471470
This test verifies that your system can detect and reject malformed letters (i.e: unrecognised specification id, missing PDFs etc) before they reach production by updating their status to REJECTED and providing appropriate reason codes and audit details.
472471

@@ -480,11 +479,11 @@ The rejection is logged with detailed diagnostic information and reported to NHS
480479
- Found in PENDING status before the letters are accepted by you
481480
- **Trigger conditions:**
482481
- Structural validation failures (e.g., invalid PDF, missing metadata)
483-
- Policy violations (e.g., prohibited templates, invalid addresses).
482+
- Policy violations (e.g., prohibited templates, invalid addresses)
484483

485484
**Endpoints:**
486485

487-
- PATCH /letters/{id}/ to update the status of the letter
486+
- PATCH /letters/{id} to update the status of the letter
488487
- POST /letters for bulk status updates
489488
- GET /letters/{id} to verify that the status updated
490489

@@ -493,13 +492,13 @@ The rejection is logged with detailed diagnostic information and reported to NHS
493492
Demonstrate that your system correctly:
494493

495494
- Identifies non-compliant or invalid letters
496-
- Updates their status to REJECTED
495+
- Updates their status to REJECTED, including a code and a reason for rejection
497496
- Records the reason and reason code
498497
- Ensures NHS Notify is informed when a rejection occurs due to quota or compliance limits
499498

500499
| Criteria | Description |
501500
|---|---|
502-
| **Steps** | 1. Identify bad letter requests<br>2. Send a PATCH /letters/{id}/ request to update targeted letters to REJECTED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to REJECTED. |
501+
| **Steps** | 1. Identify bad letter requests<br>2. Send a PATCH /letters/{id} request to update targeted letters to REJECTED or send a POST /letters for a bulk update<br>3. Verify via GET /letters/{id} that status updated to REJECTED. |
503502
| **Acceptance** | - All targeted letters are successfully updated to REJECTED<br>- API response confirms successful updates<br>- Rejected code and rejected reason are updated. |
504503
| **Evidence** | API logs showing state transitions, timestamps. |
505504
| **Business value** | Ensures non-compliant inputs don't enter production.<br>Ensure NHS Notify is informed when supplier quotas are exhausted |
@@ -579,10 +578,10 @@ Possible Scenarios and Applicable Letter Statuses
579578

580579
| Scenario | Description | Typical Status flow |
581580
|---|---|---|
582-
| Standard print and delivery | Letter specification successfully provided, letter printed, dispatch and delivered to patient | a) PENDING → ACCEPTED → PRINTED → ENCLOSED → DISPATCHED → DELIVERED<br>b) PENDING → ACCEPTED → PRINTED → DISPATCHED → DELIVERED<br>c) PENDING → ACCEPTED → ENCLOSED → DISPATCHED → DELIVERED<br>d) PENDING → ACCEPTED → DISPATCHED |
583-
| Letter rejected by letter Supplier | Letter fails validation before acceptance by the letter supplier | PENDING → REJECTED |
584-
| Cancelled by client | Client cancels production before dispatched | a) PENDING → ACCEPTED → CANCELLED<br>b) PENDING → ACCEPTED → PRINTED → CANCELLED<br>c) PENDING → ACCEPTED → PRINTED → ENCLOSED → CANCELLED |
585-
| Production failure | Technical or system error events during the processing cycle | a) PENDING → ACCEPTED → FAILED<br>b) PENDING → ACCEPTED → PRINTED → FAILED<br>c) PENDING → ACCEPTED → PRINTED → ENCLOSED → FAILED |
581+
| Standard print and delivery | Letter specification successfully provided, letter printed, dispatch and delivered to patient. | a) PENDING → ACCEPTED → PRINTED → ENCLOSED → DISPATCHED → DELIVERED<br>b) PENDING → ACCEPTED → PRINTED → DISPATCHED → DELIVERED<br>c) PENDING → ACCEPTED → ENCLOSED → DISPATCHED → DELIVERED<br>d) PENDING → ACCEPTED → DISPATCHED |
582+
| Letter rejected by letter Supplier | Letter fails validation before acceptance by the letter supplier. | PENDING → REJECTED |
583+
| Cancelled by client | Client cancels production before dispatched. | a) PENDING → ACCEPTED → CANCELLED<br>b) PENDING → ACCEPTED → PRINTED → CANCELLED<br>c) PENDING → ACCEPTED → PRINTED → ENCLOSED → CANCELLED |
584+
| Production failure | Technical or system error events during the processing cycle. | a) PENDING → ACCEPTED → FAILED<br>b) PENDING → ACCEPTED → PRINTED → FAILED<br>c) PENDING → ACCEPTED → PRINTED → ENCLOSED → FAILED |
586585
| Forward for accessible format | Letter sent to an alternative supplier (e.g., RNIB) for accessible format such as braille or large print. | PENDING → ACCEPTED → FORWARDED |
587586
| Returned to production facility | Letter dispatched but returned by the postal partner. | a) PENDING → ACCEPTED → PRINTED → ENCLOSED → DISPATCHED → RETURNED (letter undeliverable)<br>b) PENDING → ACCEPTED → PRINTED → ENCLOSED → DISPATCHED → DELIVERED → RETURNED |
588587

0 commit comments

Comments
 (0)