Skip to content

Commit c1fa2df

Browse files
authored
Merge pull request #525 from NHSDigital/release/2025-03-05
Release/2025 03 05
2 parents 9dccb73 + e190581 commit c1fa2df

File tree

53 files changed

+814
-759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+814
-759
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2025-03-05
4+
- [PI-833] Read product by productID
5+
- [PI-832] product_team_id as a key in product_team
6+
37
## 2025-03-03
48
- [PI-789] Remove EPR Final
59

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.03.03
1+
2025.03.05

changelog/2025-03-05.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [PI-833] Read product by productID
2+
- [PI-832] product_team_id as a key in product_team

infrastructure/swagger/05_paths.yaml

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ paths:
5050
- Options
5151
responses:
5252
"400":
53-
$ref: "#/components/responses/BadRequest"
53+
$ref: "#/components/responses/CreateProductTeamBadRequest"
5454
"200":
5555
description: "200 response"
5656
headers:
@@ -95,7 +95,7 @@ paths:
9595
"201":
9696
$ref: "#/components/responses/CPMProductTeamCreate"
9797
"400":
98-
$ref: "#/components/responses/BadRequest"
98+
$ref: "#/components/responses/CreateProductTeamBadRequest"
9999
"422":
100100
$ref: "#/components/responses/UnprocessableContent"
101101
parameters:
@@ -298,15 +298,14 @@ paths:
298298
- ${authoriser_name}: []
299299
- app-level0: []
300300

301-
/ProductTeam/{product_team_id}/Product/{product_id}:
301+
/Product/{product_id}:
302302
options:
303-
operationId: productactions
304-
summary: Product actions (OPTIONS)
303+
operationId: productreadactions
304+
summary: Product Read actions (OPTIONS)
305305
parameters:
306-
- $ref: "#/components/parameters/ProductTeamId"
307306
- $ref: "#/components/parameters/ProductId"
308307
tags:
309-
- Core Product ID Endpoints
308+
- Options
310309
responses:
311310
"400":
312311
$ref: "#/components/responses/BadRequest"
@@ -331,7 +330,7 @@ paths:
331330
default:
332331
statusCode: "200"
333332
responseParameters:
334-
method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS,POST,DELETE'"
333+
method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'"
335334
method.response.header.Access-Control-Allow-Headers: "'apikey,authorization,content-type,version'"
336335
method.response.header.Access-Control-Allow-Origin: "'*'"
337336
requestTemplates:
@@ -345,11 +344,10 @@ paths:
345344
operationId: readproductendpoint
346345
summary: Read a Product resource (GET)
347346
description: |
348-
- Retrieve a product using a product team ID and product ID.
347+
- Retrieve a product using a product ID.
349348
tags:
350349
- Core Product ID Endpoints
351350
parameters:
352-
- $ref: "#/components/parameters/ProductTeamId"
353351
- $ref: "#/components/parameters/ProductId"
354352
- $ref: "#/components/parameters/HeaderVersion"
355353
- $ref: "#/components/parameters/HeaderRequestId"
@@ -365,6 +363,50 @@ paths:
365363
security:
366364
- ${authoriser_name}: []
367365
- app-level0: []
366+
367+
/ProductTeam/{product_team_id}/Product/{product_id}:
368+
options:
369+
operationId: productactions
370+
summary: Product actions (OPTIONS)
371+
parameters:
372+
- $ref: "#/components/parameters/ProductTeamId"
373+
- $ref: "#/components/parameters/ProductId"
374+
tags:
375+
- Options
376+
responses:
377+
"400":
378+
$ref: "#/components/responses/BadRequest"
379+
"200":
380+
description: "200 response"
381+
headers:
382+
Access-Control-Allow-Origin:
383+
schema:
384+
type: "string"
385+
Access-Control-Allow-Methods:
386+
schema:
387+
type: "string"
388+
Access-Control-Allow-Headers:
389+
schema:
390+
type: "string"
391+
content:
392+
application/json:
393+
schema:
394+
$ref: "#/components/schemas/Empty"
395+
x-amazon-apigateway-integration:
396+
responses:
397+
default:
398+
statusCode: "200"
399+
responseParameters:
400+
method.response.header.Access-Control-Allow-Methods: "'OPTIONS,DELETE'"
401+
method.response.header.Access-Control-Allow-Headers: "'apikey,authorization,content-type,version'"
402+
method.response.header.Access-Control-Allow-Origin: "'*'"
403+
requestTemplates:
404+
application/json: '{"statusCode": 200}'
405+
passthroughBehavior: "never"
406+
type: "mock"
407+
security:
408+
- ${authoriser_name}: []
409+
- app-level0: []
368410
delete:
369411
operationId: deleteproductendpoint
370412
summary: Delete a Product resource (DELETE)

