Skip to content

Commit 3646a59

Browse files
committed
feature/PI-643-add_status_to_drd Add status field to drd
1 parent 1b6460e commit 3646a59

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Feature: Create Device Reference Data - success scenarios
2626
| path | value |
2727
| id | << ignore >> |
2828
| name | My Device Reference Data |
29+
| status | active |
2930
| product_id | ${ note(product_id) } |
3031
| product_team_id | ${ note(product_team_id) } |
3132
| ods_code | F5H1R |
@@ -36,13 +37,14 @@ Feature: Create Device Reference Data - success scenarios
3637
And the response headers contain:
3738
| name | value |
3839
| Content-Type | application/json |
39-
| Content-Length | 316 |
40+
| Content-Length | 336 |
4041
And I note the response field "$.id" as "device_reference_data_id"
4142
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
4243
Then I receive a status code "200" with body
4344
| path | value |
4445
| id | ${ note(device_reference_data_id) } |
4546
| name | My Device Reference Data |
47+
| status | active |
4648
| product_id | ${ note(product_id) } |
4749
| product_team_id | ${ note(product_team_id) } |
4850
| ods_code | F5H1R |
@@ -53,7 +55,7 @@ Feature: Create Device Reference Data - success scenarios
5355
And the response headers contain:
5456
| name | value |
5557
| Content-Type | application/json |
56-
| Content-Length | 316 |
58+
| Content-Length | 336 |
5759

5860
Examples:
5961
| product_team_id |
@@ -80,6 +82,7 @@ Feature: Create Device Reference Data - success scenarios
8082
| path | value |
8183
| id | << ignore >> |
8284
| name | My Device Reference Data |
85+
| status | active |
8386
| product_id | ${ note(product_id) } |
8487
| product_team_id | ${ note(product_team_id) } |
8588
| ods_code | F5H1R |
@@ -90,13 +93,14 @@ Feature: Create Device Reference Data - success scenarios
9093
And the response headers contain:
9194
| name | value |
9295
| Content-Type | application/json |
93-
| Content-Length | 316 |
96+
| Content-Length | 336 |
9497
And I note the response field "$.id" as "device_reference_data_id"
9598
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
9699
Then I receive a status code "200" with body
97100
| path | value |
98101
| id | ${ note(device_reference_data_id) } |
99102
| name | My Device Reference Data |
103+
| status | active |
100104
| product_id | ${ note(product_id) } |
101105
| product_team_id | ${ note(product_team_id) } |
102106
| ods_code | F5H1R |
@@ -107,7 +111,7 @@ Feature: Create Device Reference Data - success scenarios
107111
And the response headers contain:
108112
| name | value |
109113
| Content-Type | application/json |
110-
| Content-Length | 316 |
114+
| Content-Length | 336 |
111115

112116
Examples:
113117
| product_team_id | product_id |

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Feature: Create "Additional Interactions" Device Reference Data - success scenar
2525
| path | value |
2626
| id | << ignore >> |
2727
| name | F5H1R-850000 - AS Additional Interactions |
28+
| status | active |
2829
| product_id | ${ note(product_id) } |
2930
| product_team_id | ${ note(product_team_id) } |
3031
| ods_code | F5H1R |
@@ -35,13 +36,14 @@ Feature: Create "Additional Interactions" Device Reference Data - success scenar
3536
And the response headers contain:
3637
| name | value |
3738
| Content-Type | application/json |
38-
| Content-Length | 333 |
39+
| Content-Length | 353 |
3940
And I note the response field "$.id" as "device_reference_data_id"
4041
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
4142
Then I receive a status code "200" with body
4243
| path | value |
4344
| id | ${ note(device_reference_data_id) } |
4445
| name | F5H1R-850000 - AS Additional Interactions |
46+
| status | active |
4547
| product_id | ${ note(product_id) } |
4648
| product_team_id | ${ note(product_team_id) } |
4749
| ods_code | F5H1R |
@@ -52,7 +54,7 @@ Feature: Create "Additional Interactions" Device Reference Data - success scenar
5254
And the response headers contain:
5355
| name | value |
5456
| Content-Type | application/json |
55-
| Content-Length | 333 |
57+
| Content-Length | 353 |
5658

