Sha256: 728f291ad729604081c46583e85d69bd0ec67af365a6d1ebeccb84dc1d13234f

Contents?: true

Size: 887 Bytes

Versions: 162

Compression:

Stored size: 887 Bytes

Contents

# Helper class to create a custom `Policy`
# @example Example of usage:
#  class Custom::Policy::StartersNLeavers < Eco::API::Custom::Policy
#    name "starters'n'leavers"
#
#    INACTIVE = "Non active"
#
#    def main(people, session, options, policy, job)
#      people.each do |person|
#        next unless details = person.details
#        # starters
#        if person.new?
#          details["status"]       = "Active"
#          details["hris-managed"] = true unless options.dig(:include, :excluded)
#        end
#
#        # leavers: native job queue to remove account
#        if job.name == "leavers"
#          details["status"]    = INACTIVE
#          person.external_id   = person.name
#          details["staff-id"]  = person.name
#        end
#      end
#    end
#
#  end
class Eco::API::Custom::Policy < Eco::API::Common::Loaders::Policy
end

Version data entries

162 entries across 162 versions & 1 rubygems

Version Path
eco-helpers-2.1.2 lib/eco/api/custom/policy.rb
eco-helpers-2.1.1 lib/eco/api/custom/policy.rb
eco-helpers-2.0.68 lib/eco/api/custom/policy.rb
eco-helpers-2.0.67 lib/eco/api/custom/policy.rb
eco-helpers-2.0.66 lib/eco/api/custom/policy.rb
eco-helpers-2.0.65 lib/eco/api/custom/policy.rb
eco-helpers-2.0.64 lib/eco/api/custom/policy.rb
eco-helpers-2.0.63 lib/eco/api/custom/policy.rb
eco-helpers-2.0.62 lib/eco/api/custom/policy.rb
eco-helpers-2.0.61 lib/eco/api/custom/policy.rb
eco-helpers-2.0.60 lib/eco/api/custom/policy.rb
eco-helpers-2.0.59 lib/eco/api/custom/policy.rb
eco-helpers-2.0.58 lib/eco/api/custom/policy.rb
eco-helpers-2.0.57 lib/eco/api/custom/policy.rb
eco-helpers-2.0.56 lib/eco/api/custom/policy.rb
eco-helpers-2.0.55 lib/eco/api/custom/policy.rb
eco-helpers-2.0.54 lib/eco/api/custom/policy.rb
eco-helpers-2.0.53 lib/eco/api/custom/policy.rb
eco-helpers-2.0.52 lib/eco/api/custom/policy.rb
eco-helpers-2.0.51 lib/eco/api/custom/policy.rb