You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: overviews.rb
    path of file: ./repos/zammad/app/models/ticket
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

module Ticket::Overviews
=begin

all overviews by user

  result = Ticket::Overviews.all(current_user: User.find(3))

certain overviews by user

  result = Ticket::Overviews.all(current_user: User.find(3), links: ['all_unassigned', 'my_assigned'])

returns

  result = [overview1, overview2]

=end

  def self.all(data)
    Ticket::OverviewsPolicy::Scope.new(data[:current_user], Overview).resolve
      .where({ link: data[:links] }.compact)
      .distinct
      .reorder(:prio, :name)
  end

=begin

index of all
    
  def self.index(user, links = nil)
    overviews = Ticket::Overviews.all(
      current_user: user,
      links:        links,
    )
    return [] if overviews.blank?

    user_scopes = {
      read:     TicketPolicy::ReadScope.new(user).resolve,
      overview: TicketPolicy::OverviewScope.new(user).resolve,
    }

    overviews.map do |overview|
      db_query_params = _db_query_params(overview, user)

      scope = if overview.condition['ticket.mention_user_ids'].present?
                user_scopes[:read]
              else
                user_scopes[:overview]
              end

      ticket_result = scope
        .distinct
        .where(db_query_params.query_condition, *db_query_params.bind_condition)
        .joins(db_query_params.tables)
        .reorder(Arel.sql("#{db_query_params.order_by} #{db_query_params.direction}"))
        .limit(limit_per_overview)
        .pluck(:id, :updated_at, Arel.sql(db_query_params.order_by))

      tickets = ticket_result.map do |ticket|
        {
          id:         ticket[0],
          updated_at: ticket[1],
        }
      end

      count = scope
        .distinct
        .where(db_query_params.query_condition, *db_query_params.bind_condition)
        .joins(db_query_params.tables)
        .count

      {
        overview: {
          name:       overview.name,
          id:         overview.id,
          view:       overview.link,
          updated_at: overview.updated_at,
        },
        tickets:  tickets,
        count:    count,
      }
    end