Sha256: c15d982ba0bc5649303a1d3231d941919c1e8801f7076cba8b087086c59dc65f

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

module Eco
  module API
    class MicroCases
      # Sets all the core details, but the supervisor.
      # @note `supervisor_id` requires a special treatment, and therefore is always excluded.
      # @param entry [PersonEntry] the input entry with the data we should set on person.
      # @param person [Ecoportal::API::V1::Person] the person we want to update, carrying the changes to be done.
      # @param people [Eco::API::Organization::People] target existing _People_ of the current update.
      # @param supers_job [Eco::API::Session::Batch::Job] the job that will run the supers .
      # @param options [Hash] the options.
      def set_core_with_supervisor(entry, person, people, supers_job, options)
        unless options.dig(:exclude, :core) && !person.new?
          micro.set_core(entry, person, options)
          micro.set_supervisor(entry.supervisor_id, person, people, options) do |unkown_id|
            # delay setting supervisor if does not exit
            supers_job.add(person) {|person| person.supervisor_id = unkown_id}
          end
        end
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
eco-helpers-1.5.10 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.9 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.8 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.7 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.6 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.5 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.4 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.3 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-1.5.2 lib/eco/api/microcases/set_core_with_supervisor.rb