db-migration #10

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

1
.gitignore vendored
View File

@ -137,3 +137,4 @@ Desktop.ini
# ESLint # ESLint
###################### ######################
.eslintcache .eslintcache
/.environment

View File

@ -0,0 +1,8 @@
```mermaid
flowchart TB
direction TB
Relationship-->Person
```

View File

@ -18,6 +18,7 @@ import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerDetailsEntity;
import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity; import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity;
import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity;
import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType;
import net.hostsharing.hsadminng.hs.office.relationship.HsOfficeRelationshipEntity;
import net.hostsharing.hsadminng.hs.office.sepamandate.HsOfficeSepaMandateEntity; import net.hostsharing.hsadminng.hs.office.sepamandate.HsOfficeSepaMandateEntity;
import net.hostsharing.test.JpaAttempt; import net.hostsharing.test.JpaAttempt;
import org.junit.jupiter.api.*; import org.junit.jupiter.api.*;
@ -89,7 +90,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* import-office-tables # comes from .aliases file * import-office-tables # comes from .aliases file
*/ */
@Disabled //@Disabled
@DataJpaTest(properties = { @DataJpaTest(properties = {
"spring.datasource.url=${HSADMINNG_POSTGRES_JDBC_URL:jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers}", "spring.datasource.url=${HSADMINNG_POSTGRES_JDBC_URL:jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers}",
"spring.datasource.username=${HSADMINNG_POSTGRES_ADMIN_USERNAME:admin}", "spring.datasource.username=${HSADMINNG_POSTGRES_ADMIN_USERNAME:admin}",
@ -110,6 +111,8 @@ public class ImportOfficeTables extends ContextBasedTest {
private static NavigableMap<Integer, HsOfficePartnerEntity> partners = new TreeMap<>(); private static NavigableMap<Integer, HsOfficePartnerEntity> partners = new TreeMap<>();
private static NavigableMap<Integer, HsOfficeDebitorEntity> debitors = new TreeMap<>(); private static NavigableMap<Integer, HsOfficeDebitorEntity> debitors = new TreeMap<>();
private static NavigableMap<Integer, HsOfficeMembershipEntity> memberships = new TreeMap<>(); private static NavigableMap<Integer, HsOfficeMembershipEntity> memberships = new TreeMap<>();
private static NavigableMap<Integer, HsOfficeRelationshipEntity> relationships = new TreeMap<>();
private static NavigableMap<Integer, HsOfficeSepaMandateEntity> sepaMandates = new TreeMap<>(); private static NavigableMap<Integer, HsOfficeSepaMandateEntity> sepaMandates = new TreeMap<>();
private static NavigableMap<Integer, HsOfficeBankAccountEntity> bankAccounts = new TreeMap<>(); private static NavigableMap<Integer, HsOfficeBankAccountEntity> bankAccounts = new TreeMap<>();
private static NavigableMap<Integer, HsOfficeCoopSharesTransactionEntity> coopShares = new TreeMap<>(); private static NavigableMap<Integer, HsOfficeCoopSharesTransactionEntity> coopShares = new TreeMap<>();
@ -127,12 +130,6 @@ public class ImportOfficeTables extends ContextBasedTest {
@MockBean @MockBean
HttpServletRequest request; HttpServletRequest request;
@Test
@Order(0)
void preconditions() {
assertThat(jdbcUrl).isEqualTo("jdbc:postgresql://localhost:5432/postgres");
}
@Test @Test
@Order(1) @Order(1)
void importBusinessPartners() { void importBusinessPartners() {
@ -492,7 +489,7 @@ public class ImportOfficeTables extends ContextBasedTest {
.debitorNumberSuffix((byte) 0) .debitorNumberSuffix((byte) 0)
.defaultPrefix(rec.getString("member_code").replace("hsh00-", "")) .defaultPrefix(rec.getString("member_code").replace("hsh00-", ""))
.partner(partner) .partner(partner)
.billingContact(partner.getContact()) // TODO falsch //.billingContact(partner.getContact()) // TODO falsch
.billable(rec.isEmpty("free")) .billable(rec.isEmpty("free"))
.vatReverseCharge(rec.getBoolean("exempt_vat")) .vatReverseCharge(rec.getBoolean("exempt_vat"))
.vatBusiness("GROSS".equals(rec.getString("indicator_vat"))) // TODO: remove .vatBusiness("GROSS".equals(rec.getString("indicator_vat"))) // TODO: remove