2023-01-17 21:30:01 +00:00
begin ;
set search_path to auth , numerus , public ;
2023-02-07 15:59:00 +00:00
alter sequence user_user_id_seq restart ;
insert into auth . " user " ( email , name , password , role )
values ( ' demo@numerus ' , ' Demo User ' , ' demo ' , ' invoicer ' )
, ( ' admin@numerus ' , ' Demo Admin ' , ' admin ' , ' admin ' )
Add the company relation and read-only form to edit
I do not have more time to update the update to the company today, but i
believe this is already a good amount of work for a commit.
The company is going to be used for row level security, as users will
only have access to the data from companies they are granted access, by
virtue of being in the company_user relation.
I did not know how add a row level security policy to the company_user
because i needed the to select on the same relation and this is not
allowed, because it would create an infinite loop.
Had to add the vat, pg_libphonenumber, and uri extensions in order to
validate VAT identification numbers, phone numbers, and URIs,
repectively. These libraries are not in Debian, but i created packages
for them all in https://dev.tandem.ws/tandem.
2023-01-24 20:46:07 +00:00
;
2023-02-07 15:59:00 +00:00
alter sequence company_company_id_seq restart ;
2023-03-02 09:24:44 +00:00
insert into company ( business_name , vatin , trade_name , phone , email , web , address , city , province , postal_code , country_code , currency_code , legal_disclaimer )
values ( ' Juli Verd ' , ' ES40404040D ' , ' Pesebre ' , parse_packed_phone_number ( ' 972 50 60 70 ' , ' ES ' ) , ' info@numerus.cat ' , ' https://numerus.cat/ ' , ' C/ de l’ Hort ' , ' Castelló d’ Empúries ' , ' Girona ' , ' 17486 ' , ' ES ' , ' EUR ' , ' Juli Verd és responsable del tractament de les seves dades d’ acord amb el RGPD i la LOPDGDD, i les tracta per a mantenir una relació mercantil/comercial amb vostè. Les conservarà mentre es mantingui aquesta relació i no es comunicaran a tercers. Pot exercir els drets d’ accés, rectificació, portabilitat, supressió, limitació i oposició a Juli Verd, amb domicili Carrer de l’ Hort 71, 17486 Castelló d’ Empúries o enviant un correu electrònic a info@numerus.cat. Per a qualsevol reclamació pot acudir a agpd.es. Per a més informació pot consultar la nostra política de privacitat a numerus.cat. ' ) ;
Add the company relation and read-only form to edit
I do not have more time to update the update to the company today, but i
believe this is already a good amount of work for a commit.
The company is going to be used for row level security, as users will
only have access to the data from companies they are granted access, by
virtue of being in the company_user relation.
I did not know how add a row level security policy to the company_user
because i needed the to select on the same relation and this is not
allowed, because it would create an infinite loop.
Had to add the vat, pg_libphonenumber, and uri extensions in order to
validate VAT identification numbers, phone numbers, and URIs,
repectively. These libraries are not in Debian, but i created packages
for them all in https://dev.tandem.ws/tandem.
2023-01-24 20:46:07 +00:00
insert into company_user ( company_id , user_id )
values ( 1 , 1 )
, ( 1 , 2 )
2023-01-17 21:30:01 +00:00
;
2023-02-28 11:02:27 +00:00
alter sequence tax_class_tax_class_id_seq restart ;
insert into tax_class ( company_id , name )
values ( 1 , ' IRPF ' )
, ( 1 , ' IVA ' )
;
2023-02-07 15:59:00 +00:00
alter sequence tax_tax_id_seq restart ;
2023-02-28 11:02:27 +00:00
insert into tax ( company_id , tax_class_id , name , rate )
values ( 1 , 1 , ' Retenció 15 % ' , - 0 . 15 )
, ( 1 , 2 , ' IVA 21 % ' , 0 . 21 )
, ( 1 , 2 , ' IVA 10 % ' , 0 . 10 )
, ( 1 , 2 , ' IVA 4 % ' , 0 . 04 )
2023-01-28 13:18:58 +00:00
;
2023-02-07 15:59:00 +00:00
alter sequence contact_contact_id_seq restart ;
insert into contact ( company_id , business_name , vatin , trade_name , phone , email , web , address , city , province , postal_code , country_code )
values ( 1 , ' Melcior ' , ' IR1 ' , ' Rei Blanc ' , parse_packed_phone_number ( ' 0732621 ' , ' IR ' ) , ' melcio@reismags.cat ' , ' ' , ' C/ Principal, 1 ' , ' Shiraz ' , ' Fars ' , ' 1 ' , ' IR ' )
, ( 1 , ' Gaspar ' , ' IN2 ' , ' Rei Ros ' , parse_packed_phone_number ( ' 111 ' , ' IN ' ) , ' gaspar@reismags.cat ' , ' ' , ' C/ Principal, 2 ' , ' Nova Delhi ' , ' Delhi ' , ' 2 ' , ' IN ' )
, ( 1 , ' Baltasar ' , ' YE3 ' , ' Rei Negre ' , parse_packed_phone_number ( ' 1-111-111 ' , ' YE ' ) , ' baltasar@reismags.cat ' , ' ' , ' C/ Principal, 3 ' , ' Sanaa ' , ' Sanaa ' , ' 3 ' , ' YE ' )
, ( 1 , ' Caganera ' , ' ES41414141L ' , ' ' , parse_packed_phone_number ( ' 222 222 222 ' , ' ES ' ) , ' caganera@pesebre.cat ' , ' ' , ' C/ De l’ Hort, 4 ' , ' Olot ' , ' Girona ' , ' 17800 ' , ' ES ' )
, ( 1 , ' Bou ' , ' ES41414142C ' , ' ' , parse_packed_phone_number ( ' 333 333 333 ' , ' ES ' ) , ' bou@pesebre.cat ' , ' ' , ' C/ De la Palla, 5 ' , ' Sant Climent Sescebes ' , ' Girona ' , ' 17751 ' , ' ES ' )
, ( 1 , ' Rabadà ' , ' ES41414143K ' , ' ' , parse_packed_phone_number ( ' 444 444 444 ' , ' ES ' ) , ' rabada@pesebre.cat ' , ' ' , ' C/ De les Ovelles, 6 ' , ' Fornells de la Selva ' , ' Girona ' , ' 17458 ' , ' ES ' )
2023-02-03 13:16:46 +00:00
;
2023-02-07 15:59:00 +00:00
alter sequence product_product_id_seq restart ;
2023-02-08 13:12:45 +00:00
insert into product ( company_id , name , description , price )
2023-03-01 10:12:56 +00:00
values ( 1 , ' Or ' , ' Metall de transició tou, brillant, groc, pesant, mal·leable, dúctil i que no reacciona amb la majoria de productes químics, però és sensible al clor i a l’ aigua règia. ' , 5592 )
2023-02-08 13:12:45 +00:00
, ( 1 , ' Encens ' , ' Goma resina fragrant que desprèn una olor característica quan es crema. ' , 215 )
, ( 1 , ' Mirra ' , ' Goma resinosa aromàtica de color gris groguenc i gust amargant. ' , 690 )
, ( 1 , ' Paper higiènic (pack de 32 U) ' , ' Paper que s’ usa per mantenir la higiene personal després de defecar o orinar. ' , 799 )
, ( 1 , ' Cavall Fort ' , ' Revista quinzenal en llengua catalana i de còmic en català, destinada a infants i joves. ' , 364 )
, ( 1 , ' Palla ' , ' Tija seca dels cereals després que el gra o llavor ha estat separat mitjançant la trilla. ' , 2500 )
, ( 1 , ' Teia ' , ' Fusta resinosa de pi i d’ altres arbres, provinent sobretot del cor de l’ arbre, que crema amb molta facilitat. ' , 700 )
;
insert into product_tax ( product_id , tax_id )
values ( 1 , 2 )
, ( 2 , 2 )
, ( 3 , 2 )
, ( 4 , 4 )
, ( 5 , 2 )
, ( 6 , 3 )
, ( 7 , 2 )
2023-02-06 12:35:56 +00:00
;
2023-01-17 21:30:01 +00:00
commit ;