Sha256: 9d1c43bd8732b9589a8bb49673404acd12e509b2060cfc7a2459b377346e83d5
Contents?: true
Size: 1.39 KB
Versions: 26
Compression:
Stored size: 1.39 KB
Contents
module Eco module API class UseCases class DefaultCases class ReinviteCase < DefaultCase def process @cases.define("reinvite", type: :transform) do |people, session, options, usecase| invite = session.job_group("main").new("invite", usecase: usecase, type: :update, sets: :account) people.users.each do |person| person.account.send_invites = true invite.add(person) end invite end @cases.define("reinvite", type: :sync) do |entries, people, session, options, usecase| invite = session.job_group("main").new("invite", usecase: usecase, type: :update, sets: :account) users = people.users strict_search = session.config.people.strict_search? && (!options[:search]&.key?(:strict) || options.dig(:search, :strict)) entries.each_with_index do |entry, i| if person = people.find(entry, strict: strict_search) person.account.send_invites = true invite.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
26 entries across 26 versions & 1 rubygems