Class: EsignaturesWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/esignatures_worker.rb

Instance Method Summary collapse

Instance Method Details

#performObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/workers/esignatures_worker.rb', line 5

def perform
    Agreement.pending.each do |agreement|
        status = Api::Esignatures.contract_status(agreement.contract_number)
        case status 
        when 'signed'
            agreement.sign
        when 'withdrawn'
            agreement.decline
        end
    end
end