I used a struct to get the params and based on those params generate the result by passing them in a QueryBuilder function.