mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Set validation to prohibit ManualInzone with any of the *Hold statuses
This commit is contained in:
parent
25e0b61a15
commit
ffde929540
4 changed files with 34 additions and 6 deletions
|
@ -1,6 +1,12 @@
|
|||
module Concerns::Domain::Deletable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
DELETE_STATUSES = [
|
||||
DomainStatus::PENDING_DELETE_CONFIRMATION,
|
||||
DomainStatus::PENDING_DELETE,
|
||||
DomainStatus::FORCE_DELETE,
|
||||
].freeze
|
||||
|
||||
private
|
||||
|
||||
def delete_later
|
||||
|
|
|
@ -11,6 +11,11 @@ module Concerns::Domain::ForceDelete # rubocop:disable Metrics/ModuleLength
|
|||
lambda {
|
||||
where("(force_delete_data->>'contact_notification_sent_date') is null")
|
||||
}
|
||||
|
||||
HOLD_STATUSES = [
|
||||
DomainStatus::SERVER_HOLD,
|
||||
DomainStatus::CLIENT_HOLD,
|
||||
].freeze
|
||||
end
|
||||
|
||||
class_methods do
|
||||
|
@ -19,6 +24,10 @@ module Concerns::Domain::ForceDelete # rubocop:disable Metrics/ModuleLength
|
|||
end
|
||||
end
|
||||
|
||||
def hold_status?
|
||||
HOLD_STATUSES.any? { |status| statuses.include? status }
|
||||
end
|
||||
|
||||
def notification_template(explicit: nil)
|
||||
reason = explicit&.downcase
|
||||
return reason if %w[invalid_email invalid_phone].include?(reason)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue