class Admins::IdentityVerificationQuery < ApplicationQuery
  include CustomSortable

  attr_reader :params

  sort_columns :created_at, default_by: :created_at, default_direction: :desc

  def initialize(params)
    @params = params
  end

  def call
    state = params[:state] == "all" ? [0,1,2] :   params[:state].nil? ? [0] : params[:state].to_i
    applies = IdentityVerification.where(state: state)
    custom_sort(applies, params[:sort_by], params[:sort_direction])
  end
end