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 a13354e4..f6a05bc4 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 @@ -60,7 +60,7 @@ public class HsOfficeCoopSharesTransactionEntity implements Stringifyable, HasUu private int shareCount; /** - * The ooking reference. + * The Booking reference. */ @Column(name = "reference") private String reference; diff --git a/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql b/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql index 97079877..5757efc9 100644 --- a/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql +++ b/src/main/resources/db/changelog/223-hs-office-partner-rbac.sql @@ -179,7 +179,6 @@ call generateRbacIdentityView('hs_office_partner', $idName$ call generateRbacRestrictedView('hs_office_partner', '(select idName from hs_office_person_iv p where p.uuid = target.personUuid)', $updates$ - partnerNumber = new.partnerNumber, personUuid = new.personUuid, contactUuid = new.contactUuid $updates$); diff --git a/src/main/resources/db/changelog/300-hs-office-membership.sql b/src/main/resources/db/changelog/300-hs-office-membership.sql index 01e644cd..acc0651a 100644 --- a/src/main/resources/db/changelog/300-hs-office-membership.sql +++ b/src/main/resources/db/changelog/300-hs-office-membership.sql @@ -17,7 +17,9 @@ create table if not exists hs_office_membership memberNumberSuffix::text ~ '^[0-9][0-9]$'), validity daterange not null, reasonForTermination HsOfficeReasonForTermination not null default 'NONE', - membershipFeeBillable boolean not null default true + membershipFeeBillable boolean not null default true, + + UNIQUE(partnerUuid, memberNumberSuffix) ); --// diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java index 4c17f8e1..b5dfa429 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java @@ -72,7 +72,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberSuffix() { + void globalAdmin_canFindCoopAssetsTransactionsByMemberNumber() { context.define("superuser-alex@hostsharing.net"); final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202); @@ -114,7 +114,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberSuffixAndDateRange() { + void globalAdmin_canFindCoopAssetsTransactionsByMembershipUuidAndDateRange() { context.define("superuser-alex@hostsharing.net"); final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java index 58469681..787fe467 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionControllerAcceptanceTest.java @@ -72,7 +72,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopSharesTransactionsByMemberNumberSuffix() { + void globalAdmin_canFindCoopSharesTransactionsByMemberNumber() { context.define("superuser-alex@hostsharing.net"); final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202); @@ -106,13 +106,14 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopSharesTransactionsByMemberNumberSuffixAndDateRange() { + void globalAdmin_canFindCoopSharesTransactionsByMembershipUuidAndDateRange() { context.define("superuser-alex@hostsharing.net"); final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202); RestAssured // @formatter:off - .given().header("current-user", "superuser-alex@hostsharing.net").port(port).when().get("http://localhost/api/hs/office/coopsharestransactions?membershipUuid=" + givenMembership.getUuid() + "&fromValueDate=2020-01-01&toValueDate=2021-12-31").then().log().all().assertThat().statusCode(200).contentType("application/json").body("", lenientlyEquals(""" + .given().header("current-user", "superuser-alex@hostsharing.net").port(port).when() + .get("http://localhost/api/hs/office/coopsharestransactions?membershipUuid=" + givenMembership.getUuid() + "&fromValueDate=2020-01-01&toValueDate=2021-12-31").then().log().all().assertThat().statusCode(200).contentType("application/json").body("", lenientlyEquals(""" [ { "transactionType": "CANCELLATION", diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java index d6384e21..01ea5777 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorEntityPatcherUnitTest.java @@ -104,12 +104,6 @@ class HsOfficeDebitorEntityPatcherUnitTest extends PatchUnitTestBase< HsOfficeDebitorEntity::setBillingContact, newBillingContact(PATCHED_CONTACT_UUID)) .notNullable(), - new SimpleProperty<>( - "personType", - HsOfficeDebitorPatchResource::setBillable, - PATCHED_BILLABLE, - HsOfficeDebitorEntity::setBillable) - .notNullable(), new SimpleProperty<>( "billable", HsOfficeDebitorPatchResource::setBillable, diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java index 632e8690..af62541c 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepositoryIntegrationTest.java @@ -77,7 +77,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { // when final var result = attempt(em, () -> { final var newMembership = toCleanup(HsOfficeMembershipEntity.builder() - .memberNumberSuffix("01") + .memberNumberSuffix("11") .partner(givenPartner) .mainDebitor(givenDebitor) .validity(Range.closedInfinite(LocalDate.parse("2020-01-01"))) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java index 772bb640..f764163d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepositoryIntegrationTest.java @@ -226,7 +226,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest { assertThat(result) .isNotNull() .extracting(Object::toString) - .isEqualTo("partner(LEGAL First GmbH: first contact)"); + .isEqualTo("partner(LP First GmbH: first contact)"); } } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityUnitTest.java index f1246561..45049ef8 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntityUnitTest.java @@ -10,11 +10,11 @@ import static org.junit.jupiter.api.Assertions.*; class HsOfficeRelationshipEntityUnitTest { private HsOfficePersonEntity anchor = HsOfficePersonEntity.builder() - .personType(HsOfficePersonType.LEGAL) + .personType(HsOfficePersonType.LEGAL_PERSON) .tradeName("some trade name") .build(); private HsOfficePersonEntity holder = HsOfficePersonEntity.builder() - .personType(HsOfficePersonType.NATURAL) + .personType(HsOfficePersonType.NATURAL_PERSON) .familyName("Meier") .givenName("Mellie") .build(); @@ -27,6 +27,6 @@ class HsOfficeRelationshipEntityUnitTest { .relHolder(holder) .build(); - assertThat(given.toShortString()).isEqualTo("rel(relAnchor='LEGAL some trade name', relType='REPRESENTATIVE', relHolder='NATURAL Meier, Mellie')"); + assertThat(given.toShortString()).isEqualTo("rel(relAnchor='LP some trade name', relType='REPRESENTATIVE', relHolder='NP Meier, Mellie')"); } }