app/models/factories/eligibility_factory.rb
# returns hash of product_id to applicable_aptc mappings
returns hash of product_id to applicable_aptc mappings
returns hash of product_id to applicable_aptc mappings
def fetch_applicable_aptcs
      raise "Cannot process without selected_aptc: #{@selected_aptc} and product_ids: #{@product_ids}" if @selected_aptc.nil? || @product_ids.empty?
      @available_aptc ||= fetch_available_eligibility[:total_available_aptc]
      @product_ids.inject({}) do |products_aptcs_hash, product_id|
        product_aptc = applicable_aptc_hash(product_id)
        products_aptcs_hash.merge!(product_aptc) unless product_aptc.empty?
        products_aptcs_hash
      end
    end
def fetch_applicable_aptcs raise "Cannot process without selected_aptc: #{@selected_aptc} and product_ids: #{@product_ids}" if @selected_aptc . nil? || @product_ids . empty? @available_aptc ||= fetch_available_eligibility [ :total_available_aptc ] @product_ids . inject ( { } ) do | products_aptcs_hash , product_id | product_aptc = applicable_aptc_hash ( product_id ) products_aptcs_hash . merge! ( product_aptc ) unless product_aptc . empty? products_aptcs_hash end end
returns hash of product_id to applicable_aptc mappings
returns hash of product_id to applicable_aptc mappings
# TODO: Return a has of plan_id, applicable aptcs.