Skip to content

Commit 02700b9

Browse files
authored
Merge pull request #491 from NHSDigital/release/2025-02-07
Release/2025 02 07
2 parents 96dea08 + 5fe3c30 commit 02700b9

File tree

39 files changed

+971
-132
lines changed

39 files changed

+971
-132
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-02-07
4+
- [PI-746] Deactivate a Product
5+
- [PI-765] Feature test for create ProductTeam endpoint request containing an empty key_value
6+
37
## 2025-02-05
48
- [PI-691] Changelog ETL - modify / replace in an AS
59
- [PI-726] Update AS tags - Adding an AS

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.02.05
1+
2025.02.07

changelog/2025-02-07.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [PI-746] Deactivate a Product
2+
- [PI-765] Feature test for create ProductTeam endpoint request containing an empty key_value

infrastructure/swagger/05_paths.yaml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -229,26 +229,30 @@ paths:
229229
security:
230230
- ${authoriser_name}: []
231231
- app-level0: []
232-
# delete:
233-
# operationId: deleteproductendpoint
234-
# summary: Delete a Product resource (DELETE)
235-
# parameters:
236-
# - $ref: "#/components/parameters/ProductTeamId"
237-
# - $ref: "#/components/parameters/ProductId"
238-
# - $ref: "#/components/parameters/HeaderVersion"
239-
# - $ref: "#/components/parameters/HeaderRequestId"
240-
# - $ref: "#/components/parameters/HeaderCorrelationId"
241-
# responses:
242-
# "204":
243-
# description: Delete Product operation successful
244-
# "404":
245-
# $ref: "#/components/responses/NotFound"
246-
# x-amazon-apigateway-integration:
247-
# <<: *ApiGatewayIntegration
248-
# uri: ${method_deleteCpmProduct}
249-
# security:
250-
# - ${authoriser_name}: []
251-
# - app-level0: []
232+
delete:
233+
operationId: deleteproductendpoint
234+
summary: Delete a Product resource (DELETE)
235+
description: |
236+
- Delete a product using a product team ID and product ID.
237+
tags:
238+
- Core Product ID Endpointsurce (DELETE)
239+
parameters:
240+
- $ref: "#/components/parameters/ProductTeamId"
241+
- $ref: "#/components/parameters/ProductId"
242+
- $ref: "#/components/parameters/HeaderVersion"
243+
- $ref: "#/components/parameters/HeaderRequestId"
244+
- $ref: "#/components/parameters/HeaderCorrelationId"
245+
responses:
246+
"200":
247+
$ref: "#/components/responses/ProductDelete"
248+
"404":
249+
$ref: "#/components/responses/NotFound"
250+
x-amazon-apigateway-integration:
251+
<<: *ApiGatewayIntegration
252+
uri: ${method_deleteCpmProduct}
253+
security:
254+
- ${authoriser_name}: []
255+
- app-level0: []
252256

253257
/ProductTeamEpr/{product_team_id}/ProductEpr:
254258
post:

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,16 @@ components:
183183
created_on: "2024-10-15T10:00:00Z"
184184
updated_on: "null"
185185
deleted_on: "null"
186-
186+
CPMProductDeleteResponse:
187+
type: object
188+
properties:
189+
code:
190+
type: string
191+
message:
192+
type: string
193+
example:
194+
code: "RESOURCE_DELETED"
195+
message: "P.XYZ-123 has been deleted."
187196
Questionnaire:
188197
type: object
189198
properties:

infrastructure/swagger/12_components--responses.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ components:
145145
application/json:
146146
schema:
147147
$ref: "#/components/schemas/CPMProductResponse"
148+
ProductDelete:
149+
description: Delete Product operation successful
150+
content:
151+
application/json:
152+
schema:
153+
$ref: "#/components/schemas/CPMProductDeleteResponse"
148154
EprProductCreate:
149155
description: Create Epr Product operation successful
150156
content:

