module Eco module API class MicroCases # @note by default `supervisor_id` is always excluded. # @param person [Ecoportal::API::V1::Person] the person we want to update, carrying the changes to be done. # @param options [Hash] the options. # @return [Array] the core parameters that should not be included. def core_excluded(person, options) ["supervisor_id"].tap do |core_excluded| can_exclude = person.new?? ["filter_tags"] : %w[name external_id email filter_tags] exclusions = can_exclude.select do |attr| options.dig(:exclude, attr.to_sym) end core_excluded.concat(exclusions) end end end end end