diff --git a/doc/hs-office-data-structure.md b/doc/hs-office-data-structure.md index 56467c5d..960e572b 100644 --- a/doc/hs-office-data-structure.md +++ b/doc/hs-office-data-structure.md @@ -66,7 +66,7 @@ classDiagram +Numeric partnerNumber: 12345 +Role partnerRole } - partner-MeierGmbH o-- role-MeierGmbH + partner-MeierGmbH *-- role-MeierGmbH class person-MeierGmbH { +personType: LEGAL diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java index 41e5710f..67e46c80 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java @@ -1,3 +1,4 @@ + package net.hostsharing.hsadminng.hs.office.coopassets; import lombok.*; @@ -14,6 +15,7 @@ import java.text.DecimalFormat; import java.time.LocalDate; import java.util.UUID; +import static java.util.Optional.ofNullable; import static net.hostsharing.hsadminng.stringify.Stringify.stringify; @Entity @@ -27,7 +29,7 @@ import static net.hostsharing.hsadminng.stringify.Stringify.stringify; public class HsOfficeCoopAssetsTransactionEntity implements Stringifyable, HasUuid { private static Stringify stringify = stringify(HsOfficeCoopAssetsTransactionEntity.class) - .withProp(e -> e.getMembership().getMemberNumberSuffix()) + .withProp(e -> ofNullable(e.getMembership()).map(HsOfficeMembershipEntity::getMemberNumberSuffix).orElse(null)) .withProp(HsOfficeCoopAssetsTransactionEntity::getValueDate) .withProp(HsOfficeCoopAssetsTransactionEntity::getTransactionType) .withProp(HsOfficeCoopAssetsTransactionEntity::getAssetValue) @@ -55,7 +57,7 @@ public class HsOfficeCoopAssetsTransactionEntity implements Stringifyable, HasUu private BigDecimal assetValue; @Column(name = "reference") - private String reference; + private String reference; // TODO: what is this for? @Column(name = "comment") private String comment; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java index bf52837f..ec54255e 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java @@ -51,7 +51,7 @@ public class HsOfficeCoopSharesTransactionEntity implements Stringifyable, HasUu private int shareCount; @Column(name = "reference") - private String reference; + private String reference; // TODO: what is this for? @Column(name = "comment") private String comment; diff --git a/src/main/resources/db/changelog/240-hs-office-bankaccount.sql b/src/main/resources/db/changelog/240-hs-office-bankaccount.sql index bf3ed342..427b0199 100644 --- a/src/main/resources/db/changelog/240-hs-office-bankaccount.sql +++ b/src/main/resources/db/changelog/240-hs-office-bankaccount.sql @@ -6,7 +6,7 @@ create table hs_office_bankaccount ( uuid uuid unique references RbacObject (uuid) initially deferred, - holder varchar(27) not null, + holder varchar(64) not null, iban varchar(34) not null, bic varchar(11) not null ); diff --git a/src/main/resources/db/changelog/320-hs-office-coopassets.sql b/src/main/resources/db/changelog/320-hs-office-coopassets.sql index db76d95b..9a712f3a 100644 --- a/src/main/resources/db/changelog/320-hs-office-coopassets.sql +++ b/src/main/resources/db/changelog/320-hs-office-coopassets.sql @@ -10,7 +10,8 @@ CREATE TYPE HsOfficeCoopAssetsTransactionType AS ENUM ('ADJUSTMENT', 'TRANSFER', 'ADOPTION', 'CLEARING', - 'LOSS'); + 'LOSS', + 'LIMITATION'); CREATE CAST (character varying as HsOfficeCoopAssetsTransactionType) WITH INOUT AS IMPLICIT;