memberNumber as partnerNumber+memberNumberSuffix #13

Merged
hsh-michaelhoennig merged 78 commits from memberNumberSuffix-and-partnerNumber into master 2024-01-24 15:57:16 +01:00
9 changed files with 15 additions and 19 deletions
Showing only changes of commit 4ca89df6fd - Show all commits

View File

@ -60,7 +60,7 @@ public class HsOfficeCoopSharesTransactionEntity implements Stringifyable, HasUu
private int shareCount;
/**
* The ooking reference.
* The Booking reference.
hsh-michaelhoennig marked this conversation as resolved Outdated
*/
@Column(name = "reference")
private String reference;

View File

@ -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,
hsh-michaelhoennig marked this conversation as resolved Outdated

entfernen, nicht sinnvoll

entfernen, nicht sinnvoll
contactUuid = new.contactUuid
$updates$);

View File

@ -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)
);
--//

View File

@ -72,7 +72,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest {
}
@Test
void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberSuffix() {
void globalAdmin_canFindCoopAssetsTransactionsByMemberNumber() {
hsh-michaelhoennig marked this conversation as resolved Outdated

ohne "Suffix" im Namen

ohne "Suffix" im Namen
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() {
hsh-michaelhoennig marked this conversation as resolved Outdated

ohne "Suffix" im Namen

ohne "Suffix" im Namen
context.define("superuser-alex@hostsharing.net");
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);

View File

@ -72,7 +72,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest {
}
@Test
void globalAdmin_canFindCoopSharesTransactionsByMemberNumberSuffix() {
void globalAdmin_canFindCoopSharesTransactionsByMemberNumber() {
hsh-michaelhoennig marked this conversation as resolved Outdated

ohne "Suffix" im Namen

ohne "Suffix" im Namen
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",

View File

@ -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<>(
hsh-michaelhoennig marked this conversation as resolved Outdated

Dublette entfernen

Dublette entfernen
"billable",
HsOfficeDebitorPatchResource::setBillable,

View File

@ -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")))

View File

@ -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)");
}
}

View File

@ -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')");
}
}