mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Add disputing logic for EPP
This commit is contained in:
parent
7a7b2f9881
commit
0f2a290d64
17 changed files with 626 additions and 325 deletions
|
@ -90,6 +90,7 @@ class Domain < ApplicationRecord
|
|||
validates :transfer_code, presence: true
|
||||
|
||||
validate :validate_reservation
|
||||
|
||||
def validate_reservation
|
||||
return if persisted? || !in_reserved_list?
|
||||
|
||||
|
@ -99,6 +100,7 @@ class Domain < ApplicationRecord
|
|||
end
|
||||
|
||||
return if ReservedDomain.pw_for(name) == reserved_pw
|
||||
|
||||
errors.add(:base, :invalid_auth_information_reserved)
|
||||
end
|
||||
|
||||
|
@ -170,7 +172,7 @@ class Domain < ApplicationRecord
|
|||
end
|
||||
|
||||
attr_accessor :registrant_typeahead, :update_me,
|
||||
:epp_pending_update, :epp_pending_delete, :reserved_pw
|
||||
:epp_pending_update, :epp_pending_delete, :reserved_pw, :disputed_pw
|
||||
|
||||
self.ignored_columns = %w[legacy_id legacy_registrar_id legacy_registrant_id]
|
||||
|
||||
|
@ -275,6 +277,10 @@ class Domain < ApplicationRecord
|
|||
@in_reserved_list ||= ReservedDomain.by_domain(name).any?
|
||||
end
|
||||
|
||||
def disputed?
|
||||
Dispute.active.where(domain_name: name).any?
|
||||
end
|
||||
|
||||
def pending_transfer
|
||||
transfers.find_by(status: DomainTransfer::PENDING)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue