Skip to content

Commit 6b2aa91

Browse files
committed
CCM-11602: GET Endpoint sandbox updates
1 parent 1e7c493 commit 6b2aa91

File tree

10 files changed

+364
-235
lines changed

10 files changed

+364
-235
lines changed

internal/datastore/src/letter-repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class LetterRepository {
160160
result,
161161
})
162162
return {
163-
nextCursor: result.LastEvaluatedKey.id,
163+
nextCursor: result.LastEvaluatedKey?.id,
164164
letters: z.array(LetterSchema).parse(result.Items)
165165
};
166166
}

sandbox/api/openapi.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,24 @@ paths:
6868
type: string
6969
style: form
7070
- description: |-
71-
The ordinal number of the page of results to be retrieved. If omitted, the
72-
first page of results will be returned. Use the links section in the response
71+
Cursor pointing at the last Letter ID from the previous page. Use the links section in the response
7372
body to determine whether any further pages of results exist.
7473
explode: true
7574
in: query
76-
name: page
75+
name: cursor
7776
required: false
7877
schema:
79-
example: 1
78+
example: 1756720614483_00003
79+
type: string
80+
style: form
81+
- description: |-
82+
Size of the page to fetched.
83+
explode: true
84+
in: query
85+
name: size
86+
required: false
87+
schema:
88+
example: 10
8089
type: number
8190
style: form
8291
responses:

sandbox/data/examples/getLetters/responses/getLetters_pending-10.json

Lines changed: 0 additions & 72 deletions
This file was deleted.

sandbox/data/examples/getLetters/responses/getLetters_pending-5.json

