1
0

rename contact.label to contact.caption

This commit is contained in:
Michael Hoennig
2024-05-06 09:22:21 +02:00
parent a93c097f64
commit 85376d51af
35 changed files with 191 additions and 191 deletions

View File

@ -9,7 +9,7 @@ components:
uuid:
type: string
format: uuid
label:
caption:
type: string
postalAddress:
type: string
@ -21,7 +21,7 @@ components:
HsOfficeContactInsert:
type: object
properties:
label:
caption:
type: string
postalAddress:
type: string
@ -30,12 +30,12 @@ components:
phoneNumbers:
$ref: '#/components/schemas/HsOfficeContactPhoneNumbers'
required:
- label
- caption
HsOfficeContactPatch:
type: object
properties:
label:
caption:
type: string
nullable: true
postalAddress:

View File

@ -12,7 +12,7 @@ get:
required: false
schema:
type: string
description: Prefix of label to filter the results.
description: Prefix of caption to filter the results.
responses:
"200":
description: OK

View File

@ -12,7 +12,7 @@ get:
required: false
schema:
type: string
description: Prefix of label to filter the results.
description: Prefix of caption to filter the results.
responses:
"200":
description: OK

View File

@ -8,7 +8,7 @@ create table if not exists hs_office_contact
(
uuid uuid unique references RbacObject (uuid) initially deferred,
version int not null default 0,
label varchar(128) not null,
caption varchar(128) not null,
postalAddress text,
emailAddresses jsonb not null,
phoneNumbers jsonb not null

View File

@ -82,7 +82,7 @@ execute procedure insertTriggerForHsOfficeContact_tf();
call generateRbacIdentityViewFromProjection('hs_office_contact',
$idName$
label
caption
$idName$);
--//
@ -92,10 +92,10 @@ call generateRbacIdentityViewFromProjection('hs_office_contact',
-- ----------------------------------------------------------------------------
call generateRbacRestrictedView('hs_office_contact',
$orderBy$
label
caption
$orderBy$,
$updates$
label = new.label,
caption = new.caption,
postalAddress = new.postalAddress,
emailAddresses = new.emailAddresses,
phoneNumbers = new.phoneNumbers

View File

@ -8,28 +8,28 @@
/*
Creates a single contact test record.
*/
create or replace procedure createHsOfficeContactTestData(contLabel varchar)
create or replace procedure createHsOfficeContactTestData(contCaption varchar)
language plpgsql as $$
declare
currentTask varchar;
postalAddr varchar;
emailAddr varchar;
begin
currentTask = 'creating contact test-data ' || contLabel;
currentTask = 'creating contact test-data ' || contCaption;
execute format('set local hsadminng.currentTask to %L', currentTask);
emailAddr = 'contact-admin@' || cleanIdentifier(contLabel) || '.example.com';
emailAddr = 'contact-admin@' || cleanIdentifier(contCaption) || '.example.com';
call defineContext(currentTask);
perform createRbacUser(emailAddr);
call defineContext(currentTask, null, emailAddr);
postalAddr := E'Vorname Nachname\nStraße Hnr\nPLZ Stadt';
raise notice 'creating test contact: %', contLabel;
raise notice 'creating test contact: %', contCaption;
insert
into hs_office_contact (label, postaladdress, emailaddresses, phonenumbers)
into hs_office_contact (caption, postaladdress, emailaddresses, phonenumbers)
values (
contLabel,
contCaption,
postalAddr,
('{ "main": "' || emailAddr || '" }')::jsonb,
('{ "phone_office": "+49 123 1234567" }')::jsonb

View File

@ -12,7 +12,7 @@ create or replace procedure createHsOfficeRelationTestData(
holderPersonName varchar,
relationType HsOfficeRelationType,
anchorPersonName varchar,
contactLabel varchar,
contactCaption varchar,
mark varchar default null)
language plpgsql as $$
declare
@ -44,9 +44,9 @@ begin
raise exception 'holderPerson "%" not found', holderPersonName;
end if;
select c.* into contact from hs_office_contact c where c.label = contactLabel;
select c.* into contact from hs_office_contact c where c.caption = contactCaption;
if contact is null then
raise exception 'contact "%" not found', contactLabel;
raise exception 'contact "%" not found', contactCaption;
end if;
raise notice 'creating test relation: %', idName;
@ -74,7 +74,7 @@ begin
for t in startCount..endCount
loop
select p.* from hs_office_person p where tradeName = intToVarChar(t, 4) into person;
select c.* from hs_office_contact c where c.label = intToVarChar(t, 4) || '#' || t into contact;
select c.* from hs_office_contact c where c.caption = intToVarChar(t, 4) || '#' || t into contact;
call createHsOfficeRelationTestData(person.uuid, contact.uuid, 'REPRESENTATIVE');
commit;

View File

@ -12,7 +12,7 @@ create or replace procedure createHsOfficePartnerTestData(
mandantTradeName varchar,
newPartnerNumber numeric(5),
partnerPersonName varchar,
contactLabel varchar )
contactCaption varchar )
language plpgsql as $$
declare
currentTask varchar;
@ -22,7 +22,7 @@ declare
relatedPerson hs_office_person;
relatedDetailsUuid uuid;
begin
idName := cleanIdentifier( partnerPersonName|| '-' || contactLabel);
idName := cleanIdentifier( partnerPersonName|| '-' || contactCaption);
currentTask := 'creating partner test-data ' || idName;
call defineContext(currentTask, null, 'superuser-alex@hostsharing.net', 'global#global:ADMIN');
execute format('set local hsadminng.currentTask to %L', currentTask);

View File

@ -11,7 +11,7 @@
create or replace procedure createHsOfficeDebitorTestData(
withDebitorNumberSuffix numeric(5),
forPartnerPersonName varchar,
forBillingContactLabel varchar,
forBillingContactCaption varchar,
withDefaultPrefix varchar
)
language plpgsql as $$
@ -21,7 +21,7 @@ declare
relatedDebitorRelUuid uuid;
relatedBankAccountUuid uuid;
begin
idName := cleanIdentifier( forPartnerPersonName|| '-' || forBillingContactLabel);
idName := cleanIdentifier( forPartnerPersonName|| '-' || forBillingContactCaption);
currentTask := 'creating debitor test-data ' || idName;
call defineContext(currentTask, null, 'superuser-alex@hostsharing.net', 'global#global:ADMIN');
execute format('set local hsadminng.currentTask to %L', currentTask);