|
|
|
@ -54,7 +54,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
"subscriber:customers-announce"
|
|
|
|
|
};
|
|
|
|
|
private static final String[] KNOWN_ROLES = ArrayUtils.addAll(
|
|
|
|
|
new String[] { "partner", "vip-contact", "ex-partner", "billing", "contractual", "operation" },
|
|
|
|
|
new String[] { "partner", "vip-contact", "ex-partner", "billing", "contractual", "operation", "silent" },
|
|
|
|
|
SUBSCRIBER_ROLES);
|
|
|
|
|
|
|
|
|
|
// at least as the number of lines in business_partners.csv from test-data, but less than real data partner count
|
|
|
|
@ -65,18 +65,21 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
static int relationId = INITIAL_RELATION_ID;
|
|
|
|
|
|
|
|
|
|
private static final List<Integer> IGNORE_BUSINESS_PARTNERS = Arrays.asList(
|
|
|
|
|
512167, // 11139, partner without contractual contact
|
|
|
|
|
512170, // 11142, partner without contractual contact
|
|
|
|
|
511725, // 10764, partner without contractual contact
|
|
|
|
|
// 512171, // 11143, partner without partner contact -- exception
|
|
|
|
|
-1
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
private static final List<Integer> IGNORE_CONTACTS = Arrays.asList(
|
|
|
|
|
90547, // Kontakt hat keine Rolle
|
|
|
|
|
-1
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
private static final Map<Integer, HsOfficePersonType> PERSON_TYPES_BY_CONTACT = Map.of(
|
|
|
|
|
90072, HsOfficePersonType.NATURAL_PERSON,
|
|
|
|
|
90641, HsOfficePersonType.LEGAL_PERSON,
|
|
|
|
|
90368, HsOfficePersonType.LEGAL_PERSON,
|
|
|
|
|
90564, HsOfficePersonType.NATURAL_PERSON,
|
|
|
|
|
-1, HsOfficePersonType.LEGAL_PERSON
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
static Map<Integer, HsOfficeContactRealEntity> contacts = new WriteOnceMap<>();
|
|
|
|
|
static Map<Integer, HsOfficePersonEntity> persons = new WriteOnceMap<>();
|
|
|
|
|
static Map<Integer, HsOfficePartnerEntity> partners = new WriteOnceMap<>();
|
|
|
|
@ -192,56 +195,56 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
|
|
|
|
|
assertThat(toJsonFormattedString(partners)).isEqualToIgnoringWhitespace("""
|
|
|
|
|
{
|
|
|
|
|
100=partner(P-10003: ?? Michael Mellis, Herr Michael Mellis , Michael Mellis),
|
|
|
|
|
120=partner(P-10020: LP JM GmbH, Herr Philip Meyer-Contract , JM GmbH),
|
|
|
|
|
122=partner(P-11022: ?? Test PS, Petra Schmidt , Test PS),
|
|
|
|
|
132=partner(P-10152: ?? Ragnar IT-Beratung, Herr Ragnar Richter , Ragnar IT-Beratung),
|
|
|
|
|
190=partner(P-19090: NP Camus, Cecilia, Frau Cecilia Camus ),
|
|
|
|
|
100=partner(P-10003: ?? Michael Mellis, Herr Michael Mellis, Michael Mellis),
|
|
|
|
|
120=partner(P-10020: LP JM GmbH, Herr Philip Meyer-Contract, JM GmbH),
|
|
|
|
|
122=partner(P-11022: ?? Test PS, Petra Schmidt, Test PS),
|
|
|
|
|
132=partner(P-10152: ?? Ragnar IT-Beratung, Herr Ragnar Richter, Ragnar IT-Beratung),
|
|
|
|
|
190=partner(P-19090: NP Camus, Cecilia, Frau Cecilia Camus),
|
|
|
|
|
199=partner(P-19999: null null, null),
|
|
|
|
|
213=partner(P-10000: LP Hostsharing e.G., Firma Hostmaster Hostsharing , Hostsharing e.G.),
|
|
|
|
|
541=partner(P-11018: ?? Wasserwerk Südholstein, Frau Christiane Milberg , Wasserwerk Südholstein),
|
|
|
|
|
542=partner(P-11019: ?? Das Perfekte Haus, Herr Richard Wiese , Das Perfekte Haus)
|
|
|
|
|
213=partner(P-10000: LP Hostsharing e.G., Firma Hostmaster Hostsharing, Hostsharing e.G.),
|
|
|
|
|
541=partner(P-11018: ?? Wasserwerk Südholstein, Frau Christiane Milberg, Wasserwerk Südholstein),
|
|
|
|
|
542=partner(P-11019: ?? Das Perfekte Haus, Herr Richard Wiese, Das Perfekte Haus)
|
|
|
|
|
}
|
|
|
|
|
""");
|
|
|
|
|
assertThat(toJsonFormattedString(contacts)).isEqualToIgnoringWhitespace("""
|
|
|
|
|
{
|
|
|
|
|
100=contact(caption='Herr Michael Mellis , Michael Mellis', emailAddresses='{ "main": "michael@Mellis.example.org"}'),
|
|
|
|
|
100=contact(caption='Herr Michael Mellis, Michael Mellis', emailAddresses='{ "main": "michael@Mellis.example.org"}'),
|
|
|
|
|
1200=contact(caption='JM e.K.', emailAddresses='{ "main": "jm-ex-partner@example.org"}'),
|
|
|
|
|
1201=contact(caption='Frau Dr. Jenny Meyer-Billing , JM GmbH', emailAddresses='{ "main": "jm-billing@example.org"}'),
|
|
|
|
|
1202=contact(caption='Herr Andrew Meyer-Operation , JM GmbH', emailAddresses='{ "main": "am-operation@example.org"}'),
|
|
|
|
|
1203=contact(caption='Herr Philip Meyer-Contract , JM GmbH', emailAddresses='{ "main": "pm-partner@example.org"}'),
|
|
|
|
|
1204=contact(caption='Frau Tammy Meyer-VIP , JM GmbH', emailAddresses='{ "main": "tm-vip@example.org"}'),
|
|
|
|
|
1301=contact(caption='Petra Schmidt , Test PS', emailAddresses='{ "main": "ps@example.com"}'),
|
|
|
|
|
132=contact(caption='Herr Ragnar Richter , Ragnar IT-Beratung', emailAddresses='{ "main": "hostsharing@ragnar-richter.de"}'),
|
|
|
|
|
1401=contact(caption='Frau Frauke Fanninga ', emailAddresses='{ "main": "ff@example.org"}'),
|
|
|
|
|
1501=contact(caption='Frau Cecilia Camus ', emailAddresses='{ "main": "cc@example.org"}'),
|
|
|
|
|
212=contact(caption='Firma Hostmaster Hostsharing , Hostsharing e.G.', emailAddresses='{ "main": "hostmaster@hostsharing.net"}'),
|
|
|
|
|
90436=contact(caption='Frau Christiane Milberg , Wasserwerk Südholstein', emailAddresses='{ "main": "rechnung@ww-sholst.example.org"}'),
|
|
|
|
|
90437=contact(caption='Herr Richard Wiese , Das Perfekte Haus', emailAddresses='{ "main": "admin@das-perfekte-haus.example.org"}'),
|
|
|
|
|
90438=contact(caption='Herr Karim Metzger , Wasswerwerk Südholstein', emailAddresses='{ "main": "karim.metzger@ww-sholst.example.org"}'),
|
|
|
|
|
90590=contact(caption='Herr Inhaber R. Wiese , Das Perfekte Haus', emailAddresses='{ "main": "515217@kkemail.example.org"}'),
|
|
|
|
|
90629=contact(caption='Ragnar Richter ', emailAddresses='{ "main": "mail@ragnar-richter..example.org"}'),
|
|
|
|
|
90677=contact(caption='Eike Henning ', emailAddresses='{ "main": "hostsharing@eike-henning..example.org"}'),
|
|
|
|
|
90698=contact(caption='Jan Henning ', emailAddresses='{ "main": "mail@jan-henning.example.org"}')
|
|
|
|
|
1201=contact(caption='Frau Dr. Jenny Meyer-Billing, JM GmbH', emailAddresses='{ "main": "jm-billing@example.org"}'),
|
|
|
|
|
1202=contact(caption='Herr Andrew Meyer-Operation, JM GmbH', emailAddresses='{ "main": "am-operation@example.org"}'),
|
|
|
|
|
1203=contact(caption='Herr Philip Meyer-Contract, JM GmbH', emailAddresses='{ "main": "pm-partner@example.org"}'),
|
|
|
|
|
1204=contact(caption='Frau Tammy Meyer-VIP, JM GmbH', emailAddresses='{ "main": "tm-vip@example.org"}'),
|
|
|
|
|
1301=contact(caption='Petra Schmidt, Test PS', emailAddresses='{ "main": "ps@example.com"}'),
|
|
|
|
|
132=contact(caption='Herr Ragnar Richter, Ragnar IT-Beratung', emailAddresses='{ "main": "hostsharing@ragnar-richter.de"}'),
|
|
|
|
|
1401=contact(caption='Frau Frauke Fanninga', emailAddresses='{ "main": "ff@example.org"}'),
|
|
|
|
|
1501=contact(caption='Frau Cecilia Camus', emailAddresses='{ "main": "cc@example.org"}'),
|
|
|
|
|
212=contact(caption='Firma Hostmaster Hostsharing, Hostsharing e.G.', emailAddresses='{ "main": "hostmaster@hostsharing.net"}'),
|
|
|
|
|
90436=contact(caption='Frau Christiane Milberg, Wasserwerk Südholstein', emailAddresses='{ "main": "rechnung@ww-sholst.example.org"}'),
|
|
|
|
|
90437=contact(caption='Herr Richard Wiese, Das Perfekte Haus', emailAddresses='{ "main": "admin@das-perfekte-haus.example.org"}'),
|
|
|
|
|
90438=contact(caption='Herr Karim Metzger, Wasswerwerk Südholstein', emailAddresses='{ "main": "karim.metzger@ww-sholst.example.org"}'),
|
|
|
|
|
90590=contact(caption='Herr Inhaber R. Wiese, Das Perfekte Haus', emailAddresses='{ "main": "515217@kkemail.example.org"}'),
|
|
|
|
|
90629=contact(caption='Ragnar Richter', emailAddresses='{ "main": "mail@ragnar-richter..example.org"}'),
|
|
|
|
|
90677=contact(caption='Eike Henning', emailAddresses='{ "main": "hostsharing@eike-henning..example.org"}'),
|
|
|
|
|
90698=contact(caption='Jan Henning', emailAddresses='{ "main": "mail@jan-henning.example.org"}')
|
|
|
|
|
}
|
|
|
|
|
""");
|
|
|
|
|
assertThat(toJsonFormattedString(persons)).isEqualToIgnoringWhitespace("""
|
|
|
|
|
{
|
|
|
|
|
100=person(personType='??', tradeName='Michael Mellis', familyName='Mellis', givenName='Michael'),
|
|
|
|
|
100=person(personType='??', tradeName='Michael Mellis', salutation='Herr', familyName='Mellis', givenName='Michael'),
|
|
|
|
|
1200=person(personType='LP', tradeName='JM e.K.'),
|
|
|
|
|
1201=person(personType='LP', tradeName='JM GmbH', familyName='Meyer-Billing', givenName='Jenny'),
|
|
|
|
|
1202=person(personType='LP', tradeName='JM GmbH', familyName='Meyer-Operation', givenName='Andrew'),
|
|
|
|
|
1203=person(personType='LP', tradeName='JM GmbH', familyName='Meyer-Contract', givenName='Philip'),
|
|
|
|
|
1204=person(personType='LP', tradeName='JM GmbH', familyName='Meyer-VIP', givenName='Tammy'),
|
|
|
|
|
1201=person(personType='LP', tradeName='JM GmbH', salutation='Frau', title='Dr.', familyName='Meyer-Billing', givenName='Jenny'),
|
|
|
|
|
1202=person(personType='LP', tradeName='JM GmbH', salutation='Herr', familyName='Meyer-Operation', givenName='Andrew'),
|
|
|
|
|
1203=person(personType='LP', tradeName='JM GmbH', salutation='Herr', familyName='Meyer-Contract', givenName='Philip'),
|
|
|
|
|
1204=person(personType='LP', tradeName='JM GmbH', salutation='Frau', familyName='Meyer-VIP', givenName='Tammy'),
|
|
|
|
|
1301=person(personType='??', tradeName='Test PS', familyName='Schmidt', givenName='Petra'),
|
|
|
|
|
132=person(personType='??', tradeName='Ragnar IT-Beratung', familyName='Richter', givenName='Ragnar'),
|
|
|
|
|
1401=person(personType='NP', familyName='Fanninga', givenName='Frauke'),
|
|
|
|
|
1501=person(personType='NP', familyName='Camus', givenName='Cecilia'),
|
|
|
|
|
212=person(personType='LP', tradeName='Hostsharing e.G.', familyName='Hostsharing', givenName='Hostmaster'),
|
|
|
|
|
90436=person(personType='??', tradeName='Wasserwerk Südholstein', familyName='Milberg', givenName='Christiane'),
|
|
|
|
|
90437=person(personType='??', tradeName='Das Perfekte Haus', familyName='Wiese', givenName='Richard'),
|
|
|
|
|
90438=person(personType='??', tradeName='Wasswerwerk Südholstein', familyName='Metzger', givenName='Karim'),
|
|
|
|
|
90590=person(personType='??', tradeName='Das Perfekte Haus', familyName='Wiese', givenName='Inhaber R.'),
|
|
|
|
|
132=person(personType='??', tradeName='Ragnar IT-Beratung', salutation='Herr', familyName='Richter', givenName='Ragnar'),
|
|
|
|
|
1401=person(personType='NP', salutation='Frau', familyName='Fanninga', givenName='Frauke'),
|
|
|
|
|
1501=person(personType='NP', salutation='Frau', familyName='Camus', givenName='Cecilia'),
|
|
|
|
|
212=person(personType='LP', tradeName='Hostsharing e.G.', salutation='Firma', familyName='Hostsharing', givenName='Hostmaster'),
|
|
|
|
|
90436=person(personType='??', tradeName='Wasserwerk Südholstein', salutation='Frau', familyName='Milberg', givenName='Christiane'),
|
|
|
|
|
90437=person(personType='??', tradeName='Das Perfekte Haus', salutation='Herr', familyName='Wiese', givenName='Richard'),
|
|
|
|
|
90438=person(personType='??', tradeName='Wasswerwerk Südholstein', salutation='Herr', familyName='Metzger', givenName='Karim'),
|
|
|
|
|
90590=person(personType='??', tradeName='Das Perfekte Haus', salutation='Herr', familyName='Wiese', givenName='Inhaber R.'),
|
|
|
|
|
90629=person(personType='NP', familyName='Richter', givenName='Ragnar'),
|
|
|
|
|
90677=person(personType='NP', familyName='Henning', givenName='Eike'),
|
|
|
|
|
90698=person(personType='NP', familyName='Henning', givenName='Jan')
|
|
|
|
@ -272,71 +275,81 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
""");
|
|
|
|
|
assertThat(toJsonFormattedString(relations)).isEqualToIgnoringWhitespace("""
|
|
|
|
|
{
|
|
|
|
|
2000000=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000001=rel(anchor='?? Michael Mellis', type='DEBITOR', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000002=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter , Ragnar IT-Beratung'),
|
|
|
|
|
2000003=rel(anchor='?? Ragnar IT-Beratung', type='DEBITOR', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter , Ragnar IT-Beratung'),
|
|
|
|
|
2000004=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing , Hostsharing e.G.'),
|
|
|
|
|
2000005=rel(anchor='LP Hostsharing e.G.', type='DEBITOR', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing , Hostsharing e.G.'),
|
|
|
|
|
2000006=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg , Wasserwerk Südholstein'),
|
|
|
|
|
2000007=rel(anchor='?? Wasserwerk Südholstein', type='DEBITOR', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg , Wasserwerk Südholstein'),
|
|
|
|
|
2000008=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000009=rel(anchor='?? Das Perfekte Haus', type='DEBITOR', holder='?? Das Perfekte Haus', contact='Herr Inhaber R. Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000010=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract , JM GmbH'),
|
|
|
|
|
2000011=rel(anchor='LP JM GmbH', type='DEBITOR', holder='LP JM GmbH', contact='Frau Dr. Jenny Meyer-Billing , JM GmbH'),
|
|
|
|
|
2000012=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Test PS', contact='Petra Schmidt , Test PS'),
|
|
|
|
|
2000013=rel(anchor='?? Test PS', type='DEBITOR', holder='?? Test PS', contact='Petra Schmidt , Test PS'),
|
|
|
|
|
2000014=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus '),
|
|
|
|
|
2000015=rel(anchor='NP Camus, Cecilia', type='DEBITOR', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus '),
|
|
|
|
|
2000000=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000001=rel(anchor='?? Michael Mellis', type='DEBITOR', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000002=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter, Ragnar IT-Beratung'),
|
|
|
|
|
2000003=rel(anchor='?? Ragnar IT-Beratung', type='DEBITOR', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter, Ragnar IT-Beratung'),
|
|
|
|
|
2000004=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing, Hostsharing e.G.'),
|
|
|
|
|
2000005=rel(anchor='LP Hostsharing e.G.', type='DEBITOR', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing, Hostsharing e.G.'),
|
|
|
|
|
2000006=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg, Wasserwerk Südholstein'),
|
|
|
|
|
2000007=rel(anchor='?? Wasserwerk Südholstein', type='DEBITOR', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg, Wasserwerk Südholstein'),
|
|
|
|
|
2000008=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000009=rel(anchor='?? Das Perfekte Haus', type='DEBITOR', holder='?? Das Perfekte Haus', contact='Herr Inhaber R. Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000010=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract, JM GmbH'),
|
|
|
|
|
2000011=rel(anchor='LP JM GmbH', type='DEBITOR', holder='LP JM GmbH', contact='Frau Dr. Jenny Meyer-Billing, JM GmbH'),
|
|
|
|
|
2000012=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='?? Test PS', contact='Petra Schmidt, Test PS'),
|
|
|
|
|
2000013=rel(anchor='?? Test PS', type='DEBITOR', holder='?? Test PS', contact='Petra Schmidt, Test PS'),
|
|
|
|
|
2000014=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus'),
|
|
|
|
|
2000015=rel(anchor='NP Camus, Cecilia', type='DEBITOR', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus'),
|
|
|
|
|
2000016=rel(anchor='LP Hostsharing e.G.', type='PARTNER', holder='null null, null'),
|
|
|
|
|
2000017=rel(anchor='null null, null', type='DEBITOR'),
|
|
|
|
|
2000018=rel(anchor='LP Hostsharing e.G.', type='OPERATIONS', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing , Hostsharing e.G.'),
|
|
|
|
|
2000019=rel(anchor='LP Hostsharing e.G.', type='REPRESENTATIVE', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing , Hostsharing e.G.'),
|
|
|
|
|
2000020=rel(anchor='?? Michael Mellis', type='OPERATIONS', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000021=rel(anchor='?? Michael Mellis', type='REPRESENTATIVE', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000022=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='operations-discussion', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000023=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='operations-announce', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000024=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='generalversammlung', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000025=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='members-announce', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000026=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='members-discussion', holder='?? Michael Mellis', contact='Herr Michael Mellis , Michael Mellis'),
|
|
|
|
|
2000027=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter , Ragnar IT-Beratung'),
|
|
|
|
|
2000028=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-discussion', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter , Ragnar IT-Beratung'),
|
|
|
|
|
2000029=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-announce', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter , Ragnar IT-Beratung'),
|
|
|
|
|
2000030=rel(anchor='LP JM GmbH', type='EX_PARTNER', holder='LP JM e.K.', contact='JM e.K.'),
|
|
|
|
|
2000031=rel(anchor='LP JM GmbH', type='OPERATIONS', holder='LP JM GmbH', contact='Herr Andrew Meyer-Operation , JM GmbH'),
|
|
|
|
|
2000032=rel(anchor='LP JM GmbH', type='VIP_CONTACT', holder='LP JM GmbH', contact='Herr Andrew Meyer-Operation , JM GmbH'),
|
|
|
|
|
2000033=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='operations-announce', holder='LP JM GmbH', contact='Herr Andrew Meyer-Operation , JM GmbH'),
|
|
|
|
|
2000034=rel(anchor='LP JM GmbH', type='REPRESENTATIVE', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract , JM GmbH'),
|
|
|
|
|
2000035=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='members-announce', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract , JM GmbH'),
|
|
|
|
|
2000036=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='customers-announce', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract , JM GmbH'),
|
|
|
|
|
2000037=rel(anchor='LP JM GmbH', type='VIP_CONTACT', holder='LP JM GmbH', contact='Frau Tammy Meyer-VIP , JM GmbH'),
|
|
|
|
|
2000038=rel(anchor='?? Test PS', type='OPERATIONS', holder='?? Test PS', contact='Petra Schmidt , Test PS'),
|
|
|
|
|
2000039=rel(anchor='?? Test PS', type='REPRESENTATIVE', holder='?? Test PS', contact='Petra Schmidt , Test PS'),
|
|
|
|
|
2000040=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='operations-announce', holder='NP Fanninga, Frauke', contact='Frau Frauke Fanninga '),
|
|
|
|
|
2000041=rel(anchor='NP Camus, Cecilia', type='OPERATIONS', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus '),
|
|
|
|
|
2000042=rel(anchor='NP Camus, Cecilia', type='REPRESENTATIVE', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus '),
|
|
|
|
|
2000043=rel(anchor='?? Wasserwerk Südholstein', type='REPRESENTATIVE', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg , Wasserwerk Südholstein'),
|
|
|
|
|
2000044=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='generalversammlung', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg , Wasserwerk Südholstein'),
|
|
|
|
|
2000045=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='members-announce', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg , Wasserwerk Südholstein'),
|
|
|
|
|
2000046=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='members-discussion', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg , Wasserwerk Südholstein'),
|
|
|
|
|
2000047=rel(anchor='?? Das Perfekte Haus', type='OPERATIONS', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000048=rel(anchor='?? Das Perfekte Haus', type='REPRESENTATIVE', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000049=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='operations-discussion', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000050=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='operations-announce', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000051=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='generalversammlung', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000052=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='members-announce', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000053=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='members-discussion', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese , Das Perfekte Haus'),
|
|
|
|
|
2000054=rel(anchor='?? Wasserwerk Südholstein', type='OPERATIONS', holder='?? Wasswerwerk Südholstein', contact='Herr Karim Metzger , Wasswerwerk Südholstein'),
|
|
|
|
|
2000055=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='operations-discussion', holder='?? Wasswerwerk Südholstein', contact='Herr Karim Metzger , Wasswerwerk Südholstein'),
|
|
|
|
|
2000056=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='operations-announce', holder='?? Wasswerwerk Südholstein', contact='Herr Karim Metzger , Wasswerwerk Südholstein'),
|
|
|
|
|
2000057=rel(anchor='?? Ragnar IT-Beratung', type='REPRESENTATIVE', holder='NP Richter, Ragnar', contact='Ragnar Richter '),
|
|
|
|
|
2000058=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='generalversammlung', holder='NP Richter, Ragnar', contact='Ragnar Richter '),
|
|
|
|
|
2000059=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='members-announce', holder='NP Richter, Ragnar', contact='Ragnar Richter '),
|
|
|
|
|
2000060=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='members-discussion', holder='NP Richter, Ragnar', contact='Ragnar Richter '),
|
|
|
|
|
2000061=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS', holder='NP Henning, Eike', contact='Eike Henning '),
|
|
|
|
|
2000062=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-discussion', holder='NP Henning, Eike', contact='Eike Henning '),
|
|
|
|
|
2000063=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-announce', holder='NP Henning, Eike', contact='Eike Henning '),
|
|
|
|
|
2000064=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS', holder='NP Henning, Jan', contact='Jan Henning ')
|
|
|
|
|
2000018=rel(anchor='LP Hostsharing e.G.', type='OPERATIONS_ALERT', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing, Hostsharing e.G.'),
|
|
|
|
|
2000019=rel(anchor='LP Hostsharing e.G.', type='OPERATIONS', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing, Hostsharing e.G.'),
|
|
|
|
|
2000020=rel(anchor='LP Hostsharing e.G.', type='REPRESENTATIVE', holder='LP Hostsharing e.G.', contact='Firma Hostmaster Hostsharing, Hostsharing e.G.'),
|
|
|
|
|
2000021=rel(anchor='?? Michael Mellis', type='OPERATIONS_ALERT', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000022=rel(anchor='?? Michael Mellis', type='OPERATIONS', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000023=rel(anchor='?? Michael Mellis', type='REPRESENTATIVE', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000024=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='operations-discussion', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000025=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='operations-announce', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000026=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='generalversammlung', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000027=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='members-announce', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000028=rel(anchor='?? Michael Mellis', type='SUBSCRIBER', mark='members-discussion', holder='?? Michael Mellis', contact='Herr Michael Mellis, Michael Mellis'),
|
|
|
|
|
2000029=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS_ALERT', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter, Ragnar IT-Beratung'),
|
|
|
|
|
2000030=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter, Ragnar IT-Beratung'),
|
|
|
|
|
2000031=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-discussion', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter, Ragnar IT-Beratung'),
|
|
|
|
|
2000032=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-announce', holder='?? Ragnar IT-Beratung', contact='Herr Ragnar Richter, Ragnar IT-Beratung'),
|
|
|
|
|
2000033=rel(anchor='LP JM GmbH', type='EX_PARTNER', holder='LP JM e.K.', contact='JM e.K.'),
|
|
|
|
|
2000034=rel(anchor='LP JM GmbH', type='OPERATIONS_ALERT', holder='LP JM GmbH', contact='Herr Andrew Meyer-Operation, JM GmbH'),
|
|
|
|
|
2000035=rel(anchor='LP JM GmbH', type='OPERATIONS', holder='LP JM GmbH', contact='Herr Andrew Meyer-Operation, JM GmbH'),
|
|
|
|
|
2000036=rel(anchor='LP JM GmbH', type='VIP_CONTACT', holder='LP JM GmbH', contact='Herr Andrew Meyer-Operation, JM GmbH'),
|
|
|
|
|
2000037=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='operations-announce', holder='LP JM GmbH', contact='Herr Andrew Meyer-Operation, JM GmbH'),
|
|
|
|
|
2000038=rel(anchor='LP JM GmbH', type='REPRESENTATIVE', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract, JM GmbH'),
|
|
|
|
|
2000039=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='members-announce', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract, JM GmbH'),
|
|
|
|
|
2000040=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='customers-announce', holder='LP JM GmbH', contact='Herr Philip Meyer-Contract, JM GmbH'),
|
|
|
|
|
2000041=rel(anchor='LP JM GmbH', type='VIP_CONTACT', holder='LP JM GmbH', contact='Frau Tammy Meyer-VIP, JM GmbH'),
|
|
|
|
|
2000042=rel(anchor='?? Test PS', type='OPERATIONS_ALERT', holder='?? Test PS', contact='Petra Schmidt, Test PS'),
|
|
|
|
|
2000043=rel(anchor='?? Test PS', type='OPERATIONS', holder='?? Test PS', contact='Petra Schmidt, Test PS'),
|
|
|
|
|
2000044=rel(anchor='?? Test PS', type='REPRESENTATIVE', holder='?? Test PS', contact='Petra Schmidt, Test PS'),
|
|
|
|
|
2000045=rel(anchor='LP JM GmbH', type='SUBSCRIBER', mark='operations-announce', holder='NP Fanninga, Frauke', contact='Frau Frauke Fanninga'),
|
|
|
|
|
2000046=rel(anchor='NP Camus, Cecilia', type='OPERATIONS_ALERT', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus'),
|
|
|
|
|
2000047=rel(anchor='NP Camus, Cecilia', type='OPERATIONS', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus'),
|
|
|
|
|
2000048=rel(anchor='NP Camus, Cecilia', type='REPRESENTATIVE', holder='NP Camus, Cecilia', contact='Frau Cecilia Camus'),
|
|
|
|
|
2000049=rel(anchor='?? Wasserwerk Südholstein', type='REPRESENTATIVE', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg, Wasserwerk Südholstein'),
|
|
|
|
|
2000050=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='generalversammlung', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg, Wasserwerk Südholstein'),
|
|
|
|
|
2000051=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='members-announce', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg, Wasserwerk Südholstein'),
|
|
|
|
|
2000052=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='members-discussion', holder='?? Wasserwerk Südholstein', contact='Frau Christiane Milberg, Wasserwerk Südholstein'),
|
|
|
|
|
2000053=rel(anchor='?? Das Perfekte Haus', type='OPERATIONS_ALERT', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000054=rel(anchor='?? Das Perfekte Haus', type='OPERATIONS', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000055=rel(anchor='?? Das Perfekte Haus', type='REPRESENTATIVE', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000056=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='operations-discussion', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000057=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='operations-announce', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000058=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='generalversammlung', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000059=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='members-announce', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000060=rel(anchor='?? Das Perfekte Haus', type='SUBSCRIBER', mark='members-discussion', holder='?? Das Perfekte Haus', contact='Herr Richard Wiese, Das Perfekte Haus'),
|
|
|
|
|
2000061=rel(anchor='?? Wasserwerk Südholstein', type='OPERATIONS_ALERT', holder='?? Wasswerwerk Südholstein', contact='Herr Karim Metzger, Wasswerwerk Südholstein'),
|
|
|
|
|
2000062=rel(anchor='?? Wasserwerk Südholstein', type='OPERATIONS', holder='?? Wasswerwerk Südholstein', contact='Herr Karim Metzger, Wasswerwerk Südholstein'),
|
|
|
|
|
2000063=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='operations-discussion', holder='?? Wasswerwerk Südholstein', contact='Herr Karim Metzger, Wasswerwerk Südholstein'),
|
|
|
|
|
2000064=rel(anchor='?? Wasserwerk Südholstein', type='SUBSCRIBER', mark='operations-announce', holder='?? Wasswerwerk Südholstein', contact='Herr Karim Metzger, Wasswerwerk Südholstein'),
|
|
|
|
|
2000065=rel(anchor='?? Ragnar IT-Beratung', type='REPRESENTATIVE', holder='NP Richter, Ragnar', contact='Ragnar Richter'),
|
|
|
|
|
2000066=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='generalversammlung', holder='NP Richter, Ragnar', contact='Ragnar Richter'),
|
|
|
|
|
2000067=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='members-announce', holder='NP Richter, Ragnar', contact='Ragnar Richter'),
|
|
|
|
|
2000068=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='members-discussion', holder='NP Richter, Ragnar', contact='Ragnar Richter'),
|
|
|
|
|
2000069=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS_ALERT', holder='NP Henning, Eike', contact='Eike Henning'),
|
|
|
|
|
2000070=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS', holder='NP Henning, Eike', contact='Eike Henning'),
|
|
|
|
|
2000071=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-discussion', holder='NP Henning, Eike', contact='Eike Henning'),
|
|
|
|
|
2000072=rel(anchor='?? Ragnar IT-Beratung', type='SUBSCRIBER', mark='operations-announce', holder='NP Henning, Eike', contact='Eike Henning'),
|
|
|
|
|
2000073=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS_ALERT', holder='NP Henning, Jan', contact='Jan Henning'),
|
|
|
|
|
2000074=rel(anchor='?? Ragnar IT-Beratung', type='OPERATIONS', holder='NP Henning, Jan', contact='Jan Henning')
|
|
|
|
|
}
|
|
|
|
|
""");
|
|
|
|
|
}
|
|
|
|
@ -502,7 +515,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
// this happens if a natural person is marked as 'contractual' for itself
|
|
|
|
|
final var idsToRemove = new HashSet<Integer>();
|
|
|
|
|
relations.forEach((id, r) -> {
|
|
|
|
|
if (r.getHolder() == r.getAnchor()) {
|
|
|
|
|
if (r.getType() == HsOfficeRelationType.REPRESENTATIVE && r.getHolder() == r.getAnchor()) {
|
|
|
|
|
idsToRemove.add(id);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -670,7 +683,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
jpaAttempt.transacted(() -> {
|
|
|
|
|
context(rbacSuperuser);
|
|
|
|
|
coopShares.forEach(this::persist);
|
|
|
|
|
updateLegacyIds(coopShares, "hs_office.coopsharestransaction_legacy_id", "member_share_id");
|
|
|
|
|
updateLegacyIds(coopShares, "hs_office.coopsharetx_legacy_id", "member_share_id");
|
|
|
|
|
|
|
|
|
|
}).assertSuccessful();
|
|
|
|
|
|
|
|
|
@ -958,6 +971,9 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
|
|
|
|
|
HsOfficePersonEntity contactPerson = partnerPerson;
|
|
|
|
|
if (!StringUtils.equals(rec.getString("firma"), partnerPerson.getTradeName()) ||
|
|
|
|
|
partnerPerson.getPersonType() != determinePersonType(rec) ||
|
|
|
|
|
!StringUtils.equals(rec.getString("title"), partnerPerson.getTitle()) ||
|
|
|
|
|
!StringUtils.equals(rec.getString("salut"), partnerPerson.getSalutation()) ||
|
|
|
|
|
!StringUtils.equals(rec.getString("first_name"), partnerPerson.getGivenName()) ||
|
|
|
|
|
!StringUtils.equals(rec.getString("last_name"), partnerPerson.getFamilyName())) {
|
|
|
|
|
contactPerson = addPerson(HsOfficePersonEntity.builder().build(), rec);
|
|
|
|
@ -976,6 +992,10 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
debitor.getDebitorRel().setContact(contact);
|
|
|
|
|
}
|
|
|
|
|
if (containsRole(rec, "operation")) {
|
|
|
|
|
addRelation(HsOfficeRelationType.OPERATIONS_ALERT, partnerPerson, contactPerson, contact);
|
|
|
|
|
addRelation(HsOfficeRelationType.OPERATIONS, partnerPerson, contactPerson, contact);
|
|
|
|
|
}
|
|
|
|
|
if (containsRole(rec, "silent")) {
|
|
|
|
|
addRelation(HsOfficeRelationType.OPERATIONS, partnerPerson, contactPerson, contact);
|
|
|
|
|
}
|
|
|
|
|
if (containsRole(rec, "contractual")) {
|
|
|
|
@ -1053,34 +1073,60 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private HsOfficePersonEntity addPerson(final HsOfficePersonEntity person, final Record contactRecord) {
|
|
|
|
|
// TODO: title+salutation: add to person
|
|
|
|
|
person.setSalutation(contactRecord.getString("salut"));
|
|
|
|
|
person.setTitle(contactRecord.getString("title"));
|
|
|
|
|
person.setGivenName(contactRecord.getString("first_name"));
|
|
|
|
|
person.setFamilyName(contactRecord.getString("last_name"));
|
|
|
|
|
person.setTradeName(contactRecord.getString("firma"));
|
|
|
|
|
determinePersonType(person, contactRecord.getString("roles"));
|
|
|
|
|
person.setPersonType(determinePersonType(contactRecord));
|
|
|
|
|
|
|
|
|
|
persons.put(contactRecord.getInteger("contact_id"), person);
|
|
|
|
|
return person;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void determinePersonType(final HsOfficePersonEntity person, final String roles) {
|
|
|
|
|
if (person.getTradeName().isBlank()) {
|
|
|
|
|
person.setPersonType(HsOfficePersonType.NATURAL_PERSON);
|
|
|
|
|
private static HsOfficePersonType determinePersonType(final Record contactRecord) {
|
|
|
|
|
String roles = contactRecord.getString("roles");
|
|
|
|
|
String country = contactRecord.getString("country");
|
|
|
|
|
String familyName = contactRecord.getString("last_name");
|
|
|
|
|
String givenName = contactRecord.getString("first_name");
|
|
|
|
|
String tradeName = contactRecord.getString("firma");
|
|
|
|
|
|
|
|
|
|
if (PERSON_TYPES_BY_CONTACT.containsKey(contactRecord.getInteger("contact_id"))) {
|
|
|
|
|
return PERSON_TYPES_BY_CONTACT.get(contactRecord.getInteger("contact_id"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tradeName.isBlank() || tradeName.startsWith("verstorben")) {
|
|
|
|
|
return HsOfficePersonType.NATURAL_PERSON;
|
|
|
|
|
} else
|
|
|
|
|
// contractual && !partner with a firm and a natural person name
|
|
|
|
|
// should actually be split up into two persons
|
|
|
|
|
// but the legacy database consists such records
|
|
|
|
|
if (roles.contains("contractual") && !roles.contains("partner") &&
|
|
|
|
|
!person.getFamilyName().isBlank() && !person.getGivenName().isBlank()) {
|
|
|
|
|
person.setPersonType(HsOfficePersonType.NATURAL_PERSON);
|
|
|
|
|
} else if (endsWithWord(person.getTradeName(), "e.K.", "e.G.", "eG", "GmbH", "AG", "KG")) {
|
|
|
|
|
person.setPersonType(HsOfficePersonType.LEGAL_PERSON);
|
|
|
|
|
} else if (endsWithWord(person.getTradeName(), "OHG")) {
|
|
|
|
|
person.setPersonType(HsOfficePersonType.INCORPORATED_FIRM);
|
|
|
|
|
} else if (endsWithWord(person.getTradeName(), "GbR")) {
|
|
|
|
|
person.setPersonType(HsOfficePersonType.INCORPORATED_FIRM);
|
|
|
|
|
|
|
|
|
|
if (endsWithWord(tradeName, "OHG", "GbR", "KG", "UG", "PartGmbB", "mbB")) {
|
|
|
|
|
return HsOfficePersonType.INCORPORATED_FIRM; // Personengesellschaft. Gesellschafter haften persönlich.
|
|
|
|
|
} else if (containsWord(tradeName, "e.K.", "e.G.", "eG", "gGmbH", "GmbH", "mbH", "AG", "e.V.", "eV", "e.V")
|
|
|
|
|
|| tradeName.toLowerCase().contains("haftungsbeschränkt")
|
|
|
|
|
|| tradeName.toLowerCase().contains("stiftung")
|
|
|
|
|
|| tradeName.toLowerCase().contains("stichting")
|
|
|
|
|
|| tradeName.toLowerCase().contains("foundation")
|
|
|
|
|
|| tradeName.toLowerCase().contains("schule")
|
|
|
|
|
|| tradeName.toLowerCase().contains("verein")
|
|
|
|
|
|| tradeName.toLowerCase().contains("gewerkschaft")
|
|
|
|
|
|| tradeName.toLowerCase().contains("gesellschaft")
|
|
|
|
|
|| tradeName.toLowerCase().contains("kirche")
|
|
|
|
|
|| tradeName.toLowerCase().contains("fraktion")
|
|
|
|
|
|| tradeName.toLowerCase().contains("landkreis")
|
|
|
|
|
|| tradeName.toLowerCase().contains("behörde")
|
|
|
|
|
|| tradeName.toLowerCase().contains("bundesamt")
|
|
|
|
|
|| tradeName.toLowerCase().contains("bezirksamt")
|
|
|
|
|
) {
|
|
|
|
|
return HsOfficePersonType.LEGAL_PERSON; // Haftungsbeschränkt
|
|
|
|
|
} else if (roles.contains("contractual") && !roles.contains("partner") &&
|
|
|
|
|
!familyName.isBlank() && !givenName.isBlank()) {
|
|
|
|
|
// REPRESENTATIVES are always natural persons
|
|
|
|
|
return HsOfficePersonType.NATURAL_PERSON;
|
|
|
|
|
} else {
|
|
|
|
|
person.setPersonType(HsOfficePersonType.UNKNOWN_PERSON_TYPE);
|
|
|
|
|
return HsOfficePersonType.UNKNOWN_PERSON_TYPE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1094,6 +1140,19 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static boolean containsWord(final String value, final String... endings) {
|
|
|
|
|
final var lowerCaseValue = value.toLowerCase();
|
|
|
|
|
for (String ending : endings) {
|
|
|
|
|
if (lowerCaseValue.equals(ending.toLowerCase()) ||
|
|
|
|
|
lowerCaseValue.startsWith(ending.toLowerCase() + " ") ||
|
|
|
|
|
lowerCaseValue.contains(" " + ending.toLowerCase() + " ") ||
|
|
|
|
|
lowerCaseValue.endsWith(" " + ending.toLowerCase())) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void verifyContainsOnlyKnownRoles(final String roles) {
|
|
|
|
|
final var allowedRolesSet = stream(KNOWN_ROLES).collect(Collectors.toSet());
|
|
|
|
|
final var givenRolesSet = stream(roles.replace(" ", "").split(",")).collect(Collectors.toSet());
|
|
|
|
@ -1158,13 +1217,13 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
|
|
|
|
|
final String firm) {
|
|
|
|
|
final var result = new StringBuilder();
|
|
|
|
|
if (isNotBlank(salut))
|
|
|
|
|
result.append(salut + " ");
|
|
|
|
|
result.append((isBlank(result) ? "" : " ") + salut);
|
|
|
|
|
if (isNotBlank(title))
|
|
|
|
|
result.append(title + " ");
|
|
|
|
|
result.append((isBlank(result) ? "" : " ") + title);
|
|
|
|
|
if (isNotBlank(firstname))
|
|
|
|
|
result.append(firstname + " ");
|
|
|
|
|
result.append((isBlank(result) ? "" : " ") + firstname);
|
|
|
|
|
if (isNotBlank(lastname))
|
|
|
|
|
result.append(lastname + " ");
|
|
|
|
|
result.append((isBlank(result) ? "" : " ") + lastname);
|
|
|
|
|
if (isNotBlank(firm)) {
|
|
|
|
|
result.append((isBlank(result) ? "" : ", ") + firm);
|
|
|
|
|
}
|
|
|
|
|
-- TODO.impl: amend to debititorNumber and do not filter anymore to '00'