remove logs, fixed company register status job

This commit is contained in:
oleghasjanov 2024-09-27 14:05:05 +03:00
parent 6f8a4a478f
commit ba9aeb437d
6 changed files with 6 additions and 19 deletions

View file

@ -9,7 +9,6 @@ module Domains
compose(NotifyRegistrar, inputs.to_h)
compose(NotifyByEmail, inputs.to_h)
compose(NotifyMultiyearsExpirationDomain, inputs.to_h)
puts "SetForceDelete has been executed"
end
end
end

View file

@ -50,7 +50,7 @@ class CompanyRegisterStatusJob < ApplicationJob
end
def schedule_force_delete(contact)
contact.domains.each do |domain|
contact.registrant_domains.each do |domain|
next if domain.force_delete_scheduled?
domain.schedule_force_delete(
@ -63,13 +63,13 @@ class CompanyRegisterStatusJob < ApplicationJob
end
def check_for_force_delete(contact)
contact.domains.any? && domain.status_notes[DomainStatus::FORCE_DELETE].include?("Company no: #{contact.ident}") do |domain|
contact.registrant_domains.any? && domain.status_notes[DomainStatus::FORCE_DELETE].include?("Company no: #{contact.ident}") do |domain|
domain.force_delete_scheduled?
end
end
def lift_force_delete(contact)
contact.domains.each(&:lift_force_delete)
contact.registrant_domains.each(&:lift_force_delete)
end
def delete_process(contact)
@ -97,7 +97,7 @@ class CompanyRegisterStatusJob < ApplicationJob
end
def soft_delete_company(contact)
contact.domains.reject { |domain| domain.force_delete_scheduled? }.each do |domain|
contact.registrant_domains.reject { |domain| domain.force_delete_scheduled? }.each do |domain|
domain.schedule_force_delete(type: :soft)
end

View file

@ -48,7 +48,6 @@ module Domain::ForceDelete
end
def schedule_force_delete(type: :fast_track, notify_by_email: false, reason: nil, email: nil)
puts "Schedule force delete for domain: #{name} with type: #{type}"
Domains::ForceDelete::SetForceDelete.run(domain: self, type: type, reason: reason,
notify_by_email: notify_by_email, email: email)
end

View file

@ -87,9 +87,6 @@ class Contact < ApplicationRecord
after_save :update_related_whois_records
before_validation :clear_address_modifications, if: -> { !self.class.address_processing? }
# after_save :validate_email_by_regex_and_mx
# after_save :remove_force_delete_for_valid_contact
self.ignored_columns = %w[legacy_id legacy_history_id]
ORG = 'org'.freeze

View file

@ -38,6 +38,8 @@ class Domain < ApplicationRecord
:epp_pending_delete,
:reserved_pw
attr_accessor :skip_multiyears_expiration_email_validation
alias_attribute :on_hold_time, :outzone_at
alias_attribute :outzone_time, :outzone_at
alias_attribute :auth_info, :transfer_code # Old attribute name; for PaperTrail

View file

@ -195,19 +195,9 @@ namespace :company_status do
end
def soft_delete_company(contact)
# contact.domains.reject { |domain| domain.force_delete_scheduled? }.each do |domain|
# domain.schedule_force_delete(type: :soft)
# end
#
puts "Try to set soft delete for company: #{contact.name} with ID: #{contact.id}"
puts "Contact (registrant) domains: #{contact.registrant_domains.map(&:name)}"
contact.registrant_domains.each do |domain|
puts "Domain: #{domain.name} with force delete scheduled: #{domain.force_delete_scheduled?}"
next if domain.force_delete_scheduled?
puts "Try to set soft delete for domain: #{domain.name}"
domain.schedule_force_delete(type: :soft)
puts "Soft delete process initiated for company: #{contact.name} with ID: #{contact.id} domain: #{domain.name}"
end