-- Deploy numerus:add_payment_account_other to pg
-- requires: roles
-- requires: schema_numerus
-- requires: payment_account

begin;

set search_path to numerus, public;

create or replace function add_payment_account_other(company integer, name text) returns uuid as
$$
	insert into payment_account (company_id, payment_account_type, name)
	values (company, 'other', name)
	returning slug;
$$
	language sql
;

revoke execute on function add_payment_account_other(integer, text) from public;
grant execute on function add_payment_account_other(integer, text) to invoicer;
grant execute on function add_payment_account_other(integer, text) to admin;

commit;
