office-related spec-clarifications and -amendmends (contact.emailaddresses+.phonenumbers JSON) (#50)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/50 Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
@ -10,8 +10,8 @@ create table if not exists hs_office_contact
|
||||
version int not null default 0,
|
||||
label varchar(128) not null,
|
||||
postalAddress text,
|
||||
emailAddresses text, -- TODO.feat: change to json
|
||||
phoneNumbers text -- TODO.feat: change to json
|
||||
emailAddresses jsonb not null,
|
||||
phoneNumbers jsonb not null
|
||||
);
|
||||
--//
|
||||
|
||||
|
@ -11,8 +11,9 @@
|
||||
create or replace procedure createHsOfficeContactTestData(contLabel varchar)
|
||||
language plpgsql as $$
|
||||
declare
|
||||
currentTask varchar;
|
||||
emailAddr varchar;
|
||||
currentTask varchar;
|
||||
postalAddr varchar;
|
||||
emailAddr varchar;
|
||||
begin
|
||||
currentTask = 'creating contact test-data ' || contLabel;
|
||||
execute format('set local hsadminng.currentTask to %L', currentTask);
|
||||
@ -22,14 +23,17 @@ begin
|
||||
perform createRbacUser(emailAddr);
|
||||
call defineContext(currentTask, null, emailAddr);
|
||||
|
||||
postalAddr := E'Vorname Nachname\nStraße Hnr\nPLZ Stadt';
|
||||
|
||||
raise notice 'creating test contact: %', contLabel;
|
||||
insert
|
||||
into hs_office_contact (label, postaladdress, emailaddresses, phonenumbers)
|
||||
values (contLabel, $address$
|
||||
Vorname Nachname
|
||||
Straße Hnr
|
||||
PLZ Stadt
|
||||
$address$, emailAddr, '+49 123 1234567');
|
||||
values (
|
||||
contLabel,
|
||||
postalAddr,
|
||||
('{ "main": "' || emailAddr || '" }')::jsonb,
|
||||
('{ "phone_office": "+49 123 1234567" }')::jsonb
|
||||
);
|
||||
end; $$;
|
||||
--//
|
||||
|
||||
|
@ -11,7 +11,7 @@ create table hs_office_debitor
|
||||
debitorNumberSuffix char(2) not null check (debitorNumberSuffix::text ~ '^[0-9][0-9]$'),
|
||||
debitorRelUuid uuid not null references hs_office_relation(uuid),
|
||||
billable boolean not null default true,
|
||||
vatId varchar(24), -- TODO.spec: here or in person?
|
||||
vatId varchar(24),
|
||||
vatCountryCode varchar(2),
|
||||
vatBusiness boolean not null,
|
||||
vatReverseCharge boolean not null,
|
||||
|
Reference in New Issue
Block a user