Add pull messages on soft force delete & force delete cancel

This commit is contained in:
Alex Sherman 2020-01-13 16:40:40 +05:00
parent c863cb2678
commit 222ac639ac
4 changed files with 14 additions and 1 deletions

View file

@ -57,6 +57,7 @@ module Concerns::Domain::ForceDelete
self.force_delete_date = nil
self.force_delete_start = nil
save(validate: false)
registrar.notifications.create!(text: I18n.t('force_delete_cancelled', domain_name: name))
end
private

View file

@ -94,7 +94,7 @@ class DomainCron
domain.statuses << DomainStatus::CLIENT_HOLD
log_start_client_hold(domain)
domain.save(validate: false) and marked += 1
domain.save(validate: false) and marked += 1 and notify_client_hold(domain)
end
log_end_end_client_hold(marked: marked, real: real)
@ -120,4 +120,10 @@ class DomainCron
STDOUT << "#{Time.zone.now.utc} - Successfully set client_hold to #{marked} of #{real} "\
"domains\n"
end
def self.notify_client_hold(domain)
domain.registrar.notifications.create!(text: I18n.t('soft_force_delete_set_on_domain',
domain_name: domain.name,
start_date: domain.force_delete_start))
end
end

View file

@ -619,6 +619,8 @@ en:
created_at_until: 'Created at until'
is_registrant: 'Is registrant'
force_delete_set_on_domain: 'Force delete set on domain %{domain_name}'
soft_force_delete_set_on_domain: 'clientHold status is set for domain %{domain_name}, ForceDelete is in effect from %{start_date}'
force_delete_cancelled: 'Force delete is cancelled on domain %{domain_name}'
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
next: 'Next'
previous: 'Previous'

View file

@ -46,6 +46,10 @@ if @cron_group == 'registry'
runner 'DomainCron.start_redemption_grace_period'
end
every 1.hour do
runner 'DomainCron.start_client_hold'
end
every '0 0 1 * *' do
runner 'Directo.send_monthly_invoices'
end