From da41f2d1c817ff90d782199d041acb3df0143529 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Wed, 22 Jan 2025 12:41:47 +0100 Subject: [PATCH] add person-type ORGANIZATIONAL_UNIT --- doc/hs-office-data-structure.md | 1 + .../hsadminng/hs/office/person/HsOfficePersonType.java | 1 + .../hs-office/hs-office-person-schemas.yaml | 1 + .../5-hs-office/502-person/5020-hs-office-person.sql | 1 + .../person/HsOfficePersonControllerAcceptanceTest.java | 10 ++++------ 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/hs-office-data-structure.md b/doc/hs-office-data-structure.md index cce17510..2844189a 100644 --- a/doc/hs-office-data-structure.md +++ b/doc/hs-office-data-structure.md @@ -50,6 +50,7 @@ classDiagram UNKNOWN: nur für Import NATURAL_PERSON: natürliche Person LEGAL_PERSON: z.B. GmbH, e.K., eG, e.V. + ORGANIZATIONAL_UNIT: z.B. "Admin-Team", "Buchhaltung" INCORORATED_FIRM: z.B. OHG, Partnerschaftsgesellschaft UNINCORPORATED_FIRM: z.B. GbR, ARGE, Erbengemeinschaft PUBLIC_INSTITUTION: KdöR, AöR [ohne Registergericht/Registernummer] diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonType.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonType.java index c9372919..3acb15dd 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonType.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonType.java @@ -4,6 +4,7 @@ public enum HsOfficePersonType { UNKNOWN_PERSON_TYPE("??"), NATURAL_PERSON("NP"), // a human being LEGAL_PERSON("LP"), // incorporated legal entity like A/S, GmbH, e.K., eG, e.V. + ORGANIZATIONAL_UNIT("OU"), // groups of persons within an organization, e.g. "Admin-Team", "Buchhaltung" INCORPORATED_FIRM("IF"), // registered business partnership like OHG, Partnerschaftsgesellschaft UNINCORPORATED_FIRM("UF"), // unregistered partnership, association etc. like GbR, ARGE, community of heirs PUBLIC_INSTITUTION("PI"); // entities under public law like government entities, KdöR, AöR diff --git a/src/main/resources/api-definition/hs-office/hs-office-person-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-person-schemas.yaml index 63fc3258..dcb6d31f 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-person-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-person-schemas.yaml @@ -9,6 +9,7 @@ components: - UNKNOWN_PERSON - NATURAL_PERSON - LEGAL_PERSON + - ORGANIZATIONAL_UNIT - INCORPORATED_FIRM - UNINCORPORATED_FIRM - PUBLIC_INSTITUTION diff --git a/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql b/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql index a2e72952..5cbaa53d 100644 --- a/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql +++ b/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql @@ -8,6 +8,7 @@ CREATE TYPE hs_office.PersonType AS ENUM ( '??', -- unknown 'NP', -- natural person 'LP', -- legal person + 'OU', -- organizational unit 'IF', -- incorporated firm 'UF', -- unincorporated firm 'PI'); -- public institution diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java index 7f6e48ca..46a28ade 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonControllerAcceptanceTest.java @@ -85,9 +85,8 @@ class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup .contentType(ContentType.JSON) .body(""" { - "personType": "NATURAL_PERSON", - "familyName": "Tester", - "givenName": "Temp Testi" + "personType": "ORGANIZATIONAL_UNIT", + "tradeName": "Admin-Team" } """) .port(port) @@ -97,9 +96,8 @@ class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup .statusCode(201) .contentType(ContentType.JSON) .body("uuid", isUuidValid()) - .body("personType", is("NATURAL_PERSON")) - .body("familyName", is("Tester")) - .body("givenName", is("Temp Testi")) + .body("personType", is("ORGANIZATIONAL_UNIT")) + .body("tradeName", is("Admin-Team")) .header("Location", startsWith("http://localhost")) .extract().header("Location"); // @formatter:on