db-migration #10

Merged
hsh-michaelhoennig merged 74 commits from db-migration into master 2024-01-23 15:11:24 +01:00
2 changed files with 20 additions and 12 deletions
Showing only changes of commit 033a86f10d - Show all commits

View File

@ -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;
}
@ -184,8 +184,9 @@ 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'),
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')
}
""");
@ -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"));
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);

View File

@ -1,6 +1,6 @@
contact_id; bp_id; salut; first_name; last_name; title; firma; co; street; zipcode;city; country; phone_private; phone_office; phone_mobile; fax; email; roles
71; 7; Herr; Michael; Mellies; ; ; ; Kleine Freiheit 50; 26524; Hage; DE; ; +49 4931 123456; +49 1522 123456;; mih@example.org; contractual,billing,operation
101; 10; Frau; Jenny; Meyer; Dr.; JM e.K.;; Waldweg 5; 11001; Berlin; DE; +49 30 7777777; +49 30 1111111; ; +49 30 2222222; jm@example.org; billing
102; 10; Herr; Andrew; Meyer; ; JM e.K.;; Waldweg 5; 11001; Berlin; DE; +49 30 6666666; +49 30 3333333; ; +49 30 4444444; am@example.org; operation
102; 10; Herr; Philip; Meyer; ; JM e.K.;; Waldweg 5; 11001; Berlin; DE; +49 30 6666666; +49 30 5555555; ; +49 30 6666666; pm@example.org; contractual
101; 10; Frau; Jenny; Meyer; Dr.; JM e.K.;; Waldweg 5; 11001; Berlin; DE; +49 30 7777777; +49 30 1111111; ; +49 30 2222222; jm-billing@example.org; billing
102; 10; Herr; Andrew; Meyer; ; JM e.K.;; Waldweg 5; 11001; Berlin; DE; +49 30 6666666; +49 30 3333333; ; +49 30 4444444; am-operation@example.org; operation
103; 10; Herr; Philip; Meyer; ; JM e.K.;; Waldweg 5; 11001; Berlin; DE; +49 30 6666666; +49 30 5555555; ; +49 30 6666666; pm-contractual@example.org; contractual
121; 12; ; Petra; Schmidt; ; Test PS;; ; ; ; ; ; ; ; ; ps@example.com; billing,contractual,operation

1 contact_id bp_id salut first_name last_name title firma co street zipcode city country phone_private phone_office phone_mobile fax email roles
2 71 7 Herr Michael Mellies Kleine Freiheit 50 26524 Hage DE +49 4931 123456 +49 1522 123456 mih@example.org contractual,billing,operation
3 101 10 Frau Jenny Meyer Dr. JM e.K. Waldweg 5 11001 Berlin DE +49 30 7777777 +49 30 1111111 +49 30 2222222 jm-billing@example.org billing
4 102 10 Herr Andrew Meyer JM e.K. Waldweg 5 11001 Berlin DE +49 30 6666666 +49 30 3333333 +49 30 4444444 am-operation@example.org operation
5 103 10 Herr Philip Meyer JM e.K. Waldweg 5 11001 Berlin DE +49 30 6666666 +49 30 5555555 +49 30 6666666 pm-contractual@example.org contractual
6 121 12 Petra Schmidt Test PS ps@example.com billing,contractual,operation