otvorenesudy/otvorenesudy-api

View on GitHub
app/jobs/reconcile_decree_job.rb

Summary

Maintainability
A
20 mins
Test Coverage
A
100%
class ReconcileDecreeJob < ApplicationJob
  queue_as :reconcilers

  def perform(record)
    mapper = record.to_mapper
    decree = DecreeFinder.find_by(mapper) || Decree.new(uri: mapper.uri)
    reconciler = DecreeReconciler.new(decree, mapper: mapper)

    reconciler.reconcile!

    UpdateNotifier.notify(decree)
  end
end