Skip to content

Commit

Permalink
Feature/pdct 1056 add corpus title to family read dto (#128)
Browse files Browse the repository at this point in the history
* Turn off B rules in ruff

* Add corpus_id and corpus_type to Family read DTO

* Rename function to create_family_read_dto & add corpus fields to family read dto helper

* Bump poetry to 1.7.1, update lockfile & bump pypackage version to 2.4.1

* Bump pypackage version to 2.4.0

* Revert "Bump pypackage version to 2.4.0"

This reverts commit c5a384e.

* Add corpus title to family read DTO
  • Loading branch information
katybaulch authored Apr 29, 2024
1 parent b586f21 commit f2ceb5f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/model/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class FamilyReadDTO(BaseModel):
collections: list[str]
organisation: str
corpus_id: str
corpus_title: str
corpus_type: str
created: datetime
last_modified: datetime
Expand Down
1 change: 1 addition & 0 deletions app/repository/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def _family_to_dto(
],
organisation=org,
corpus_id=cast(str, corpus.import_id),
corpus_title=cast(str, corpus.title),
corpus_type=cast(str, corpus.corpus_type_name),
created=cast(datetime, fam.created),
last_modified=cast(datetime, fam.last_modified),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "admin_backend"
version = "2.4.0"
version = "2.4.1"
description = ""
authors = ["CPR-dev-team <[email protected]>"]
packages = [{ include = "app" }, { include = "tests" }]
Expand Down
1 change: 1 addition & 0 deletions tests/helpers/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def create_family_read_dto(
collections=collections,
organisation="CCLW",
corpus_id="CCLW.corpus.i00000001.n0000",
corpus_title="CCLW national policies",
corpus_type="Laws and Policies",
created=datetime.now(),
last_modified=datetime.now(),
Expand Down
3 changes: 3 additions & 0 deletions tests/integration_tests/setup_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"metadata": {"size": [3], "color": ["red"]},
"organisation": "CCLW",
"corpus_id": "CCLW.corpus.i00000001.n0000",
"corpus_title": "CCLW national policies",
"corpus_type": "Laws and Policies",
"slug": "Slug1",
"events": ["E.0.0.1", "E.0.0.2"],
Expand All @@ -54,6 +55,7 @@
"metadata": {"size": [4], "color": ["green"]},
"organisation": "CCLW",
"corpus_id": "CCLW.corpus.i00000001.n0000",
"corpus_title": "CCLW national policies",
"corpus_type": "Laws and Policies",
"slug": "Slug2",
"events": [],
Expand All @@ -72,6 +74,7 @@
"metadata": {"size": [100], "color": ["blue"]},
"organisation": "CCLW",
"corpus_id": "CCLW.corpus.i00000001.n0000",
"corpus_title": "CCLW national policies",
"corpus_type": "Laws and Policies",
"slug": "Slug3",
"events": ["E.0.0.3"],
Expand Down

0 comments on commit f2ceb5f

Please sign in to comment.