These two fields are just for information purposes, as Numerus does not have any way to wire transfer using these, but people might want to keep these in the contact’s info as a convenience. Since not every contact should have an IBAN, e.g., customers, and inside SEPA (European Union and some more countries) the BIC is not required, they are in two different relations in order to be optional without using NULL. For the IBAN i found an already made PostgreSQL module, but for BIC i had to write a regular expression based on the information i gathered from Wikipedia, because the ISO standard is not free. These two parameters for the add_contact and edit_contact functions are TEXT because i realized that these functions are intended to be used from the web application, that only deals with texts, so the ValueOrNil() function was unnecessarily complex and PostreSQL’s functions were better suited to “convert” from TEXT to IBAN or BIC. The same is true for EMAIL and URI domains, so i changed their parameter types to TEXT too. Closes #54.
14 lines
343 B
PL/PgSQL
14 lines
343 B
PL/PgSQL
-- Verify numerus:contact_iban on pg
|
|
|
|
begin;
|
|
|
|
select contact_id
|
|
, iban
|
|
from numerus.contact_iban
|
|
where false;
|
|
|
|
select 1 / count(*) from pg_class where oid = 'numerus.contact_iban'::regclass and relrowsecurity;
|
|
select 1 / count(*) from pg_policy where polname = 'company_policy' and polrelid = 'numerus.contact_iban'::regclass;
|
|
|
|
rollback;
|