Skip to content

Commit f33ff00

Browse files
committed
Merge branch 'feature/PI-838-add_product_team_id_to_cpmproduct' into release/2025-03-07
2 parents bcef2ff + c7186de commit f33ff00

File tree

8 files changed

+165
-107
lines changed

8 files changed

+165
-107
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ components:
8383
type: string
8484
cpm_product_team_id:
8585
type: string
86+
product_team_id:
87+
type: string
8688
ods_code:
8789
type: string
8890
status:
@@ -107,7 +109,8 @@ components:
107109
example:
108110
id: "P.1X3-XXX"
109111
name: "Sample Product"
110-
cpm_product_team_id: "55e86121-3826-468c-a6f0-dd0f1fbc0259"
112+
product_team_id: "55e86121-3826-468c-a6f0-dd0f1fbc0259"
113+
cpm_product_team_id: "a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0"
111114
ods_code: "F5H1R"
112115
keys: []
113116
status: "active"

src/api/createCpmProduct/tests/test_index.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_index(version):
6262
{
6363
"id": product["id"],
6464
"cpm_product_team_id": product["cpm_product_team_id"],
65+
"product_team_id": product_team_payload["keys"][0]["key_value"],
6566
"name": "Foobar product",
6667
"ods_code": "F5H1R",
6768
"status": "active",

src/api/deleteCpmProduct/tests/test_index.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def test_index():
102102
"name": PRODUCT_NAME,
103103
"ods_code": ODS_CODE,
104104
"cpm_product_team_id": product_team.id,
105+
"product_team_id": CPM_PRODUCT_TEAM_NO_ID["keys"][0]["key_value"],
105106
"status": Status.INACTIVE,
106107
"keys": [],
107108
}

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

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,38 @@ Feature: Create CPM Product - success scenarios
2020
| name | My Great Product |
2121
And I note the response field "$.id" as "product_id"
2222
Then I receive a status code "201" with body
23-
| path | value |
24-
| id | ${ note(product_id) } |
25-
| name | My Great Product |
26-
| cpm_product_team_id | ${ note(product_team_id) } |
27-
| ods_code | F5H1R |
28-
| status | active |
29-
| keys | [] |
30-
| created_on | << ignore >> |
31-
| updated_on | << ignore >> |
32-
| deleted_on | << ignore >> |
23+
| path | value |
24+
| id | ${ note(product_id) } |
25+
| name | My Great Product |
26+
| product_team_id | 0a78ee8f-5bcf-4db1-9341-ef1d67248715 |
27+
| cpm_product_team_id | ${ note(product_team_id) } |
28+
| ods_code | F5H1R |
29+
| status | active |
30+
| keys | [] |
31+
| created_on | << ignore >> |
32+
| updated_on | << ignore >> |
33+
| deleted_on | << ignore >> |
3334
And the response headers contain:
3435
| name | value |
3536
| Content-Type | application/json |
36-
| Content-Length | 253 |
37+
| Content-Length | 312 |
3738
When I make a "GET" request with "default" headers to "Product/${ note(product_id) }"
3839
Then I receive a status code "200" with body
39-
| path | value |
40-
| id | ${ note(product_id) } |
41-
| name | My Great Product |
42-
| cpm_product_team_id | ${ note(product_team_id) } |
43-
| ods_code | F5H1R |
44-
| status | active |
45-
| keys | [] |
46-
| created_on | << ignore >> |
47-
| updated_on | << ignore >> |
48-
| deleted_on | << ignore >> |
40+
| path | value |
41+
| id | ${ note(product_id) } |
42+
| name | My Great Product |
43+
| product_team_id | 0a78ee8f-5bcf-4db1-9341-ef1d67248715 |
44+
| cpm_product_team_id | ${ note(product_team_id) } |
45+
| ods_code | F5H1R |
46+
| status | active |
47+
| keys | [] |
48+
| created_on | << ignore >> |
49+
| updated_on | << ignore >> |
50+
| deleted_on | << ignore >> |
4951
And the response headers contain:
5052
| name | value |
5153
| Content-Type | application/json |
52-
| Content-Length | 253 |
54+
| Content-Length | 312 |
5355

5456
Examples:
5557
| product_team_id |

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

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,44 @@ Feature: Read CPM Product - success scenarios
2020
| name | My Great Product |
2121
And I note the response field "$.id" as "product_id"
2222
When I make a "GET" request with "default" headers to "Product/<product_id>"
23+
Then I receive a status code "200" with body
24+
| path | value |
25+
| id | <product_id> |
26+
| cpm_product_team_id | ${ note(product_team_id) } |
27+
| product_team_id | 8babe222-5c78-42c6-8aa6-a3c69943030a |
28+
| name | My Great Product |
29+
| ods_code | F5H1R |
30+
| status | active |
31+
| keys | [] |
32+
| created_on | << ignore >> |
33+
| updated_on | << ignore >> |
34+
| deleted_on | << ignore >> |
35+
And the response headers contain:
36+
| name | value |
37+
| Content-Type | application/json |
38+
| Content-Length | 312 |
39+
40+
Examples:
41+
| product_team_id | product_id |
42+
| ${ note(product_team_id) } | ${ note(product_id) } |
43+
| 8babe222-5c78-42c6-8aa6-a3c69943030a | ${ note(product_id) } |
44+
45+
Scenario Outline: Read an existing CpmProduct without a product_team_id
46+
Given I have already made a "POST" request with "default" headers to "ProductTeam" with body:
47+
| path | value |
48+
| name | My Great Product Team |
49+
| ods_code | F5H1R |
50+
Given I note the response field "$.id" as "product_team_id"
51+
When I make a "POST" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product" with body:
52+
| path | value |
53+
| name | My Great Product |
54+
And I note the response field "$.id" as "product_id"
55+
When I make a "GET" request with "default" headers to "Product/<product_id>"
2356
Then I receive a status code "200" with body
2457
| path | value |
2558
| id | <product_id> |
2659
| cpm_product_team_id | ${ note(product_team_id) } |
60+
| product_team_id | null |
2761
| name | My Great Product |
2862
| ods_code | F5H1R |
2963
| status | active |
@@ -34,9 +68,8 @@ Feature: Read CPM Product - success scenarios
3468
And the response headers contain:
3569
| name | value |
3670
| Content-Type | application/json |
37-
| Content-Length | 253 |
71+
| Content-Length | 278 |
3872

3973
Examples:
40-
| product_team_id | product_id |
41-
| ${ note(product_team_id) } | ${ note(product_id) } |
42-
| 8babe222-5c78-42c6-8aa6-a3c69943030a | ${ note(product_id) } |
74+
| product_team_id | product_id |
75+
| ${ note(product_team_id) } | ${ note(product_id) } |

0 commit comments

Comments
 (0)