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: return_authorization.rb
    path of file: ./repos/spree/core/app/models/spree
    
    the code of the file until where you have to start completion: module Spree
  class ReturnAuthorization < Spree::Base
    include Spree::Core::NumberGenerator.new(prefix:
    
    def generate_expedited_exchange_reimbursements
      return unless Spree::Config[:expedited_exchanges]

      items_to_exchange = return_items.select(&:exchange_required?)
      items_to_exchange.each(&:attempt_accept)
      items_to_exchange.select!(&:accepted?)

      return if items_to_exchange.blank?

      pre_expedited_exchange_hooks.each { |h| h.call items_to_exchange }

      reimbursement = Reimbursement.new(return_items: items_to_exchange, order: order)

      if reimbursement.save
        reimbursement.perform!
      else
        errors.add(:base, reimbursement.errors.full_messages)
        raise ActiveRecord::RecordInvalid, self
      end