diff --git a/app/records/schemas/details.py b/app/records/schemas/details.py index 2ca27fd..1e797e0 100644 --- a/app/records/schemas/details.py +++ b/app/records/schemas/details.py @@ -29,6 +29,7 @@ class Record(Details): legal_status: str | None = None closure_status: str | None = None access_condition: str | None = None + notes: list[str] = [] languages: list[str] = [] related_materials: list[dict] = [] hierarchy: list[dict] = [] @@ -56,6 +57,7 @@ class Aggregation(Details): legal_status: str | None = None closure_status: str | None = None access_condition: str | None = None + notes: list[str] = [] languages: list[str] = [] related_materials: list[dict] = [] hierarchy: list[dict] = [] diff --git a/app/sources/rosetta/api.py b/app/sources/rosetta/api.py index 489a0d3..94defba 100644 --- a/app/sources/rosetta/api.py +++ b/app/sources/rosetta/api.py @@ -166,6 +166,7 @@ def parse_results(self, raw_results, source_url): record.legal_status = parsed_data.legal_status() record.closure_status = parsed_data.closure_status() record.access_condition = parsed_data.access_condition() + record.notes = parsed_data.notes() record.languages = parsed_data.languages() record.related_materials = parsed_data.related_materials() record.hierarchy = ( @@ -198,6 +199,7 @@ def parse_results(self, raw_results, source_url): record.legal_status = parsed_data.legal_status() record.closure_status = parsed_data.closure_status() record.access_condition = parsed_data.access_condition() + record.notes = parsed_data.notes() record.languages = parsed_data.languages() record.related_materials = parsed_data.related_materials() record.hierarchy = ( diff --git a/app/sources/rosetta/lib/response_parser.py b/app/sources/rosetta/lib/response_parser.py index 30040a7..079e105 100644 --- a/app/sources/rosetta/lib/response_parser.py +++ b/app/sources/rosetta/lib/response_parser.py @@ -602,7 +602,7 @@ def reference_number(self) -> str | None: None, ) return None - + def repository_url(self) -> str | None: return objects.get(self.source, "repository.url") @@ -849,3 +849,10 @@ def unpublished_finding_aids(self) -> str | None: None, ) return None + + def notes(self) -> list[str] | None: + if "note" in self.source: + return [ + note["value"] for note in self.source["note"] if "value" in note + ] + return None