separately import contact as billing or contractual contact
This commit is contained in:
parent
09ee0ae63d
commit
5fb21c7b66
@ -170,7 +170,7 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if ( !"admin".equals(System.getenv("ADMIN_USER") )) {
|
||||
if ( !"admin".equals(System.getenv("HSADMINNG_POSTGRES_ADMIN_USERNAME") )) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -183,11 +183,12 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
""");
|
||||
assertThat(contacts.toString()).isEqualToIgnoringWhitespace("""
|
||||
{
|
||||
71=contact(label='Herr Michael Mellies ', emailAddresses='mih@example.org'),
|
||||
101=contact(label='Frau Dr. Jenny Meyer , JM e.K.', emailAddresses='jm@example.org'),
|
||||
102=contact(label='Herr Andrew Meyer , JM e.K.', emailAddresses='am@example.org'),
|
||||
121=contact(label='Petra Schmidt , Test PS', emailAddresses='ps@example.com')
|
||||
}
|
||||
71=contact(label='Herr Michael Mellies ', emailAddresses='mih@example.org'),
|
||||
101=contact(label='Frau Dr. Jenny Meyer , JM e.K.', emailAddresses='jm-billing@example.org'),
|
||||
102=contact(label='Herr Andrew Meyer , JM e.K.', emailAddresses='am-operation@example.org'),
|
||||
103=contact(label='Herr Philip Meyer , JM e.K.', emailAddresses='pm-contractual@example.org'),
|
||||
121=contact(label='Petra Schmidt , Test PS', emailAddresses='ps@example.com')
|
||||
}
|
||||
""");
|
||||
assertThat(persons.toString()).isEqualToIgnoringWhitespace("""
|
||||
{
|
||||
@ -223,7 +224,7 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if ( !"admin".equals(System.getenv("ADMIN_USER") )) {
|
||||
if ( !"admin".equals(System.getenv("HSADMINNG_POSTGRES_ADMIN_USERNAME") )) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -252,7 +253,7 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if ( !"admin".equals(System.getenv("ADMIN_USER") )) {
|
||||
if ( !"admin".equals(System.getenv("HSADMINNG_POSTGRES_ADMIN_USERNAME") )) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -619,6 +620,7 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
if (isNotBlank(rec.getString("roles")) && rec.getString("roles").contains("billing")) {
|
||||
|
||||
final var partner = partners.get(rec.getInteger("bp_id"));
|
||||
final var debitor = debitors.get(rec.getInteger("bp_id"));
|
||||
|
||||
final var person = partner.getPerson();
|
||||
person.setTradeName(rec.getString("firma"));
|
||||
@ -626,7 +628,13 @@ public class ImportOfficeTables extends ContextBasedTest {
|
||||
person.setGivenName(rec.getString("first_name"));
|
||||
person.setFamilyName(rec.getString("last_name"));
|
||||
|
||||
initContact(partner.getContact(), rec);
|
||||
if (rec.getString("roles").contains("contractual")) {
|
||||
initContact(partner.getContact(), rec);
|
||||
} else if (rec.getString("roles").contains("billing")) {
|
||||
initContact(debitor.getBillingContact(), rec);
|
||||
} else if (rec.getString("roles").contains("operation")) {
|
||||
// TODO: technical contact initContact(debitor.getBillingContact(), rec);
|
||||
}
|
||||
|
||||
} else {
|
||||
initContact(new HsOfficeContactEntity(), rec);
|
||||
|
Loading…
Reference in New Issue
Block a user