fix membership test data

This commit is contained in:
Michael Hoennig 2024-03-12 11:51:31 +01:00
parent 9788205724
commit a9c3df6c7c
2 changed files with 32 additions and 17 deletions

View File

@ -7,6 +7,13 @@ call generateRelatedRbacObject('hs_office_debitor');
--// --//
-- ============================================================================
--changeset hs-office-debitor-rbac-ROLE-DESCRIPTORS:1 endDelimiter:--//
-- ----------------------------------------------------------------------------
call generateRbacRoleDescriptors('hsOfficeDebitor', 'hs_office_debitor');
--//
-- ============================================================================ -- ============================================================================
--changeset hs-office-debitor-rbac-ROLES-CREATION:1 endDelimiter:--// --changeset hs-office-debitor-rbac-ROLES-CREATION:1 endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
@ -49,20 +56,20 @@ begin
-- Permissions and Grants for Debitor -- Permissions and Grants for Debitor
-- call grantPermissionsToRole( call grantPermissionsToRole(
-- getRoleId(hsOfficeRelationshipOwner(newDebitorRel)), getRoleId(hsOfficeRelationshipOwner(newDebitorRel)),
-- createPermissions(partnerUuid, array ['DELETE']) createPermissions(partnerUuid, array ['DELETE'])
-- ); );
--
-- call grantPermissionsToRole( call grantPermissionsToRole(
-- getRoleId(hsOfficeRelationshipAdmin(newDebitorRel), 'fail'), getRoleId(hsOfficeRelationshipAdmin(newDebitorRel), 'fail'),
-- createPermissions(partnerUuid, array ['UPDATE']) createPermissions(partnerUuid, array ['UPDATE'])
-- ); );
--
-- call grantPermissionsToRole( call grantPermissionsToRole(
-- getRoleId(hsOfficeRelationshipTenant(newDebitorRel), 'fail'), getRoleId(hsOfficeRelationshipTenant(newDebitorRel), 'fail'),
-- createPermissions(partnerUuid, array ['SELECT']) createPermissions(partnerUuid, array ['SELECT'])
-- ); );
-- Grants to and from related Partner Relationship -- Grants to and from related Partner Relationship

View File

@ -16,6 +16,7 @@ create or replace procedure createHsOfficeMembershipTestData(
declare declare
currentTask varchar; currentTask varchar;
relatedPartner hs_office_partner; relatedPartner hs_office_partner;
relatedDebitorRel hs_office_relationship;
relatedDebitor hs_office_debitor; relatedDebitor hs_office_debitor;
begin begin
currentTask := 'creating Membership test-data ' || currentTask := 'creating Membership test-data ' ||
@ -27,9 +28,16 @@ begin
select partner.* from hs_office_partner partner select partner.* from hs_office_partner partner
where partner.partnerNumber = forPartnerNumber into relatedPartner; where partner.partnerNumber = forPartnerNumber into relatedPartner;
select d.* from hs_office_debitor d select debitorRel.* from hs_office_relationship debitorRel
where d.partneruuid = relatedPartner.uuid join hs_office_relationship partnerRel
and d.debitorNumberSuffix = forMainDebitorNumberSuffix on debitorRel.relAnchorUuid=partnerRel.relHolderUuid and partnerRel.relType='PARTNER'
join hs_office_partner partner
on partner.partnerRoleUuid = partnerRel.uuid
where debitorRel.relType='ACCOUNTING' -- FIXME: 'DEBITOR'
into relatedDebitorRel;
select debitor.* from hs_office_debitor debitor
where debitor.debitorRelUuid = relatedDebitorRel.uuid
and debitor.debitorNumberSuffix = forMainDebitorNumberSuffix
into relatedDebitor; into relatedDebitor;
raise notice 'creating test Membership: M-% %', forPartnerNumber, newMemberNumberSuffix; raise notice 'creating test Membership: M-% %', forPartnerNumber, newMemberNumberSuffix;