6
7
8
9
10
11
12
13
14
15
|
# File 'app/workers/accounting_document_transmission_worker.rb', line 6
def perform(document_class, document_id)
logger.info "Accounting document transmission worker starting and looking for #{document_class} ID: #{document_id}"
error_messages = []
doc = document_class.classify.constantize.where(id: document_id).first
raise "Unable to find #{document_class} ID: #{document_id}" if doc.nil?
return true if doc.transmitted?
comm = CommunicationBuilder.new(resource: doc).create
logger.info "#{document_class} ID: #{document_id} transmission worker completed"
end
|