diff --git a/src/main/resources/api-definition/hs-office/hs-office-contact-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-contact-schemas.yaml index a3067a69..9867921b 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-contact-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-contact-schemas.yaml @@ -50,7 +50,7 @@ components: anyOf: - type: object properties: - firma: + firm: type: string nullable: true name: diff --git a/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java b/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java index b8f5fbf5..70f21e11 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/migration/BaseOfficeDataImport.java @@ -1140,8 +1140,10 @@ public abstract class BaseOfficeDataImport extends CsvDataImport { rec.getString("last_name")); if (isNotBlank(name)) result.put("name", name); + if (isNotBlank(rec.getString("firma"))) + result.put("firm", name); - List.of("firma", "co", "street", "zipcode", "city", "country").forEach(key -> { + List.of("co", "street", "zipcode", "city", "country").forEach(key -> { if (isNotBlank(rec.getString(key))) result.put(key, rec.getString(key)); }); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java index 552f8664..0288ab9f 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/HsOfficeScenarioTests.java @@ -55,7 +55,7 @@ class HsOfficeScenarioTests extends ScenarioTest { .given("tradeName", "Test AG") .given("contactCaption", "Test AG - Hamburg") .given("postalAddress", """ - "firma": "Test AG", + "firm": "Test AG", "street": "Shanghai-Allee 1", "zipcode": "20123", "city": "Hamburg", @@ -183,7 +183,7 @@ class HsOfficeScenarioTests extends ScenarioTest { .given("partnerName", "Test AG") .given("newContactCaption", "Test AG - China") .given("newPostalAddress", """ - "firma": "Test AG", + "firm": "Test AG", "name": "Fi Zhong-Kha", "building": "Thi Chi Koh Building", "street": "No.2 Commercial Second Street",