memberNumber as partnerNumber+memberNumberSuffix #13
@ -60,7 +60,7 @@ public class HsOfficeCoopSharesTransactionEntity implements Stringifyable, HasUu
|
|||||||
private int shareCount;
|
private int shareCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ooking reference.
|
* The Booking reference.
|
||||||
*/
|
*/
|
||||||
@Column(name = "reference")
|
@Column(name = "reference")
|
||||||
private String reference;
|
private String reference;
|
||||||
|
@ -179,7 +179,6 @@ call generateRbacIdentityView('hs_office_partner', $idName$
|
|||||||
call generateRbacRestrictedView('hs_office_partner',
|
call generateRbacRestrictedView('hs_office_partner',
|
||||||
'(select idName from hs_office_person_iv p where p.uuid = target.personUuid)',
|
'(select idName from hs_office_person_iv p where p.uuid = target.personUuid)',
|
||||||
$updates$
|
$updates$
|
||||||
partnerNumber = new.partnerNumber,
|
|
||||||
personUuid = new.personUuid,
|
personUuid = new.personUuid,
|
||||||
contactUuid = new.contactUuid
|
contactUuid = new.contactUuid
|
||||||
$updates$);
|
$updates$);
|
||||||
|
@ -17,7 +17,9 @@ create table if not exists hs_office_membership
|
|||||||
memberNumberSuffix::text ~ '^[0-9][0-9]$'),
|
memberNumberSuffix::text ~ '^[0-9][0-9]$'),
|
||||||
validity daterange not null,
|
validity daterange not null,
|
||||||
reasonForTermination HsOfficeReasonForTermination not null default 'NONE',
|
reasonForTermination HsOfficeReasonForTermination not null default 'NONE',
|
||||||
membershipFeeBillable boolean not null default true
|
membershipFeeBillable boolean not null default true,
|
||||||
|
|
||||||
|
UNIQUE(partnerUuid, memberNumberSuffix)
|
||||||
);
|
);
|
||||||
--//
|
--//
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberSuffix() {
|
void globalAdmin_canFindCoopAssetsTransactionsByMemberNumber() {
|
||||||
|
|
||||||
context.define("superuser-alex@hostsharing.net");
|
context.define("superuser-alex@hostsharing.net");
|
||||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
||||||
@ -114,7 +114,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void globalAdmin_canFindCoopAssetsTransactionsByMemberNumberSuffixAndDateRange() {
|
void globalAdmin_canFindCoopAssetsTransactionsByMembershipUuidAndDateRange() {
|
||||||
|
|
||||||
context.define("superuser-alex@hostsharing.net");
|
context.define("superuser-alex@hostsharing.net");
|
||||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
||||||
|
@ -72,7 +72,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void globalAdmin_canFindCoopSharesTransactionsByMemberNumberSuffix() {
|
void globalAdmin_canFindCoopSharesTransactionsByMemberNumber() {
|
||||||
|
|
||||||
context.define("superuser-alex@hostsharing.net");
|
context.define("superuser-alex@hostsharing.net");
|
||||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
||||||
@ -106,13 +106,14 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void globalAdmin_canFindCoopSharesTransactionsByMemberNumberSuffixAndDateRange() {
|
void globalAdmin_canFindCoopSharesTransactionsByMembershipUuidAndDateRange() {
|
||||||
|
|
||||||
context.define("superuser-alex@hostsharing.net");
|
context.define("superuser-alex@hostsharing.net");
|
||||||
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
final var givenMembership = membershipRepo.findMembershipByMemberNumber(1000202);
|
||||||
|
|
||||||
RestAssured // @formatter:off
|
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",
|
"transactionType": "CANCELLATION",
|
||||||
|
@ -104,12 +104,6 @@ class HsOfficeDebitorEntityPatcherUnitTest extends PatchUnitTestBase<
|
|||||||
HsOfficeDebitorEntity::setBillingContact,
|
HsOfficeDebitorEntity::setBillingContact,
|
||||||
newBillingContact(PATCHED_CONTACT_UUID))
|
newBillingContact(PATCHED_CONTACT_UUID))
|
||||||
.notNullable(),
|
.notNullable(),
|
||||||
new SimpleProperty<>(
|
|
||||||
"personType",
|
|
||||||
HsOfficeDebitorPatchResource::setBillable,
|
|
||||||
PATCHED_BILLABLE,
|
|
||||||
HsOfficeDebitorEntity::setBillable)
|
|
||||||
.notNullable(),
|
|
||||||
new SimpleProperty<>(
|
new SimpleProperty<>(
|
||||||
"billable",
|
"billable",
|
||||||
HsOfficeDebitorPatchResource::setBillable,
|
HsOfficeDebitorPatchResource::setBillable,
|
||||||
|
@ -77,7 +77,7 @@ class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTest {
|
|||||||
// when
|
// when
|
||||||
final var result = attempt(em, () -> {
|
final var result = attempt(em, () -> {
|
||||||
final var newMembership = toCleanup(HsOfficeMembershipEntity.builder()
|
final var newMembership = toCleanup(HsOfficeMembershipEntity.builder()
|
||||||
.memberNumberSuffix("01")
|
.memberNumberSuffix("11")
|
||||||
.partner(givenPartner)
|
.partner(givenPartner)
|
||||||
.mainDebitor(givenDebitor)
|
.mainDebitor(givenDebitor)
|
||||||
.validity(Range.closedInfinite(LocalDate.parse("2020-01-01")))
|
.validity(Range.closedInfinite(LocalDate.parse("2020-01-01")))
|
||||||
|
@ -226,7 +226,7 @@ class HsOfficePartnerRepositoryIntegrationTest extends ContextBasedTest {
|
|||||||
assertThat(result)
|
assertThat(result)
|
||||||
.isNotNull()
|
.isNotNull()
|
||||||
.extracting(Object::toString)
|
.extracting(Object::toString)
|
||||||
.isEqualTo("partner(LEGAL First GmbH: first contact)");
|
.isEqualTo("partner(LP First GmbH: first contact)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,11 +10,11 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||||||
class HsOfficeRelationshipEntityUnitTest {
|
class HsOfficeRelationshipEntityUnitTest {
|
||||||
|
|
||||||
private HsOfficePersonEntity anchor = HsOfficePersonEntity.builder()
|
private HsOfficePersonEntity anchor = HsOfficePersonEntity.builder()
|
||||||
.personType(HsOfficePersonType.LEGAL)
|
.personType(HsOfficePersonType.LEGAL_PERSON)
|
||||||
.tradeName("some trade name")
|
.tradeName("some trade name")
|
||||||
.build();
|
.build();
|
||||||
private HsOfficePersonEntity holder = HsOfficePersonEntity.builder()
|
private HsOfficePersonEntity holder = HsOfficePersonEntity.builder()
|
||||||
.personType(HsOfficePersonType.NATURAL)
|
.personType(HsOfficePersonType.NATURAL_PERSON)
|
||||||
.familyName("Meier")
|
.familyName("Meier")
|
||||||
.givenName("Mellie")
|
.givenName("Mellie")
|
||||||
.build();
|
.build();
|
||||||
@ -27,6 +27,6 @@ class HsOfficeRelationshipEntityUnitTest {
|
|||||||
.relHolder(holder)
|
.relHolder(holder)
|
||||||
.build();
|
.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')");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user