re-generated partner and some fixes in tests
This commit is contained in:
parent
690454d80f
commit
cbc524f567
@ -67,6 +67,7 @@ public class HsOfficePersonEntity implements HasUuid, Stringifyable {
|
|||||||
JOIN hs_office_relationship partnerRel
|
JOIN hs_office_relationship partnerRel
|
||||||
ON partnerRel.uuid = partner.partnerRoleUuid AND partnerRel.relType = 'PARTNER'
|
ON partnerRel.uuid = partner.partnerRoleUuid AND partnerRel.relType = 'PARTNER'
|
||||||
WHERE partnerRel.relHolderUuid = personUuid
|
WHERE partnerRel.relHolderUuid = personUuid
|
||||||
|
LIMIT 1
|
||||||
) -- uuid would be ambiguous with outer uuid
|
) -- uuid would be ambiguous with outer uuid
|
||||||
""")
|
""")
|
||||||
private HsOfficePartnerEntity optionalPartner;
|
private HsOfficePartnerEntity optionalPartner;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
### rbac partner
|
### rbac partner
|
||||||
|
|
||||||
This code generated was by RbacViewMermaidFlowchartGenerator at 2024-03-13T15:28:17.873062752.
|
This code generated was by RbacViewMermaidFlowchartGenerator at 2024-03-16T12:04:46.219584452.
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
%%{init:{'flowchart':{'htmlLabels':false}}}%%
|
%%{init:{'flowchart':{'htmlLabels':false}}}%%
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
--liquibase formatted sql
|
--liquibase formatted sql
|
||||||
-- This code generated was by RbacViewPostgresGenerator at 2024-03-13T15:28:17.881206014.
|
-- This code generated was by RbacViewPostgresGenerator at 2024-03-16T12:04:46.225548817.
|
||||||
|
|
||||||
|
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
@ -105,11 +105,12 @@ create or replace function hs_office_partner_global_insert_tf()
|
|||||||
strict as $$
|
strict as $$
|
||||||
begin
|
begin
|
||||||
call grantPermissionToRole(
|
call grantPermissionToRole(
|
||||||
globalAdmin(),
|
createPermission(NEW.uuid, 'INSERT', 'hs_office_partner'),
|
||||||
createPermission(NEW.uuid, 'INSERT', 'hs_office_partner'));
|
globalAdmin());
|
||||||
return NEW;
|
return NEW;
|
||||||
end; $$;
|
end; $$;
|
||||||
|
|
||||||
|
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||||
create trigger z_hs_office_partner_global_insert_tg
|
create trigger z_hs_office_partner_global_insert_tg
|
||||||
after insert on global
|
after insert on global
|
||||||
for each row
|
for each row
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
### rbac partnerDetails
|
### rbac partnerDetails
|
||||||
|
|
||||||
This code generated was by RbacViewMermaidFlowchartGenerator at 2024-03-13T15:35:19.438833295.
|
This code generated was by RbacViewMermaidFlowchartGenerator at 2024-03-16T12:04:37.309540020.
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
%%{init:{'flowchart':{'htmlLabels':false}}}%%
|
%%{init:{'flowchart':{'htmlLabels':false}}}%%
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
--liquibase formatted sql
|
--liquibase formatted sql
|
||||||
-- This code generated was by RbacViewPostgresGenerator at 2024-03-13T15:35:19.446996853.
|
-- This code generated was by RbacViewPostgresGenerator at 2024-03-16T12:04:37.319601283.
|
||||||
|
|
||||||
|
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
@ -90,11 +90,12 @@ create or replace function hs_office_partner_details_global_insert_tf()
|
|||||||
strict as $$
|
strict as $$
|
||||||
begin
|
begin
|
||||||
call grantPermissionToRole(
|
call grantPermissionToRole(
|
||||||
globalAdmin(),
|
createPermission(NEW.uuid, 'INSERT', 'hs_office_partner_details'),
|
||||||
createPermission(NEW.uuid, 'INSERT', 'hs_office_partner_details'));
|
globalAdmin());
|
||||||
return NEW;
|
return NEW;
|
||||||
end; $$;
|
end; $$;
|
||||||
|
|
||||||
|
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||||
create trigger z_hs_office_partner_details_global_insert_tg
|
create trigger z_hs_office_partner_details_global_insert_tg
|
||||||
after insert on global
|
after insert on global
|
||||||
for each row
|
for each row
|
||||||
|
@ -114,7 +114,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
|
|||||||
.map(s -> s.replace("hs_office_", ""))
|
.map(s -> s.replace("hs_office_", ""))
|
||||||
.containsExactlyInAnyOrder(Array.fromFormatted(
|
.containsExactlyInAnyOrder(Array.fromFormatted(
|
||||||
initialGrantNames,
|
initialGrantNames,
|
||||||
"{ grant perm SELECT on coopassetstransaction#temprefB to role membership#1000101:....tenant by system and assume }",
|
"{ grant perm SELECT on coopassetstransaction#temprefB to role membership#M-1000101.referrer by system and assume }",
|
||||||
null));
|
null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,10 +195,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
|
|||||||
@Test
|
@Test
|
||||||
public void representative_canViewRelatedCoopAssetsTransactions() {
|
public void representative_canViewRelatedCoopAssetsTransactions() {
|
||||||
// given:
|
// given:
|
||||||
// TODO: once the debitor-relationship roles and grants are implemented, this should work:
|
context("superuser-alex@hostsharing.net", "hs_office_person#FirbySusan.admin");
|
||||||
// context("superuser-alex@hostsharing.net", "hs_office_person#FirbySusan.admin");
|
|
||||||
// for now we can only use the debitor admin, which would be a Hostsharing admin, though:
|
|
||||||
context("superuser-alex@hostsharing.net", "hs_office_debitor#1000111:FirstGmbH-firstcontact.admin");
|
|
||||||
|
|
||||||
// when:
|
// when:
|
||||||
final var result = coopAssetsTransactionRepo.findCoopAssetsTransactionByOptionalMembershipUuidAndDateRange(
|
final var result = coopAssetsTransactionRepo.findCoopAssetsTransactionByOptionalMembershipUuidAndDateRange(
|
||||||
@ -209,10 +206,9 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
|
|||||||
// then:
|
// then:
|
||||||
exactlyTheseCoopAssetsTransactionsAreReturned(
|
exactlyTheseCoopAssetsTransactionsAreReturned(
|
||||||
result,
|
result,
|
||||||
// TODO: fix M-null to M-1000101 once the debitor+memberhip grants are amended to partner relationship
|
"CoopAssetsTransaction(M-1000101: 2010-03-15, DEPOSIT, 320.00, ref 1000101-1, initial deposit)",
|
||||||
"CoopAssetsTransaction(M-null: 2010-03-15, DEPOSIT, 320.00, ref 1000101-1, initial deposit)",
|
"CoopAssetsTransaction(M-1000101: 2021-09-01, DISBURSAL, -128.00, ref 1000101-2, partial disbursal)",
|
||||||
"CoopAssetsTransaction(M-null: 2021-09-01, DISBURSAL, -128.00, ref 1000101-2, partial disbursal)",
|
"CoopAssetsTransaction(M-1000101: 2022-10-20, ADJUSTMENT, 128.00, ref 1000101-3, some adjustment)");
|
||||||
"CoopAssetsTransaction(M-null: 2022-10-20, ADJUSTMENT, 128.00, ref 1000101-3, some adjustment)");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,8 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
|||||||
final var result = debitorRepo.findDebitorByDebitorNumber(1000313);
|
final var result = debitorRepo.findDebitorByDebitorNumber(1000313);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
exactlyTheseDebitorsAreReturned(result, "debitor(D-1000313: P-10003, thi)");
|
exactlyTheseDebitorsAreReturned(result,
|
||||||
|
"debitor(D-1000313: rel(relAnchor='IF Third OHG', relType='ACCOUNTING', relHolder='IF Third OHG'), thi)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,12 +443,12 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
|||||||
final var givenDebitor = givenSomeTemporaryDebitor("Fourth", "eighth", "Fourth", "eig");
|
final var givenDebitor = givenSomeTemporaryDebitor("Fourth", "eighth", "Fourth", "eig");
|
||||||
assertThatDebitorIsVisibleForUserWithRole(
|
assertThatDebitorIsVisibleForUserWithRole(
|
||||||
givenDebitor,
|
givenDebitor,
|
||||||
"hs_office_partner#10004:FourtheG-fourthcontact.admin");
|
"hs_office_relationship#HostsharingeG-with-PARTNER-FourtheG.admin");
|
||||||
assertThatDebitorActuallyInDatabase(givenDebitor);
|
assertThatDebitorActuallyInDatabase(givenDebitor);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
final var result = jpaAttempt.transacted(() -> {
|
final var result = jpaAttempt.transacted(() -> {
|
||||||
context("superuser-alex@hostsharing.net", "hs_office_partner#10004:FourtheG-fourthcontact.admin");
|
context("superuser-alex@hostsharing.net", "hs_office_relationship#HostsharingeG-with-PARTNER-FourtheG.admin");
|
||||||
givenDebitor.setVatId("NEW-VAT-ID");
|
givenDebitor.setVatId("NEW-VAT-ID");
|
||||||
return toCleanup(debitorRepo.save(givenDebitor));
|
return toCleanup(debitorRepo.save(givenDebitor));
|
||||||
});
|
});
|
||||||
@ -536,7 +537,7 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithClean
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
final var result = jpaAttempt.transacted(() -> {
|
final var result = jpaAttempt.transacted(() -> {
|
||||||
context("superuser-alex@hostsharing.net", "hs_office_debitor#D-1000420.agent");
|
context("superuser-alex@hostsharing.net", "hs_office_relationship#FourtheG-with-ACCOUNTING-FourtheG.admin");
|
||||||
assertThat(debitorRepo.findByUuid(givenDebitor.getUuid())).isPresent();
|
assertThat(debitorRepo.findByUuid(givenDebitor.getUuid())).isPresent();
|
||||||
|
|
||||||
debitorRepo.deleteByUuid(givenDebitor.getUuid());
|
debitorRepo.deleteByUuid(givenDebitor.getUuid());
|
||||||
|
Loading…
Reference in New Issue
Block a user