move Parter+Debitor person+contact to related Relationsship #20

Merged
hsh-michaelhoennig merged 101 commits from remove-direct-partner-person-and-contact into master 2024-03-28 12:15:14 +01:00
2 changed files with 32 additions and 17 deletions
Showing only changes of commit a9c3df6c7c - Show all commits

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:--//
-- ----------------------------------------------------------------------------
@ -49,20 +56,20 @@ begin
-- Permissions and Grants for Debitor
-- call grantPermissionsToRole(
-- getRoleId(hsOfficeRelationshipOwner(newDebitorRel)),
-- createPermissions(partnerUuid, array ['DELETE'])
-- );
--
-- call grantPermissionsToRole(
-- getRoleId(hsOfficeRelationshipAdmin(newDebitorRel), 'fail'),
-- createPermissions(partnerUuid, array ['UPDATE'])
-- );
--
-- call grantPermissionsToRole(
-- getRoleId(hsOfficeRelationshipTenant(newDebitorRel), 'fail'),
-- createPermissions(partnerUuid, array ['SELECT'])
-- );
call grantPermissionsToRole(
getRoleId(hsOfficeRelationshipOwner(newDebitorRel)),
createPermissions(partnerUuid, array ['DELETE'])
);
call grantPermissionsToRole(
getRoleId(hsOfficeRelationshipAdmin(newDebitorRel), 'fail'),
createPermissions(partnerUuid, array ['UPDATE'])
);
call grantPermissionsToRole(
getRoleId(hsOfficeRelationshipTenant(newDebitorRel), 'fail'),
createPermissions(partnerUuid, array ['SELECT'])
);
-- Grants to and from related Partner Relationship

View File

@ -16,6 +16,7 @@ create or replace procedure createHsOfficeMembershipTestData(
declare
currentTask varchar;
relatedPartner hs_office_partner;
relatedDebitorRel hs_office_relationship;
relatedDebitor hs_office_debitor;
begin
currentTask := 'creating Membership test-data ' ||
@ -27,9 +28,16 @@ begin
select partner.* from hs_office_partner partner
where partner.partnerNumber = forPartnerNumber into relatedPartner;
select d.* from hs_office_debitor d
where d.partneruuid = relatedPartner.uuid
and d.debitorNumberSuffix = forMainDebitorNumberSuffix
select debitorRel.* from hs_office_relationship debitorRel
join hs_office_relationship partnerRel
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;
raise notice 'creating test Membership: M-% %', forPartnerNumber, newMemberNumberSuffix;