Sha256: 223f6f8fff3e759eec214ccafa6eb69d59ccb453c47d692f7cb621bd92d876ba

Contents?: true

Size: 1.22 KB

Versions: 98

Compression:

Stored size: 1.22 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)
          if entry.supervisor_id?
            micro.set_supervisor(person, entry.supervisor_id, people, options) do |unknown_id|
              # delay setting supervisor if does not exit
              supers_job.add(person) do |person|
                micro.set_supervisor(person, unknown_id, people, options)
              end
            end
          end
        end
      end

    end
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
eco-helpers-2.0.63 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.62 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.61 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.60 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.59 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.58 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.57 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.56 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.55 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.54 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.53 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.52 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.51 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.50 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.49 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.48 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.47 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.46 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.45 lib/eco/api/microcases/set_core_with_supervisor.rb
eco-helpers-2.0.44 lib/eco/api/microcases/set_core_with_supervisor.rb