internetee-registry/app/jobs/validation_event_check_force_delete_job.rb
2022-04-28 12:29:24 +03:00

12 lines
347 B
Ruby

class ValidationEventCheckForceDeleteJob < ApplicationJob
def perform(event_id, contact_id)
event = ValidationEvent.find(event_id)
contact = Contact.find(contact_id)
if contact.need_to_start_force_delete?
event.start_force_delete
elsif contact.need_to_lift_force_delete?
event.refresh_status_notes
end
end
end