infrastructure/terraform/per_workspace/main.tf

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,23 @@ module "cpmtable" {
6969
attributes = [
7070
{ name = "pk", type = "S" },
7171
{ name = "sk", type = "S" },
72-
{ name = "pk_read", type = "S" },
73-
{ name = "sk_read", type = "S" },
72+
{ name = "pk_read_1", type = "S" },
73+
{ name = "sk_read_1", type = "S" },
74+
{ name = "pk_read_2", type = "S" },
75+
{ name = "sk_read_2", type = "S" },
7476
]
7577

7678
global_secondary_indexes = [
7779
{
78-
name = "idx_gsi_read"
79-
hash_key = "pk_read"
80-
range_key = "sk_read"
80+
name = "idx_gsi_read_1"
81+
hash_key = "pk_read_1"
82+
range_key = "sk_read_1"
83+
projection_type = "ALL"
84+
},
85+
{
86+
name = "idx_gsi_read_2"
87+
hash_key = "pk_read_2"
88+
range_key = "sk_read_2"
8189
projection_type = "ALL"
8290
}
8391
]

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.02.05"
3+
version = "2025.02.07"
44
description = "Repository for the Connecting Party Manager API and related services"
55
authors = ["NHS England"]
66
license = "LICENSE.md"

src/api/createCpmProduct/tests/test_index.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from domain.repository.product_team_repository import ProductTeamRepository
88
from event.json import json_loads
99

10-
from test_helpers.dynamodb import mock_table
10+
from test_helpers.dynamodb import mock_table_cpm
1111
from test_helpers.response_assertions import _response_assertions
1212

1313
from .data import product_payload, product_team_payload
@@ -22,7 +22,7 @@ def _mock_test(version, params):
2222
name=product_team_payload["name"], keys=product_team_payload["keys"]
2323
)
2424

25-
with mock_table(table_name=TABLE_NAME) as client, mock.patch.dict(
25+
with mock_table_cpm(table_name=TABLE_NAME) as client, mock.patch.dict(
2626
os.environ,
2727
{
2828
"DYNAMODB_TABLE": TABLE_NAME,
@@ -113,7 +113,7 @@ def test_incoming_errors(params, error, status_code, version):
113113
],
114114
)
115115
def test_index_no_such_product_team(version):
116-
with mock_table(TABLE_NAME), mock.patch.dict(
116+
with mock_table_cpm(TABLE_NAME), mock.patch.dict(
117117
os.environ,
118118
{
119119
"DYNAMODB_TABLE": TABLE_NAME,

src/api/createProductTeam/tests/v1/test_index_v1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66
from event.json import json_loads
77

8-
from test_helpers.dynamodb import mock_table
8+
from test_helpers.dynamodb import mock_table_cpm
99
from test_helpers.response_assertions import _response_assertions
1010
from test_helpers.sample_data import (
1111
CPM_PRODUCT_TEAM_NO_ID,
@@ -22,7 +22,7 @@
2222
],
2323
)
2424
def test_index(version):
25-
with mock_table(table_name=TABLE_NAME), mock.patch.dict(
25+
with mock_table_cpm(table_name=TABLE_NAME), mock.patch.dict(
2626
os.environ,
2727
{
2828
"DYNAMODB_TABLE": TABLE_NAME,
@@ -72,7 +72,7 @@ def test_index(version):
7272
],
7373
)
7474
def test_index_bad_payload(version):
75-
with mock_table(table_name=TABLE_NAME), mock.patch.dict(
75+
with mock_table_cpm(table_name=TABLE_NAME), mock.patch.dict(
7676
os.environ,
7777
{
7878
"DYNAMODB_TABLE": TABLE_NAME,
@@ -120,7 +120,7 @@ def test_index_bad_payload(version):
120120
],
121121
)
122122
def test_index(version):
123-
with mock_table(table_name=TABLE_NAME), mock.patch.dict(
123+
with mock_table_cpm(table_name=TABLE_NAME), mock.patch.dict(
124124
os.environ,
125125
{
126126
"DYNAMODB_TABLE": TABLE_NAME,

0 commit comments

Comments
 (0)