test(data-extraction): Adapt to extended enum

This commit is contained in:
TrisNol 2023-09-17 19:25:30 +02:00
parent febcd59e39
commit d54c1cd17d
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,8 @@ class RelationshipRoleEnum(str, MultiValueEnum):
STAENDIGER_VERTRETER = "Ständige(r) Vertreter(in)"
SONSTIGER_VERTRETER = "Sonstige(r) Vertreter(in)", "Sonstiger Vertreter"
GESCHAEFTSLEITER = "Geschäftsleiter(in)", "Geschäftsleiter"
ZWEIGNIEDERLASSUNG = "Zweigniederlassung"
HAUPTNIEDERLASSUNG = "Hauptniederlassung"
@dataclass

View File

@ -120,7 +120,9 @@ def parse_stakeholder(data: dict) -> CompanyRelationship | None:
if "Organisation" in data["Beteiligter"]:
return CompanyToCompanyRelationship(
**{
"role": data["Rolle"]["Rollenbezeichnung"]["content"],
"role": RelationshipRoleEnum(
data["Rolle"]["Rollenbezeichnung"]["content"]
),
"description": data["Beteiligter"]["Organisation"]["Bezeichnung"][
"Bezeichnung_Aktuell"
],