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: allocation.rb
    path of file: ./repos/openfoodnetwork/lib/reporting/reports/bulk_coop
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Reporting
  module Reports
    module BulkCoop
      class Allocation < Base
        def query_result
          table_items.group_by(&:order).values
        end

        def columns
          {
            customer: :order_billing_address_name,
            product: :product_name,
            bulk_unit_size: :product_group_buy_unit_size,
            var
    
        def rules
          [
            {
              group_by: :product,
              header: true,
              summary_row: proc do |_key, items, rows|
                line_items = items.flatten
                {
                  sum_total: rows.sum(&:sum_total),
                  total_available: total_available(line_items),
                  unallocated: remainder(line_items),
                  max_quantity_excess: max_quantity_excess(line_items)
                }
              end
            }
          ]
        end