Lines changed: 0 additions & 73 deletions
This file was deleted.
Lines changed: 100 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,105 @@
11
{
2-
"data": [
3-
{
4-
"attributes": {
5-
"requestedProductionStatus": "ACTIVE",
6-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
7-
"status": "PENDING"
8-
},
9-
"id": "31B68ctLKWlhxsoil13zANnOXDs",
10-
"type": "Letter"
2+
"data": {
3+
"attributes": {
4+
"letters": [
5+
{
6+
"createdAt": "2025-09-01T09:56:54.483053",
7+
"groupId": "45dcd4b9-f649-4315-ac49-2d9350d9305a",
8+
"id": "1756720614483_00003",
9+
"specificationId": "bb389023-8865-4a1e-b4da-049ae6bdca59",
10+
"status": "PENDING",
11+
"updatedAt": "2025-09-01T09:56:54.483070",
12+
"url": "https://someurl.com"
13+
},
14+
{
15+
"createdAt": "2025-09-01T09:56:54.502664",
16+
"groupId": "9189c721-0f71-4cc2-bd07-d81592c3ce00",
17+
"id": "1756720614502_00004",
18+
"specificationId": "bfdb03e8-52a8-497d-b737-02f13ec0a245",
19+
"status": "PENDING",
20+
"updatedAt": "2025-09-01T09:56:54.502679",
21+
"url": "https://someurl.com"
22+
},
23+
{
24+
"createdAt": "2025-09-01T09:56:54.581557",
25+
"groupId": "2583ef04-8613-4b4a-993a-35b9cbdfc6a8",
26+
"id": "1756720614581_00008",
27+
"specificationId": "7a7795ed-6594-4e3a-82d4-7c468534c71c",
28+
"status": "PENDING",
29+
"updatedAt": "2025-09-01T09:56:54.581573",
30+
"url": "https://someurl.com"
31+
},
32+
{
33+
"createdAt": "2025-09-01T09:56:54.600503",
34+
"groupId": "d96966ec-04b3-4050-9430-b6b508770569",
35+
"id": "1756720614600_00009",
36+
"specificationId": "c8ed344c-24df-4a9c-a8f2-6878710f5690",
37+
"status": "PENDING",
38+
"updatedAt": "2025-09-01T09:56:54.600518",
39+
"url": "https://someurl.com"
40+
},
41+
{
42+
"createdAt": "2025-09-01T09:56:54.619032",
43+
"groupId": "a3c4fcbc-a372-4969-929b-e1f114ebaaff",
44+
"id": "1756720614619_00010",
45+
"specificationId": "c8e7adcb-a8b9-416f-9f81-dc7943fdb52a",
46+
"status": "PENDING",
47+
"updatedAt": "2025-09-01T09:56:54.619045",
48+
"url": "https://someurl.com"
49+
},
50+
{
51+
"createdAt": "2025-09-01T09:56:54.659383",
52+
"groupId": "3c51f68c-8907-4f3f-9391-2fb6ee44fd97",
53+
"id": "1756720614659_00012",
54+
"specificationId": "08e7781b-f483-4a0d-b595-50eefec2c262",
55+
"status": "PENDING",
56+
"updatedAt": "2025-09-01T09:56:54.659408",
57+
"url": "https://someurl.com"
58+
},
59+
{
60+
"createdAt": "2025-09-01T09:56:54.698009",
61+
"groupId": "0bf3515d-4ed1-41d0-8227-ac189e7539f5",
62+
"id": "1756720614698_00014",
63+
"specificationId": "3041fbeb-bf2d-44c2-a531-3695e44fd431",
64+
"status": "PENDING",
65+
"updatedAt": "2025-09-01T09:56:54.698025",
66+
"url": "https://someurl.com"
67+
},
68+
{
69+
"createdAt": "2025-09-01T09:56:54.717251",
70+
"groupId": "aff49848-c4ce-43ce-abab-782f1d9f2803",
71+
"id": "1756720614717_00015",
72+
"specificationId": "36361100-ce83-4008-b566-c16f0b2138e4",
73+
"status": "PENDING",
74+
"updatedAt": "2025-09-01T09:56:54.717267",
75+
"url": "https://someurl.com"
76+
},
77+
{
78+
"createdAt": "2025-09-01T09:56:54.830848",
79+
"groupId": "08529964-e25a-42ea-a3ea-8bf85ab51b8b",
80+
"id": "1756720614830_00021",
81+
"specificationId": "3e34ce6e-a309-48d4-b5d8-23a0b9469e72",
82+
"status": "PENDING",
83+
"updatedAt": "2025-09-01T09:56:54.830866",
84+
"url": "https://someurl.com"
85+
},
86+
{
87+
"createdAt": "2025-09-01T09:56:54.851174",
88+
"groupId": "0bae37d7-6e47-4bf1-b17d-2e31aea55ea1",
89+
"id": "1756720614851_00022",
90+
"specificationId": "851862de-162a-481d-b224-0510e1bb9d71",
91+
"status": "PENDING",
92+
"updatedAt": "2025-09-01T09:56:54.851196",
93+
"url": "https://someurl.com"
94+
}
95+
]
1196
},
12-
{
13-
"attributes": {
14-
"requestedProductionStatus": "ACTIVE",
15-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
16-
"status": "PENDING"
17-
},
18-
"id": "31B68hADL5mBayE3gDOnQeQ7RGr",
19-
"type": "Letter"
20-
},
21-
{
22-
"attributes": {
23-
"requestedProductionStatus": "ACTIVE",
24-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
25-
"status": "PENDING"
26-
},
27-
"id": "31B68hesrGUpMmPzvBErnZ3Nx1s",
28-
"type": "Letter"
29-
},
30-
{
31-
"attributes": {
32-
"requestedProductionStatus": "ACTIVE",
33-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
34-
"status": "PENDING"
35-
},
36-
"id": "31B68gtwhetFGlca6JdckCLduQJ",
37-
"type": "Letter"
38-
},
39-
{
40-
"attributes": {
41-
"requestedProductionStatus": "ACTIVE",
42-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
43-
"status": "PENDING"
44-
},
45-
"id": "31B68fX5yazsb8XtbIKvnH7lyFV",
46-
"type": "Letter"
47-
},
48-
{
49-
"attributes": {
50-
"requestedProductionStatus": "ACTIVE",
51-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
52-
"status": "PENDING"
53-
},
54-
"id": "31B68cdGh1HVxxqsSTVezoulItF",
55-
"type": "Letter"
56-
},
57-
{
58-
"attributes": {
59-
"requestedProductionStatus": "ACTIVE",
60-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
61-
"status": "PENDING"
62-
},
63-
"id": "31B68ctCLllXxrmkrrcent290Jv",
64-
"type": "Letter"
65-
}
66-
],
97+
"supplierId": "70735ec9-3ba5-4fb0-bb01-b56d2df24ebb",
98+
"type": "Letters"
99+
},
67100
"links": {
68-
"last": "https://api.service.nhs.uk/nhs-notify-supplier/letters?status=PENDING&page=10",
69-
"next": "https://api.service.nhs.uk/nhs-notify-supplier/letters?status=PENDING&page=2",
70-
"self": "https://api.service.nhs.uk/nhs-notify-supplier/letters?status=PENDING&page=1"
101+
"first": "/letters?status=PENDING&size=10",
102+
"next": "/letters?status=PENDING&size=10&cursor=1756720614851_00022",
103+
"self": "/letters?status=PENDING&size=10"
71104
}
72105
}

0 commit comments

Comments
 (0)