class Eco::API::UseCases::Default::People::Amend::ReinviteTransCase < Eco::API::Common::Loaders::UseCase name "reinvite" type :transform def main(*_args) reinvite(people.users) end private def reinvite(users) invite = session.new_job("main", "invite", :update, usecase, :account) users.each do |person| if force_invite? person.account.force_send_invites = true else person.account.send_invites = true end invite.add(person) end end def force_invite? options.dig(:force, :invite) end end