From 3c89164a67b2fc1bbb834bb33033f433bb765329 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 22 Jan 2024 13:15:20 +0100 Subject: [PATCH] rename membernumber -> membernumbersuffix --- .../HsOfficeCoopAssetsTransactionEntity.java | 4 +-- ...OfficeCoopAssetsTransactionRepository.java | 2 +- .../HsOfficeCoopSharesTransactionEntity.java | 4 +-- ...OfficeCoopSharesTransactionRepository.java | 2 +- .../HsOfficeMembershipController.java | 4 +-- .../membership/HsOfficeMembershipEntity.java | 8 ++--- .../HsOfficeMembershipRepository.java | 6 ++-- .../hs-office-membership-schemas.yaml | 4 +-- .../hs-office/hs-office-memberships.yaml | 2 +- .../db/changelog/300-hs-office-membership.sql | 2 +- .../303-hs-office-membership-rbac.sql | 4 +-- .../308-hs-office-membership-test-data.sql | 8 ++--- .../318-hs-office-coopshares-test-data.sql | 2 +- .../328-hs-office-coopassets-test-data.sql | 2 +- ...tsTransactionControllerAcceptanceTest.java | 12 +++---- ...ceCoopAssetsTransactionEntityUnitTest.java | 2 +- ...sTransactionRepositoryIntegrationTest.java | 8 ++--- ...esTransactionControllerAcceptanceTest.java | 12 +++---- ...ceCoopSharesTransactionEntityUnitTest.java | 2 +- ...sTransactionRepositoryIntegrationTest.java | 8 ++--- ...iceMembershipControllerAcceptanceTest.java | 34 +++++++++---------- .../HsOfficeMembershipControllerRestTest.java | 8 ++--- .../HsOfficeMembershipEntityUnitTest.java | 4 +-- ...ceMembershipRepositoryIntegrationTest.java | 16 ++++----- .../office/membership/TestHsMembership.java | 2 +- .../hs/office/migration/ImportOfficeData.java | 2 +- 26 files changed, 82 insertions(+), 82 deletions(-) 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 ffc60bd1..41e5710f 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 @@ -27,7 +27,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().getMemberNumber()) + .withProp(e -> e.getMembership().getMemberNumberSuffix()) .withProp(HsOfficeCoopAssetsTransactionEntity::getValueDate) .withProp(HsOfficeCoopAssetsTransactionEntity::getTransactionType) .withProp(HsOfficeCoopAssetsTransactionEntity::getAssetValue) @@ -67,6 +67,6 @@ public class HsOfficeCoopAssetsTransactionEntity implements Stringifyable, HasUu @Override public String toShortString() { - return membership.getMemberNumber() + new DecimalFormat("+0.00").format(assetValue); + return membership.getMemberNumberSuffix() + new DecimalFormat("+0.00").format(assetValue); } } diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java index 256933b9..c606f476 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java @@ -17,7 +17,7 @@ public interface HsOfficeCoopAssetsTransactionRepository extends Repository= :fromValueDate)) AND ( CAST(:toValueDate AS java.time.LocalDate)IS NULL OR (at.valueDate <= :toValueDate)) - ORDER BY at.membership.memberNumber, at.valueDate + ORDER BY at.membership.memberNumberSuffix, at.valueDate """) List findCoopAssetsTransactionByOptionalMembershipUuidAndDateRange( UUID membershipUuid, LocalDate fromValueDate, LocalDate toValueDate); 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 a9fd4bde..bf52837f 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 @@ -24,7 +24,7 @@ import static net.hostsharing.hsadminng.stringify.Stringify.stringify; public class HsOfficeCoopSharesTransactionEntity implements Stringifyable, HasUuid { private static Stringify stringify = stringify(HsOfficeCoopSharesTransactionEntity.class) - .withProp(e -> e.getMembership().getMemberNumber()) + .withProp(e -> e.getMembership().getMemberNumberSuffix()) .withProp(HsOfficeCoopSharesTransactionEntity::getValueDate) .withProp(HsOfficeCoopSharesTransactionEntity::getTransactionType) .withProp(HsOfficeCoopSharesTransactionEntity::getShareCount) @@ -63,6 +63,6 @@ public class HsOfficeCoopSharesTransactionEntity implements Stringifyable, HasUu @Override public String toShortString() { - return "%s%+d".formatted(membership.getMemberNumber(), shareCount); + return "%s%+d".formatted(membership.getMemberNumberSuffix(), shareCount); } } diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepository.java index 2e52b828..5c3e0af6 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepository.java @@ -17,7 +17,7 @@ public interface HsOfficeCoopSharesTransactionRepository extends Repository= :fromValueDate)) AND ( CAST(:toValueDate AS java.time.LocalDate)IS NULL OR (st.valueDate <= :toValueDate)) - ORDER BY st.membership.memberNumber, st.valueDate + ORDER BY st.membership.memberNumberSuffix, st.valueDate """) List findCoopSharesTransactionByOptionalMembershipUuidAndDateRange( UUID membershipUuid, LocalDate fromValueDate, LocalDate toValueDate); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java index 3553f616..b46b02a8 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipController.java @@ -41,11 +41,11 @@ public class HsOfficeMembershipController implements HsOfficeMembershipsApi { final String currentUser, final String assumedRoles, UUID partnerUuid, - Integer memberNumber) { + Integer memberNumberSuffix) { context.define(currentUser, assumedRoles); final var entities = - membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(partnerUuid, memberNumber); + membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(partnerUuid, memberNumberSuffix); final var resources = mapper.mapList(entities, HsOfficeMembershipResource.class, SEPA_MANDATE_ENTITY_TO_RESOURCE_POSTMAPPER); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java index b5846324..5991a9ac 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java @@ -31,7 +31,7 @@ import static net.hostsharing.hsadminng.stringify.Stringify.stringify; public class HsOfficeMembershipEntity implements HasUuid, Stringifyable { private static Stringify stringify = stringify(HsOfficeMembershipEntity.class) - .withProp(HsOfficeMembershipEntity::getMemberNumber) + .withProp(HsOfficeMembershipEntity::getMemberNumberSuffix) .withProp(e -> e.getPartner().toShortString()) .withProp(e -> e.getMainDebitor().toShortString()) .withProp(e -> e.getValidity().asString()) @@ -52,8 +52,8 @@ public class HsOfficeMembershipEntity implements HasUuid, Stringifyable { @JoinColumn(name = "maindebitoruuid") private HsOfficeDebitorEntity mainDebitor; - @Column(name = "membernumber") - private int memberNumber; // TODO: migrate to suffix, like debitorNumberSuffix + @Column(name = "membernumbersuffix") + private int memberNumberSuffix; @Column(name = "validity", columnDefinition = "daterange") @Type(PostgreSQLRangeType.class) @@ -98,7 +98,7 @@ public class HsOfficeMembershipEntity implements HasUuid, Stringifyable { @Override public String toShortString() { - return String.valueOf(memberNumber); + return String.valueOf(memberNumberSuffix); } @PrePersist diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepository.java index 972c00ce..1bee3f73 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipRepository.java @@ -13,12 +13,12 @@ public interface HsOfficeMembershipRepository extends Repository findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(UUID partnerUuid, Integer memberNumber); + List findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(UUID partnerUuid, Integer memberNumberSuffix); HsOfficeMembershipEntity save(final HsOfficeMembershipEntity entity); diff --git a/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml index 74c8143b..855988b0 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml @@ -23,7 +23,7 @@ components: $ref: './hs-office-partner-schemas.yaml#/components/schemas/HsOfficePartner' mainDebitor: $ref: './hs-office-debitor-schemas.yaml#/components/schemas/HsOfficeDebitor' - memberNumber: + memberNumberSuffix: type: integer validFrom: type: string @@ -66,7 +66,7 @@ components: type: string format: uuid nullable: false - memberNumber: + memberNumberSuffix: type: integer nullable: false validFrom: diff --git a/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml b/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml index d4d60158..c18ba861 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml @@ -14,7 +14,7 @@ get: type: string format: uuid description: UUID of the business partner. - - name: memberNumber + - name: memberNumberSuffix in: query required: false schema: 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 12f2dd34..750fd680 100644 --- a/src/main/resources/db/changelog/300-hs-office-membership.sql +++ b/src/main/resources/db/changelog/300-hs-office-membership.sql @@ -13,7 +13,7 @@ create table if not exists hs_office_membership uuid uuid unique references RbacObject (uuid) initially deferred, partnerUuid uuid not null references hs_office_partner(uuid), mainDebitorUuid uuid not null references hs_office_debitor(uuid), - memberNumber numeric(5) not null unique, + memberNumberSuffix numeric(5) not null unique, validity daterange not null, reasonForTermination HsOfficeReasonForTermination not null default 'NONE', membershipFeeBillable boolean not null default true diff --git a/src/main/resources/db/changelog/303-hs-office-membership-rbac.sql b/src/main/resources/db/changelog/303-hs-office-membership-rbac.sql index 972021e7..cc7deb48 100644 --- a/src/main/resources/db/changelog/303-hs-office-membership-rbac.sql +++ b/src/main/resources/db/changelog/303-hs-office-membership-rbac.sql @@ -92,7 +92,7 @@ execute procedure hsOfficeMembershipRbacRolesTrigger(); --changeset hs-office-membership-rbac-IDENTITY-VIEW:1 endDelimiter:--// -- ---------------------------------------------------------------------------- call generateRbacIdentityView('hs_office_membership', idNameExpression => $idName$ - target.memberNumber || + target.memberNumberSuffix || ':' || (select split_part(idName, ':', 2) from hs_office_partner_iv p where p.uuid = target.partnerUuid) $idName$); --// @@ -102,7 +102,7 @@ call generateRbacIdentityView('hs_office_membership', idNameExpression => $idNam --changeset hs-office-membership-rbac-RESTRICTED-VIEW:1 endDelimiter:--// -- ---------------------------------------------------------------------------- call generateRbacRestrictedView('hs_office_membership', - orderby => 'target.memberNumber', + orderby => 'target.memberNumberSuffix', columnUpdates => $updates$ validity = new.validity, reasonForTermination = new.reasonForTermination, diff --git a/src/main/resources/db/changelog/308-hs-office-membership-test-data.sql b/src/main/resources/db/changelog/308-hs-office-membership-test-data.sql index 5a4adaa6..6d182650 100644 --- a/src/main/resources/db/changelog/308-hs-office-membership-test-data.sql +++ b/src/main/resources/db/changelog/308-hs-office-membership-test-data.sql @@ -15,7 +15,7 @@ declare idName varchar; relatedPartner hs_office_partner; relatedDebitor hs_office_debitor; - newMemberNumber numeric; + newMemberNumberSuffix numeric; begin idName := cleanIdentifier( forPartnerTradeName || '#' || forMainDebitorNumber); currentTask := 'creating Membership test-data ' || idName; @@ -26,14 +26,14 @@ begin join hs_office_person person on person.uuid = partner.personUuid where person.tradeName = forPartnerTradeName into relatedPartner; select d.* from hs_office_debitor d where d.debitorNumberSuffix = forMainDebitorNumber into relatedDebitor; - select coalesce(max(memberNumber)+1, 10001) from hs_office_membership into newMemberNumber; + select coalesce(max(memberNumberSuffix)+1, 10001) from hs_office_membership into newMemberNumberSuffix; raise notice 'creating test Membership: %', idName; raise notice '- using partner (%): %', relatedPartner.uuid, relatedPartner; raise notice '- using debitor (%): %', relatedDebitor.uuid, relatedDebitor; insert - into hs_office_membership (uuid, partneruuid, maindebitoruuid, membernumber, validity, reasonfortermination) - values (uuid_generate_v4(), relatedPartner.uuid, relatedDebitor.uuid, newMemberNumber, daterange('20221001' , null, '[]'), 'NONE'); + into hs_office_membership (uuid, partneruuid, maindebitoruuid, memberNumberSuffix, validity, reasonfortermination) + values (uuid_generate_v4(), relatedPartner.uuid, relatedDebitor.uuid, newMemberNumberSuffix, daterange('20221001' , null, '[]'), 'NONE'); end; $$; --// diff --git a/src/main/resources/db/changelog/318-hs-office-coopshares-test-data.sql b/src/main/resources/db/changelog/318-hs-office-coopshares-test-data.sql index c9252568..987f0aba 100644 --- a/src/main/resources/db/changelog/318-hs-office-coopshares-test-data.sql +++ b/src/main/resources/db/changelog/318-hs-office-coopshares-test-data.sql @@ -18,7 +18,7 @@ begin execute format('set local hsadminng.currentTask to %L', currentTask); call defineContext(currentTask); - select m.uuid from hs_office_membership m where m.memberNumber = givenMembershipNumber into membership; + select m.uuid from hs_office_membership m where m.memberNumberSuffix = givenMembershipNumber into membership; raise notice 'creating test coopSharesTransaction: %', givenMembershipNumber; insert diff --git a/src/main/resources/db/changelog/328-hs-office-coopassets-test-data.sql b/src/main/resources/db/changelog/328-hs-office-coopassets-test-data.sql index 8259a7e3..4589ceb6 100644 --- a/src/main/resources/db/changelog/328-hs-office-coopassets-test-data.sql +++ b/src/main/resources/db/changelog/328-hs-office-coopassets-test-data.sql @@ -18,7 +18,7 @@ begin execute format('set local hsadminng.currentTask to %L', currentTask); call defineContext(currentTask); - select m.uuid from hs_office_membership m where m.memberNumber = givenMembershipNumber into membership; + select m.uuid from hs_office_membership m where m.memberNumberSuffix = givenMembershipNumber into membership; raise notice 'creating test coopAssetsTransaction: %', givenMembershipNumber; insert 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 292a947c..edf0eed3 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,10 +72,10 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopAssetsTransactionsByMemberNumber() { + void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberSuffix() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002) .get(0); RestAssured // @formatter:off @@ -115,10 +115,10 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberAndDateRange() { + void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberSuffixAndDateRange() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002) .get(0); RestAssured // @formatter:off @@ -153,7 +153,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest { void globalAdmin_canAddCoopAssetsTransaction() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10001) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10001) .get(0); final var location = RestAssured // @formatter:off @@ -199,7 +199,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest { void globalAdmin_canNotCancelMoreAssetsThanCurrentlySubscribed() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10001) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10001) .get(0); final var location = RestAssured // @formatter:off diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java index 7be6ec0b..6371c816 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java @@ -26,7 +26,7 @@ class HsOfficeCoopAssetsTransactionEntityUnitTest { } @Test - void toShortStringContainsOnlyMemberNumberAndSharesCountOnly() { + void toShortStringContainsOnlyMemberNumberSuffixAndSharesCountOnly() { final var result = givenCoopAssetTransaction.toShortString(); assertThat(result).isEqualTo("300001+128.00"); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepositoryIntegrationTest.java index 851ccb69..bf9cc649 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepositoryIntegrationTest.java @@ -62,7 +62,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase // given context("superuser-alex@hostsharing.net"); final var count = coopAssetsTransactionRepo.count(); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10001) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10001) .get(0); // when @@ -96,7 +96,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase // when attempt(em, () -> { - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber( + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix( null, 10001).get(0); final var newCoopAssetsTransaction = HsOfficeCoopAssetsTransactionEntity.builder() @@ -161,7 +161,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase public void globalAdmin_canViewCoopAssetsTransactions_filteredByMembershipUuid() { // given context("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002) .get(0); // when @@ -182,7 +182,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase public void globalAdmin_canViewCoopAssetsTransactions_filteredByMembershipUuidAndValueDateRange() { // given context("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002) .get(0); // when 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 f3c6cc33..cd4aaffa 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,10 +72,10 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopSharesTransactionsByMemberNumber() { + void globalAdmin_canFindCoopSharesTransactionsByMemberNumberSuffix() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002).get(0); + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002).get(0); RestAssured // @formatter:off .given().header("current-user", "superuser-alex@hostsharing.net").port(port).when().get("http://localhost/api/hs/office/coopsharestransactions?membershipUuid=" + givenMembership.getUuid()).then().log().all().assertThat().statusCode(200).contentType("application/json").body("", lenientlyEquals(""" @@ -106,10 +106,10 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest { } @Test - void globalAdmin_canFindCoopSharesTransactionsByMemberNumberAndDateRange() { + void globalAdmin_canFindCoopSharesTransactionsByMemberNumberSuffixAndDateRange() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002).get(0); + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002).get(0); 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(""" @@ -134,7 +134,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest { void globalAdmin_canAddCoopSharesTransaction() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10001).get(0); + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10001).get(0); final var location = RestAssured // @formatter:off .given().header("current-user", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body(""" @@ -165,7 +165,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest { void globalAdmin_canNotCancelMoreSharesThanCurrentlySubscribed() { context.define("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10001).get(0); + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10001).get(0); final var location = RestAssured // @formatter:off .given().header("current-user", "superuser-alex@hostsharing.net").contentType(ContentType.JSON).body(""" diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java index fc0df074..48dbd672 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java @@ -25,7 +25,7 @@ class HsOfficeCoopSharesTransactionEntityUnitTest { } @Test - void toShortStringContainsOnlyMemberNumberAndshareCountOnly() { + void toShortStringContainsOnlyMemberNumberSuffixAndshareCountOnly() { final var result = givenCoopSharesTransaction.toShortString(); assertThat(result).isEqualTo("300001+4"); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepositoryIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepositoryIntegrationTest.java index 8dee222f..8b0c607e 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepositoryIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionRepositoryIntegrationTest.java @@ -61,7 +61,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase // given context("superuser-alex@hostsharing.net"); final var count = coopSharesTransactionRepo.count(); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10001) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10001) .get(0); // when @@ -95,7 +95,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase // when attempt(em, () -> { - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber( + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix( null, 10001).get(0); final var newCoopSharesTransaction = HsOfficeCoopSharesTransactionEntity.builder() @@ -160,7 +160,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase public void globalAdmin_canViewCoopSharesTransactions_filteredByMembershipUuid() { // given context("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002) .get(0); // when @@ -181,7 +181,7 @@ class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBase public void globalAdmin_canViewCoopSharesTransactions_filteredByMembershipUuidAndValueDateRange() { // given context("superuser-alex@hostsharing.net"); - final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002) + final var givenMembership = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002) .get(0); // when diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java index 6d394b53..1f83ae07 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerAcceptanceTest.java @@ -61,7 +61,7 @@ class HsOfficeMembershipControllerAcceptanceTest { @PersistenceContext EntityManager em; - private static int tempMemberNumber = 20010; + private static int tempMemberNumberSuffix = 20010; @Nested @Accepts({ "Membership:F(Find)" }) @@ -84,7 +84,7 @@ class HsOfficeMembershipControllerAcceptanceTest { { "partner": { "person": { "tradeName": "First GmbH" } }, "mainDebitor": { "debitorNumber": 1000111 }, - "memberNumber": 10001, + "memberNumberSuffix": 10001, "validFrom": "2022-10-01", "validTo": null, "reasonForTermination": "NONE" @@ -92,7 +92,7 @@ class HsOfficeMembershipControllerAcceptanceTest { { "partner": { "person": { "tradeName": "Second e.K." } }, "mainDebitor": { "debitorNumber": 1000212 }, - "memberNumber": 10002, + "memberNumberSuffix": 10002, "validFrom": "2022-10-01", "validTo": null, "reasonForTermination": "NONE" @@ -100,7 +100,7 @@ class HsOfficeMembershipControllerAcceptanceTest { { "partner": { "person": { "tradeName": "Third OHG" } }, "mainDebitor": { "debitorNumber": 1000313 }, - "memberNumber": 10003, + "memberNumberSuffix": 10003, "validFrom": "2022-10-01", "validTo": null, "reasonForTermination": "NONE" @@ -130,7 +130,7 @@ class HsOfficeMembershipControllerAcceptanceTest { { "partnerUuid": "%s", "mainDebitorUuid": "%s", - "memberNumber": 20001, + "memberNumberSuffix": 20001, "validFrom": "2022-10-13", "membershipFeeBillable": "true" } @@ -145,7 +145,7 @@ class HsOfficeMembershipControllerAcceptanceTest { .body("mainDebitor.debitorNumber", is(givenDebitor.getDebitorNumber())) .body("mainDebitor.debitorNumberSuffix", is((int) givenDebitor.getDebitorNumberSuffix())) .body("partner.person.tradeName", is("Third OHG")) - .body("memberNumber", is(20001)) + .body("memberNumberSuffix", is(20001)) .body("validFrom", is("2022-10-13")) .body("validTo", equalTo(null)) .header("Location", startsWith("http://localhost")) @@ -166,7 +166,7 @@ class HsOfficeMembershipControllerAcceptanceTest { @Test void globalAdmin_canGetArbitraryMembership() { context.define("superuser-alex@hostsharing.net"); - final var givenMembershipUuid = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber( + final var givenMembershipUuid = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix( null, 10001) .get(0) @@ -185,7 +185,7 @@ class HsOfficeMembershipControllerAcceptanceTest { { "partner": { "person": { "tradeName": "First GmbH" } }, "mainDebitor": { "debitorNumber": 1000111 }, - "memberNumber": 10001, + "memberNumberSuffix": 10001, "validFrom": "2022-10-01", "validTo": null, "reasonForTermination": "NONE" @@ -197,7 +197,7 @@ class HsOfficeMembershipControllerAcceptanceTest { @Accepts({ "Membership:X(Access Control)" }) void normalUser_canNotGetUnrelatedMembership() { context.define("superuser-alex@hostsharing.net"); - final var givenMembershipUuid = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber( + final var givenMembershipUuid = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix( null, 10001) .get(0) @@ -217,7 +217,7 @@ class HsOfficeMembershipControllerAcceptanceTest { @Accepts({ "Membership:X(Access Control)" }) void debitorAgentUser_canGetRelatedMembership() { context.define("superuser-alex@hostsharing.net"); - final var givenMembershipUuid = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber( + final var givenMembershipUuid = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix( null, 10003) .get(0) @@ -240,7 +240,7 @@ class HsOfficeMembershipControllerAcceptanceTest { "debitorNumber": 1000313, "billingContact": { "label": "third contact" } }, - "memberNumber": 10003, + "memberNumberSuffix": 10003, "validFrom": "2022-10-01", "validTo": null, "reasonForTermination": "NONE" @@ -279,7 +279,7 @@ class HsOfficeMembershipControllerAcceptanceTest { .body("partner.person.tradeName", is(givenMembership.getPartner().getPerson().getTradeName())) .body("mainDebitor.debitorNumber", is(givenMembership.getMainDebitor().getDebitorNumber())) .body("mainDebitor.debitorNumberSuffix", is((int) givenMembership.getMainDebitor().getDebitorNumberSuffix())) - .body("memberNumber", is(givenMembership.getMemberNumber())) + .body("memberNumberSuffix", is(givenMembership.getMemberNumberSuffix())) .body("validFrom", is("2022-11-01")) .body("validTo", is("2023-12-31")) .body("reasonForTermination", is("CANCELLATION")); @@ -290,7 +290,7 @@ class HsOfficeMembershipControllerAcceptanceTest { .matches(mandate -> { assertThat(mandate.getPartner().toShortString()).isEqualTo("LEGAL First GmbH"); assertThat(mandate.getMainDebitor().toString()).isEqualTo(givenMembership.getMainDebitor().toString()); - assertThat(mandate.getMemberNumber()).isEqualTo(givenMembership.getMemberNumber()); + assertThat(mandate.getMemberNumberSuffix()).isEqualTo(givenMembership.getMemberNumberSuffix()); assertThat(mandate.getValidity().asString()).isEqualTo("[2022-11-01,2024-01-01)"); assertThat(mandate.getReasonForTermination()).isEqualTo(HsOfficeReasonForTermination.CANCELLATION); return true; @@ -322,7 +322,7 @@ class HsOfficeMembershipControllerAcceptanceTest { .body("uuid", isUuidValid()) .body("partner.person.tradeName", is(givenMembership.getPartner().getPerson().getTradeName())) .body("mainDebitor.debitorNumber", is(1000313)) - .body("memberNumber", is(givenMembership.getMemberNumber())) + .body("memberNumberSuffix", is(givenMembership.getMemberNumberSuffix())) .body("validFrom", is("2022-11-01")) .body("validTo", nullValue()) .body("reasonForTermination", is("NONE")); @@ -333,7 +333,7 @@ class HsOfficeMembershipControllerAcceptanceTest { .matches(mandate -> { assertThat(mandate.getPartner().toShortString()).isEqualTo("LEGAL First GmbH"); assertThat(mandate.getMainDebitor().toString()).isEqualTo(givenMembership.getMainDebitor().toString()); - assertThat(mandate.getMemberNumber()).isEqualTo(givenMembership.getMemberNumber()); + assertThat(mandate.getMemberNumberSuffix()).isEqualTo(givenMembership.getMemberNumberSuffix()); assertThat(mandate.getValidity().asString()).isEqualTo("[2022-11-01,)"); assertThat(mandate.getReasonForTermination()).isEqualTo(NONE); return true; @@ -444,7 +444,7 @@ class HsOfficeMembershipControllerAcceptanceTest { .uuid(UUID.randomUUID()) .partner(givenPartner) .mainDebitor(givenDebitor) - .memberNumber(++tempMemberNumber) + .memberNumberSuffix(++tempMemberNumberSuffix) .validity(Range.closedInfinite(LocalDate.parse("2022-11-01"))) .reasonForTermination(NONE) .membershipFeeBillable(true) @@ -459,7 +459,7 @@ class HsOfficeMembershipControllerAcceptanceTest { void cleanup() { jpaAttempt.transacted(() -> { context.define("superuser-alex@hostsharing.net", null); - final var query = em.createQuery("DELETE FROM HsOfficeMembershipEntity m WHERE m.memberNumber >= 20000"); + final var query = em.createQuery("DELETE FROM HsOfficeMembershipEntity m WHERE m.memberNumberSuffix >= 20000"); query.executeUpdate(); }); } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java index 2f42cb58..30617a36 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipControllerRestTest.java @@ -71,7 +71,7 @@ public class HsOfficeMembershipControllerRestTest { { "partnerUuid": null, "mainDebitorUuid": "%s", - "memberNumber": 20001, + "memberNumberSuffix": 20001, "validFrom": "2022-10-13", "membershipFeeBillable": "true" } @@ -97,7 +97,7 @@ public class HsOfficeMembershipControllerRestTest { { "partnerUuid": "%s", "mainDebitorUuid": null, - "memberNumber": 20001, + "memberNumberSuffix": 20001, "validFrom": "2022-10-13", "membershipFeeBillable": "true" } @@ -129,7 +129,7 @@ public class HsOfficeMembershipControllerRestTest { { "partnerUuid": "%s", "mainDebitorUuid": "%s", - "memberNumber": 20001, + "memberNumberSuffix": 20001, "validFrom": "2022-10-13", "membershipFeeBillable": "true" } @@ -161,7 +161,7 @@ public class HsOfficeMembershipControllerRestTest { { "partnerUuid": "%s", "mainDebitorUuid": "%s", - "memberNumber": 20001, + "memberNumberSuffix": 20001, "validFrom": "2022-10-13", "membershipFeeBillable": "true" } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntityUnitTest.java index 14959428..5ba69bbc 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntityUnitTest.java @@ -17,7 +17,7 @@ class HsOfficeMembershipEntityUnitTest { public static final LocalDate GIVEN_VALID_FROM = LocalDate.parse("2020-01-01"); final HsOfficeMembershipEntity givenMembership = HsOfficeMembershipEntity.builder() - .memberNumber(10001) + .memberNumberSuffix(10001) .partner(TEST_PARTNER) .mainDebitor(TEST_DEBITOR) .validity(Range.closedInfinite(GIVEN_VALID_FROM)) @@ -31,7 +31,7 @@ class HsOfficeMembershipEntityUnitTest { } @Test - void toShortStringContainsMemberNumberOnly() { + void toShortStringContainsMemberNumberSuffixOnly() { final var result = givenMembership.toShortString(); assertThat(result).isEqualTo("10001"); 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 d633d8af..c9a8eb0d 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() - .memberNumber(20001) + .memberNumberSuffix(20001) .partner(givenPartner) .mainDebitor(givenDebitor) .validity(Range.closedInfinite(LocalDate.parse("2020-01-01"))) @@ -108,7 +108,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { final var givenPartner = partnerRepo.findPartnerByOptionalNameLike("First").get(0); final var givenDebitor = debitorRepo.findDebitorByOptionalNameLike("First").get(0); final var newMembership = toCleanup(HsOfficeMembershipEntity.builder() - .memberNumber(20002) + .memberNumberSuffix(20002) .partner(givenPartner) .mainDebitor(givenDebitor) .validity(Range.closedInfinite(LocalDate.parse("2020-01-01"))) @@ -179,7 +179,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { context("superuser-alex@hostsharing.net"); // when - final var result = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, null); + final var result = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, null); // then exactlyTheseMembershipsAreReturned( @@ -196,7 +196,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { final var givenPartner = partnerRepo.findPartnerByOptionalNameLike("First").get(0); // when - final var result = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber( + final var result = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix( givenPartner.getUuid(), null); @@ -205,12 +205,12 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { } @Test - public void globalAdmin_withoutAssumedRole_canFindAllMembershipByMemberNumber() { + public void globalAdmin_withoutAssumedRole_canFindAllMembershipByMemberNumberSuffix() { // given context("superuser-alex@hostsharing.net"); // when - final var result = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(null, 10002); + final var result = membershipRepo.findMembershipsByOptionalPartnerUuidAndOptionalMemberNumberSuffix(null, 10002); // then exactlyTheseMembershipsAreReturned(result, "Membership(10002, LEGAL Second e.K., 1000212, [2022-10-01,), NONE)"); @@ -401,7 +401,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { }); jpaAttempt.transacted(() -> { context("superuser-alex@hostsharing.net", null); - em.createQuery("DELETE FROM HsOfficeMembershipEntity WHERE memberNumber >= 20000"); + em.createQuery("DELETE FROM HsOfficeMembershipEntity WHERE memberNumberSuffix >= 20000"); }); } @@ -411,7 +411,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest { final var givenPartner = partnerRepo.findPartnerByOptionalNameLike(partnerTradeName).get(0); final var givenDebitor = debitorRepo.findDebitorByOptionalNameLike(debitorName).get(0); final var newMembership = HsOfficeMembershipEntity.builder() - .memberNumber(20002) + .memberNumberSuffix(20002) .partner(givenPartner) .mainDebitor(givenDebitor) .validity(Range.closedInfinite(LocalDate.parse("2020-01-01"))) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java index d9245fc8..3fc8c471 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java @@ -11,7 +11,7 @@ public class TestHsMembership { public static final HsOfficeMembershipEntity TEST_MEMBERSHIP = HsOfficeMembershipEntity.builder() .partner(TEST_PARTNER) - .memberNumber(300001) + .memberNumberSuffix(300001) .validity(Range.closedInfinite(LocalDate.parse("2020-01-01"))) .build(); } diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java index a711aed0..091d1c0d 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java @@ -575,7 +575,7 @@ public class ImportOfficeData extends ContextBasedTest { if (isNotBlank(rec.getString("member_since"))) { final var membership = HsOfficeMembershipEntity.builder() .partner(partner) - .memberNumber(rec.getInteger("member_id")) + .memberNumberSuffix(rec.getInteger("member_id")) .validity(toPostgresDateRange( rec.getLocalDate("member_since"), rec.getLocalDate("member_until")))