infrastructure/swagger/07_components--schemas--domain.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ components:
6262
updated_on: "null"
6363
deleted_on: "null"
6464
keys:
65-
- key_type: "product_team_id_alias"
66-
key_value: "FOOBAR"
65+
- key_type: "product_team_id"
66+
key_value: "55e86121-3826-468c-a6f0-dd0f1fbc0259"
6767
CPMProductTeamDeleteResponse:
6868
type: object
6969
properties:
@@ -81,7 +81,7 @@ components:
8181
type: string
8282
name:
8383
type: string
84-
product_team_id:
84+
cpm_product_team_id:
8585
type: string
8686
ods_code:
8787
type: string
@@ -107,7 +107,7 @@ components:
107107
example:
108108
id: "P.1X3-XXX"
109109
name: "Sample Product"
110-
product_team_id: "55e86121-3826-468c-a6f0-dd0f1fbc0259"
110+
cpm_product_team_id: "55e86121-3826-468c-a6f0-dd0f1fbc0259"
111111
ods_code: "F5H1R"
112112
keys: []
113113
status: "active"

infrastructure/swagger/11_components--requestBodies.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ components:
2323
properties:
2424
key_type:
2525
type: string
26-
description: The type of the key (e.g., product_team_id_alias)
26+
description: The type of the key (e.g., product_team_id)
2727
key_value:
2828
type: string
2929
description: The value of the key
@@ -35,8 +35,8 @@ components:
3535
name: "Sample Product Team"
3636
ods_code: "F5H1R"
3737
keys:
38-
- key_type: "product_team_id_alias"
39-
key_value: "FOOBAR"
38+
- key_type: "product_team_id"
39+
key_value: "0a78ee8f-5bcf-4db1-9341-ef1d67248715"
4040
ProductCreateRequestBody:
4141
description: Request body to create a Product
4242
required: true

infrastructure/swagger/12_components--responses.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,38 @@ components:
7171
errors:
7272
- code: "VALIDATION_ERROR"
7373
message: "SearchProductQueryParams.__root__: Please provide exactly one valid query parameter: {'product_team_id', 'organisation_code'}."
74+
CreateProductTeamBadRequest:
75+
description: createProductTeam Bad request
76+
content:
77+
application/json:
78+
schema:
79+
$ref: "#/components/schemas/ErrorResponse"
80+
examples:
81+
NotPermittedValidationError:
82+
value:
83+
errors:
84+
- code: "VALIDATION_ERROR"
85+
message: "CreateProductTeamIncomingParams.keys.0.key_type: value is not a valid enumeration member; permitted: 'product_team_id'"
86+
FormatValidationError:
87+
value:
88+
errors:
89+
- code: "VALIDATION_ERROR"
90+
message: "CreateProductTeamIncomingParams.keys.0.key_value: Key '' does not match the expected pattern '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' associated with key type 'product_team_id'"
91+
DuplicateKeyValidationError:
92+
value:
93+
errors:
94+
- code: "VALIDATION_ERROR"
95+
message: "CreateProductTeamIncomingParams.keys: Ensure that product_team_id only exists once within keys."
96+
ItemExistsValidationError:
97+
value:
98+
errors:
99+
- code: "VALIDATION_ERROR"
100+
message: "Item already exists"
101+
MissingValue:
102+
value:
103+
errors:
104+
- code: "MISSING_VALUE"
105+
message: "CreateProductTeamIncomingParams.ods_code: field required"
74106
headers:
75107
Access-Control-Allow-Origin:
76108
schema:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "connecting-party-manager"
3-
version = "2025.03.03"
3+
version = "2025.03.05"
44
description = "Repository for the Connecting Party Manager API and related services"
55
authors = ["NHS England"]
66
license = "LICENSE.md"

src/api/createCpmProduct/tests/data.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
product_team_payload = {
2-
"keys": [{"key_type": "product_team_id_alias", "key_value": "BAR"}],
2+
"keys": [
3+
{
4+
"key_type": "product_team_id",
5+
"key_value": "808a36db-a52a-4130-b71e-d9cbcbaed15b",
6+
}
7+
],
38
"ods_code": "F5H1R",
49
"name": "FOOBAR Product Team",
510
}

src/api/createCpmProduct/tests/test_index.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_index(version):
6161
expected_body = json.dumps(
6262
{
6363
"id": product["id"],
64-
"product_team_id": product["product_team_id"],
64+
"cpm_product_team_id": product["cpm_product_team_id"],
6565
"name": "Foobar product",
6666
"ods_code": "F5H1R",
6767
"status": "active",
@@ -127,15 +127,17 @@ def test_index_no_such_product_team(version):
127127
event={
128128
"headers": {"version": version},
129129
"body": json.dumps(product_payload),
130-
"pathParameters": {"product_team_id": "FOOBAR"},
130+
"pathParameters": {
131+
"product_team_id": "808a36db-a52a-4130-b71e-d9cbcbaed15b"
132+
},
131133
}
132134
)
133135
expected_result = json.dumps(
134136
{
135137
"errors": [
136138
{
137139
"code": "RESOURCE_NOT_FOUND",
138-
"message": "Could not find ProductTeam for key ('FOOBAR')",
140+
"message": "Could not find ProductTeam for key ('808a36db-a52a-4130-b71e-d9cbcbaed15b')",
139141
}
140142
],
141143
}

0 commit comments

Comments
 (0)