Updated

app/use_cases/accounts/contacts/events / send_now.rb

A
15 lines of codes
1 methods
14.9 complexity/method
10 churn
14.93 complexity
0 duplications
class Accounts::Contacts::Events::SendNow
  1. Accounts::Contacts::Events::SendNow has no descriptive comment
def self.call(event) event.send_now = nil if event.chatwoot_message? || event.evolution_api_message?
  1. Accounts::Contacts::Events::SendNow#self.call calls 'event.chatwoot_message?' 2 times Locations: 0 1
  2. Accounts::Contacts::Events::SendNow#self.call calls 'event.evolution_api_message?' 2 times Locations: 0 1
event.update(scheduled_at: DateTime.current, auto_done: false) if event.chatwoot_message?
  1. Accounts::Contacts::Events::SendNow#self.call calls 'event.chatwoot_message?' 2 times Locations: 0 1
Accounts::Apps::Chatwoots::Messages::DeliveryJob.perform_later(event.id)
  1. Accounts::Contacts::Events::SendNow#self.call calls 'event.id' 2 times Locations: 0 1
elsif event.evolution_api_message?
  1. Accounts::Contacts::Events::SendNow#self.call calls 'event.evolution_api_message?' 2 times Locations: 0 1
Accounts::Apps::EvolutionApis::Message::DeliveryJob.perform_later(event.id)
  1. Accounts::Contacts::Events::SendNow#self.call calls 'event.id' 2 times Locations: 0 1
end else event.update(done: true) end end end