Sha256: 2f66c848949b13c9b045e123fb916928b8150aa29e8867117632495efa2e457c

Contents?: true

Size: 750 Bytes

Versions: 16

Compression:

Stored size: 750 Bytes

Contents

module Eco
  module API
    module UseCases
      class DefaultCases
        class NewIdCase < BaseCase

          def process
            @cases.define("new-id", type: :sync) do |entries, people, session|
              job = session.job_group("main").new("update", type: :update, sets: :core)

              entries.each.with_index do |entry, i|
                if person = people.find(entry)
                  person.external_id = entry.external_id
                  job.add(person)
                else
                  session.logger.error("Entry(#{i}) - this person does not exist: #{entry.to_s(:identify)}")
                end
              end
            end
          end

        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eco-helpers-0.6.17 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.16 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.15 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.13 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.12 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.11 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.9 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.8 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.7 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.6 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.5 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.4 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.3 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.2 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.1 lib/eco/api/usecases/default_cases/new_id_case.rb
eco-helpers-0.6.0 lib/eco/api/usecases/default_cases/new_id_case.rb