Skip to content

Commit 5fe3c30

Browse files
committed
QA changes
1 parent 0fea390 commit 5fe3c30

File tree

6 files changed

+29
-7
lines changed

6 files changed

+29
-7
lines changed

infrastructure/swagger/05_paths.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,19 @@ paths:
232232
delete:
233233
operationId: deleteproductendpoint
234234
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)
235239
parameters:
236240
- $ref: "#/components/parameters/ProductTeamId"
237241
- $ref: "#/components/parameters/ProductId"
238242
- $ref: "#/components/parameters/HeaderVersion"
239243
- $ref: "#/components/parameters/HeaderRequestId"
240244
- $ref: "#/components/parameters/HeaderCorrelationId"
241245
responses:
242-
"204":
243-
description: Delete Product operation successful
246+
"200":
247+
$ref: "#/components/responses/ProductDelete"
244248
"404":
245249
$ref: "#/components/responses/NotFound"
246250
x-amazon-apigateway-integration:

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:

src/api/deleteCpmProduct/src/v1/steps.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ def delete_product(data, cache) -> CpmProduct:
1616

1717
def set_http_status(data, cache) -> tuple[int, None]:
1818
product: CpmProduct = data[read_product]
19-
return HTTPStatus.OK, {"code": "200", "message": f"{product.id} has been deleted."}
19+
return HTTPStatus.OK, {
20+
"code": "RESOURCE_DELETED",
21+
"message": f"{product.id} has been deleted.",
22+
}
2023

2124

2225
steps = [

src/api/deleteCpmProduct/tests/test_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_index():
7373
assert response["statusCode"] == 200
7474
assert (
7575
response["body"]
76-
== '{"code": "200", "message": "P.AAA-AAA has been deleted."}'
76+
== '{"code": "RESOURCE_DELETED", "message": "P.AAA-AAA has been deleted."}'
7777
)
7878

7979
# Retrieve the created resource

src/api/tests/feature_tests/features/deleteCpmProduct.success.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Feature: Delete CPM Product - success scenarios
2222
When I make a "DELETE" request with "default" headers to "ProductTeam/<product_team_id>/Product/${ note(product_id) }"
2323
Then I receive a status code "200" with body
2424
| path | value |
25-
| code | 200 |
25+
| code | RESOURCE_DELETED |
2626
| message | ${ note(product_id) } has been deleted. |
2727
And the response headers contain:
2828
| name | value |
2929
| Content-Type | application/json |
30-
| Content-Length | 57 |
30+
| Content-Length | 70 |
3131

3232
Examples:
3333
| product_team_id |

0 commit comments

Comments
 (0)