I created next function in postgres:
create or replace FUNCTION public.myFunction(language integer, app_type integer, user uuid, level integer default null, s