mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Merge remote-tracking branch 'origin/master' into 1422-record-payment-method-and-failed-payments
This commit is contained in:
commit
cb76a9f962
8 changed files with 118 additions and 4 deletions
|
@ -184,7 +184,8 @@ class Registrar
|
|||
:contacts_ident_eq,
|
||||
:nameservers_hostname_eq,
|
||||
:valid_to_gteq,
|
||||
:valid_to_lteq)
|
||||
:valid_to_lteq,
|
||||
:s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,7 +17,13 @@ class BankTransaction < ApplicationRecord
|
|||
end
|
||||
|
||||
def invoice
|
||||
@invoice ||= registrar.invoices.find_by(total: sum) if registrar
|
||||
return unless registrar
|
||||
|
||||
@invoice ||= registrar.invoices
|
||||
.order(created_at: :asc)
|
||||
.unpaid
|
||||
.non_cancelled
|
||||
.find_by(total: sum)
|
||||
end
|
||||
|
||||
def registrar
|
||||
|
|
|
@ -25,7 +25,8 @@ module Concerns::Domain::ForceDelete # rubocop:disable Metrics/ModuleLength
|
|||
|
||||
def should_notify_on_soft_force_delete?
|
||||
force_delete_scheduled? && contact_notification_sent_date.blank? &&
|
||||
force_delete_start.to_date <= Time.zone.now.to_date && force_delete_type.to_sym == :soft
|
||||
force_delete_start.to_date <= Time.zone.now.to_date && force_delete_type.to_sym == :soft &&
|
||||
!statuses.include?(DomainStatus::CLIENT_HOLD)
|
||||
end
|
||||
|
||||
def client_holdable?
|
||||
|
|
|
@ -11,8 +11,9 @@ module Concerns
|
|||
|
||||
::Domain.force_delete_scheduled.each do |domain|
|
||||
proceed_client_hold(domain: domain)
|
||||
log_end_end_client_hold(domain)
|
||||
end
|
||||
|
||||
log_end_end_force_delete_job
|
||||
end
|
||||
|
||||
def proceed_client_hold(domain:)
|
||||
|
@ -24,6 +25,8 @@ module Concerns
|
|||
|
||||
domain.save(validate: false)
|
||||
notify_client_hold(domain)
|
||||
|
||||
log_end_end_client_hold(domain)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -22,6 +22,12 @@ module Concerns
|
|||
|
||||
STDOUT << "#{Time.zone.now.utc} - Successfully set client_hold on (#{domain.name})"
|
||||
end
|
||||
|
||||
def log_end_end_force_delete_job
|
||||
return if Rails.env.test?
|
||||
|
||||
STDOUT << "#{Time.zone.now.utc} - All client_hold setting are done\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue