feature/split-up-postalAddress #118

Merged
hsh-michaelhoennig merged 10 commits from feature/split-up-postalAddress into master 2024-11-06 12:24:44 +01:00
3 changed files with 6 additions and 4 deletions
Showing only changes of commit 11e9ecc95a - Show all commits

View File

@ -50,7 +50,7 @@ components:
anyOf: anyOf:
- type: object - type: object
properties: properties:
firma: firm:
type: string type: string
nullable: true nullable: true
name: name:

View File

@ -1140,8 +1140,10 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
rec.getString("last_name")); rec.getString("last_name"));
if (isNotBlank(name)) if (isNotBlank(name))
result.put("name", 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))) if (isNotBlank(rec.getString(key)))
result.put(key, rec.getString(key)); result.put(key, rec.getString(key));
}); });

View File

@ -55,7 +55,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
.given("tradeName", "Test AG") .given("tradeName", "Test AG")
.given("contactCaption", "Test AG - Hamburg") .given("contactCaption", "Test AG - Hamburg")
.given("postalAddress", """ .given("postalAddress", """
"firma": "Test AG", "firm": "Test AG",
"street": "Shanghai-Allee 1", "street": "Shanghai-Allee 1",
"zipcode": "20123", "zipcode": "20123",
"city": "Hamburg", "city": "Hamburg",
@ -183,7 +183,7 @@ class HsOfficeScenarioTests extends ScenarioTest {
.given("partnerName", "Test AG") .given("partnerName", "Test AG")
.given("newContactCaption", "Test AG - China") .given("newContactCaption", "Test AG - China")
.given("newPostalAddress", """ .given("newPostalAddress", """
"firma": "Test AG", "firm": "Test AG",
"name": "Fi Zhong-Kha", "name": "Fi Zhong-Kha",
"building": "Thi Chi Koh Building", "building": "Thi Chi Koh Building",
"street": "No.2 Commercial Second Street", "street": "No.2 Commercial Second Street",