5759
Examples:
5860
| product_team_id | product_id |
@@ -82,6 +84,7 @@ Feature: Create "Additional Interactions" Device Reference Data - success scenar
8284
| path | value |
8385
| id | << ignore >> |
8486
| name | F5H1R-850000 - AS Additional Interactions |
87+
| status | active |
8588
| product_id | ${ note(product_id) } |
8689
| product_team_id | ${ note(product_team_id) } |
8790
| ods_code | F5H1R |
@@ -101,13 +104,14 @@ Feature: Create "Additional Interactions" Device Reference Data - success scenar
101104
And the response headers contain:
102105
| name | value |
103106
| Content-Type | application/json |
104-
| Content-Length | 938 |
107+
| Content-Length | 958 |
105108
And I note the response field "$.id" as "device_reference_data_id"
106109
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
107110
Then I receive a status code "200" with body
108111
| path | value |
109112
| id | ${ note(device_reference_data_id) } |
110113
| name | F5H1R-850000 - AS Additional Interactions |
114+
| status | active |
111115
| product_id | ${ note(product_id) } |
112116
| product_team_id | ${ note(product_team_id) } |
113117
| ods_code | F5H1R |
@@ -127,7 +131,7 @@ Feature: Create "Additional Interactions" Device Reference Data - success scenar
127131
And the response headers contain:
128132
| name | value |
129133
| Content-Type | application/json |
130-
| Content-Length | 938 |
134+
| Content-Length | 958 |
131135

132136
Examples:
133137
| product_team_id | product_id |

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Feature: Create "Message Set" Device Reference Data - success scenarios
2525
| path | value |
2626
| id | << ignore >> |
2727
| name | F5H1R-850000 - MHS Message Set |
28+
| status | active |
2829
| product_id | ${ note(product_id) } |
2930
| product_team_id | ${ note(product_team_id) } |
3031
| ods_code | F5H1R |
@@ -35,13 +36,14 @@ Feature: Create "Message Set" Device Reference Data - success scenarios
3536
And the response headers contain:
3637
| name | value |
3738
| Content-Type | application/json |
38-
| Content-Length | 322 |
39+
| Content-Length | 342 |
3940
And I note the response field "$.id" as "device_reference_data_id"
4041
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
4142
Then I receive a status code "200" with body
4243
| path | value |
4344
| id | ${ note(device_reference_data_id) } |
4445
| name | F5H1R-850000 - MHS Message Set |
46+
| status | active |
4547
| product_id | ${ note(product_id) } |
4648
| product_team_id | ${ note(product_team_id) } |
4749
| ods_code | F5H1R |
@@ -52,7 +54,7 @@ Feature: Create "Message Set" Device Reference Data - success scenarios
5254
And the response headers contain:
5355
| name | value |
5456
| Content-Type | application/json |
55-
| Content-Length | 322 |
57+
| Content-Length | 342 |
5658

5759
Examples:
5860
| product_team_id | product_id |
@@ -87,6 +89,7 @@ Feature: Create "Message Set" Device Reference Data - success scenarios
8789
| path | value |
8890
| id | << ignore >> |
8991
| name | F5H1R-850000 - MHS Message Set |
92+
| status | active |
9093
| product_id | ${ note(product_id) } |
9194
| product_team_id | ${ note(product_team_id) } |
9295
| ods_code | F5H1R |
@@ -113,13 +116,14 @@ Feature: Create "Message Set" Device Reference Data - success scenarios
113116
And the response headers contain:
114117
| name | value |
115118
| Content-Type | application/json |
116-
| Content-Length | 1199 |
119+
| Content-Length | 1219 |
117120
And I note the response field "$.id" as "device_reference_data_id"
118121
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/DeviceReferenceData/${ note(device_reference_data_id) }"
119122
Then I receive a status code "200" with body
120123
| path | value |
121124
| id | ${ note(device_reference_data_id) } |
122125
| name | F5H1R-850000 - MHS Message Set |
126+
| status | active |
123127
| product_id | ${ note(product_id) } |
124128
| product_team_id | ${ note(product_team_id) } |
125129
| ods_code | F5H1R |
@@ -146,4 +150,4 @@ Feature: Create "Message Set" Device Reference Data - success scenarios
146150
And the response headers contain:
147151
| name | value |
148152
| Content-Type | application/json |
149-
| Content-Length | 1199 |
153+
| Content-Length | 1219 |

src/layers/domain/core/device_reference_data/v1.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from domain.core.aggregate_root import AggregateRoot, event
77
from domain.core.cpm_system_id import ProductId
88
from domain.core.device import DuplicateQuestionnaireResponse
9+
from domain.core.enum import Status
910
from domain.core.event import Event
1011
from domain.core.questionnaire import QuestionnaireResponse
1112
from domain.core.timestamp import now
@@ -17,6 +18,7 @@
1718
class DeviceReferenceDataCreatedEvent(Event):
1819
id: str
1920
name: str
21+
status: Status
2022
product_id: ProductId
2123
product_team_id: UUID
2224
ods_code: str
@@ -41,6 +43,7 @@ class DeviceReferenceData(AggregateRoot):
4143

4244
id: UUID = Field(default_factory=uuid4, immutable=True)
4345
name: str = Field(regex=DEVICE_NAME_REGEX)
46+
status: Status = Field(default=Status.ACTIVE)
4447
product_id: ProductId = Field(immutable=True)
4548
product_team_id: str = Field(immutable=True)
4649
ods_code: str = Field(immutable=True)

0 commit comments

Comments
 (0)