Consider adding a function that is going to handle at least two parameters (that depends if the function is going to be created for a single table or is going to be more generic, in such case function have to handle more parameters).
The first parameter is going to be referring to record id (in a case when the table has composite key then the number of parameters is going to be bigger) and second the tenant id.
The main purpose of this enhancement is to create a function that gives that same result as function created during tasks 58 (#58) and can be defined as 'IMMUTABLE'.
Please check https://www.postgresql.org/docs/9.6/sql-createfunction.html