Skip to content

Commit 9dccb73

Browse files
authored
Merge pull request #521 from NHSDigital/release/2025-03-03
Release/2025 03 03
2 parents 35ce335 + 2c4913a commit 9dccb73

File tree

82 files changed

+737
-699
lines changed

Some content is hidden

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

82 files changed

+737
-699
lines changed

CHANGELOG.md

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

3+
## 2025-03-03
4+
- [PI-789] Remove EPR Final
5+
36
## 2025-02-26
47
- [PI-793] Remove EPR ETL
58
- [PI-795] Remove EPR repository layers

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,13 @@ There are four types of `pytest` in this project:
203203
- Unit: these _do not have_ any `@pytest.mark` markers;
204204
- Integration: these have `@pytest.mark.integration` markers;
205205
- Smoke: these have `@pytest.mark.smoke` markers;
206-
- Matrix: these have `@pytest.mark.matrix` markers;
207206

208207
In order to run these you can do one of::
209208

210209
```shell
211210
make test--unit
212211
make test--integration # Will attempt to log you into AWS first
213212
make test--smoke # Will attempt to log you into AWS first
214-
make test--sds--matrix
215213
```
216214

217215
If you would like to rerun all failed tests, you can append `--rerun` to the test command, e.g.:
@@ -230,7 +228,6 @@ Otherwise, feel free to run `pytest` from your `poetry` shell for more fine-grai
230228

231229
The VSCode settings for "Run and Debug" are also set up to run these tests if your prefer.
232230

233-
`make test--sds--matrix` is used for testing responses match in SDS FHIR between CPM and LDAP. You must provide `SDS_PROD_APIKEY` and `SDS_DEV_APIKEY`. There are 3 optional variables `USE_CPM_PROD`, defaults to `FALSE`, `COMPARISON_ENV`, defaults to `local` and `TEST_COUNT`, defaults to `10` and is the number of requests to make.
234231
Add `PYTEST_FLAGS='-sv'`.
235232

236233
### End-to-End feature tests
@@ -296,27 +293,27 @@ TBC
296293

297294
#### Write-integrity (primary keys)
298295

299-
The Partition Key (`pk`) that we use for all objects\* in the database is a unique combination of prefix (aligned with the object type, e.g. `D#` for `Device`) and identifier (generally a UUID). The Sort Key (`sk`) that we use is always exactly equal to the Partition Key. This is opposed to having fully denormalised objects so that attributes are nested under their own `sk`. The reason for doing this is to limit multiple read operations for a given object, and also save I/O in our ETL process by reducing the number of database transactions required per object.
296+
The Partition Key (`pk`) that we use for all objects\* in the database is a unique combination of prefix (aligned with the object type, e.g. `PT#` for `ProductTeam`) and identifier (generally a UUID). The Sort Key (`sk`) that we use is the id of the entity itself. We inject 2 columns into the row of each entity during writing and do not display on the domain classes themselves. These are `row_type` and `root`
300297

301-
Objects can additionally be indexed by any keys (see [Domain models](#domain-models)) that they have. For every key in an domain object,
298+
The table is structured as below. (For purposes of clarity extra "entity specific" attributes have been left out.)
299+
300+
| PK | SK | row_type | Id | name | created_on | updated_on | deleted_on | status | pk_read_1 | sk_read_1 | pk_read_2 | sk_read_2 | root |
301+
| :-------: | :---------: | :----------------: | :-------: | :------------: | :------------------------------: | :--------: | :--------: | :----: | :---------: | :---------: | :-------: | :---------: | :---: |
302+
| PT#12345 | PT#12345 | product_team | 12345 | A Product Team | 2025-01-30T14:30:18.191643+00:00 | null | null | active | PT#12345 | PT#12345 | ORG#AB123 | PT#12345 | true |
303+
| PT#12345 | P#P.123-XYZ | product | P.123-XYZ | A product | 2025-01-30T14:30:18.191643+00:00 | null | null | active | P#P.123-XYZ | P#P.123-XYZ | ORG#AB123 | P#P.123-XYZ | true |
304+
| PT#FOOBAR | PT#FOOBAR | product_team_alias | 12345 | A Product Team | 2025-01-30T14:30:18.191643+00:00 | null | null | active | PT#FOOBAR | PT#FOOBAR | NULL | NULL | false |
305+
306+
Product Teams can additionally be indexed by any keys (see [Domain models](#domain-models)) that they have. For every key in an domain object, that is of type product_team_alias_id,
302307
a copy is made in the database with the index being that key, rather
303308
than the object's identifier. Such copies are referred to as non-root
304309
objects, whereas the "original" (indexed by identifier) is referred to
305310
as the root object.
306311

307-
\* In the case of `Device` tags, which sit outside of the standard database model, `pk` is equal to a query string and `sk` is equal to `pk` of the object that is referred to. A tag-indexed `Device` is otherwise a copy of the root `Device`.
308-
309312
#### Read/search interface
310313

311-
We have implemented a Global Secondary Index (GSI) for attributes named `pk_read` and `sk_read`. The pattern that is place is as follows:
312-
313-
- `pk_read`: A concatenation of parent `pk` values (joined with `#`, e.g. `PT#<product_team_id>#P<product_id>`)
314-
- `sk_read`: Equal to the `pk` of the object itself.
315-
316-
We refer to this as an "ownership" model, as it allows for reads to be
317-
executed in a way that mirrors the API read operations (GET `grandparent/parent/child`), whilst also giving us the ability to return all objects owned by the object indicated in the `pk_read` - which is a common operation for us.
314+
We have implemented 2 Global Secondary Indexes (GSI) for attributes named `pk_read_1`, `sk_read_1`, `pk_read_2` and `sk_read_2`. The pattern that is place is as follows:
318315

319-
A `read` and `search` is available on all `Repository` patterns (almost) for free (the base `_read` and `_search` require a shallow wrapper, but most of the work is done for you).
316+
A `read` and `search` is available on all `Repository` patterns (almost) for free (the base `_read` and `_search` require a shallow wrapper).
320317

321318
### Response models
322319

VERSION

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

src/layers/domain/api/common_steps/create_device.py renamed to archived_epr/src_old/layers/domain/api/common_steps/create_device.py

File renamed without changes.
File renamed without changes.

src/layers/domain/api/tests/test_search_query.py renamed to archived_epr/src_old/layers/domain/api/tests/test_search_query.py

File renamed without changes.

src/layers/domain/questionnaire_instances/constants.py renamed to archived_epr/src_old/layers/domain/questionnaire_instances/constants.py

File renamed without changes.

src/layers/domain/questionnaire_instances/questionnaires/spine_as/field_mapping.json renamed to archived_epr/src_old/layers/domain/questionnaire_instances/questionnaires/spine_as/field_mapping.json

File renamed without changes.

src/layers/domain/questionnaire_instances/questionnaires/spine_as/v1.json renamed to archived_epr/src_old/layers/domain/questionnaire_instances/questionnaires/spine_as/v1.json

File renamed without changes.

src/layers/domain/questionnaire_instances/questionnaires/spine_as_additional_interactions/field_mapping.json renamed to archived_epr/src_old/layers/domain/questionnaire_instances/questionnaires/spine_as_additional_interactions/field_mapping.json

File renamed without changes.

0 commit comments

Comments
 (0)