mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Fix some interaction calls
This commit is contained in:
parent
289d06e926
commit
c6f0c3f6a7
9 changed files with 30 additions and 25 deletions
|
@ -2,10 +2,10 @@ module Domains
|
||||||
module CancelForceDelete
|
module CancelForceDelete
|
||||||
class CancelForceDelete < Base
|
class CancelForceDelete < Base
|
||||||
def execute
|
def execute
|
||||||
compose(RemoveForceDeleteStatuses, inputs)
|
compose(RemoveForceDeleteStatuses, inputs.to_h)
|
||||||
compose(RestoreStatusesBeforeForceDelete, inputs)
|
compose(RestoreStatusesBeforeForceDelete, inputs.to_h)
|
||||||
compose(ClearForceDeleteData, inputs)
|
compose(ClearForceDeleteData, inputs.to_h)
|
||||||
compose(NotifyRegistrar, inputs)
|
compose(NotifyRegistrar, inputs.to_h)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ module Domains
|
||||||
WhoisRecord.where(domain_id: domain.id).destroy_all
|
WhoisRecord.where(domain_id: domain.id).destroy_all
|
||||||
|
|
||||||
domain.destroy
|
domain.destroy
|
||||||
compose(Domains::Delete::NotifyRegistrar, inputs)
|
Domains::Delete::NotifyRegistrar.run(inputs.to_h)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,9 +7,9 @@ module Domains
|
||||||
|
|
||||||
case action
|
case action
|
||||||
when RegistrantVerification::CONFIRMED
|
when RegistrantVerification::CONFIRMED
|
||||||
compose(ProcessDeleteConfirmed, inputs)
|
compose(ProcessDeleteConfirmed, inputs.to_h)
|
||||||
when RegistrantVerification::REJECTED
|
when RegistrantVerification::REJECTED
|
||||||
compose(ProcessDeleteRejected, inputs)
|
compose(ProcessDeleteRejected, inputs.to_h)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,12 +2,12 @@ module Domains
|
||||||
module ForceDelete
|
module ForceDelete
|
||||||
class SetForceDelete < Base
|
class SetForceDelete < Base
|
||||||
def execute
|
def execute
|
||||||
compose(CheckDiscarded, inputs)
|
compose(CheckDiscarded, inputs.to_h)
|
||||||
compose(PrepareDomain, inputs)
|
compose(PrepareDomain, inputs.to_h)
|
||||||
compose(SetStatus, inputs)
|
compose(SetStatus, inputs.to_h)
|
||||||
compose(PostSetProcess, inputs)
|
compose(PostSetProcess, inputs.to_h)
|
||||||
compose(NotifyRegistrar, inputs)
|
compose(NotifyRegistrar, inputs.to_h)
|
||||||
compose(NotifyByEmail, inputs)
|
compose(NotifyByEmail, inputs.to_h)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,9 +7,9 @@ module Domains
|
||||||
|
|
||||||
case action
|
case action
|
||||||
when RegistrantVerification::CONFIRMED
|
when RegistrantVerification::CONFIRMED
|
||||||
compose(ProcessUpdateConfirmed, inputs)
|
Domains::UpdateConfirm::ProcessUpdateConfirmed.run(inputs.to_h)
|
||||||
when RegistrantVerification::REJECTED
|
when RegistrantVerification::REJECTED
|
||||||
compose(ProcessUpdateRejected, inputs)
|
Domains::UpdateConfirm::ProcessUpdateRejected.run(inputs.to_h)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ module Whois
|
||||||
Array(names).each do |name|
|
Array(names).each do |name|
|
||||||
record = find_record(klass, name)
|
record = find_record(klass, name)
|
||||||
if record
|
if record
|
||||||
Whois::UpdateRecord.run(record: record, type: type)
|
Whois::UpdateRecord.run(record: { klass: klass.to_s, id: record.id, type: type })
|
||||||
else
|
else
|
||||||
Whois::DeleteRecord.run(name: name, type: type)
|
Whois::DeleteRecord.run(name: name, type: type)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
module Whois
|
module Whois
|
||||||
class UpdateRecord < ActiveInteraction::Base
|
class UpdateRecord < ActiveInteraction::Base
|
||||||
interface :record
|
hash :record do
|
||||||
|
string :klass
|
||||||
|
integer :id
|
||||||
string :type
|
string :type
|
||||||
|
end
|
||||||
validates :type, inclusion: { in: %w[reserved blocked domain disputed zone] }
|
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
send "update_#{type}", record
|
data = record['klass'].constantize.find_by(id: record['id'])
|
||||||
|
send "update_#{record['type']}", data
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_domain(domain)
|
def update_domain(domain)
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
class DomainUpdateConfirmJob < ApplicationJob
|
class DomainUpdateConfirmJob < ApplicationJob
|
||||||
def perform(domain_id, action, initiator = nil)
|
def perform(domain_id, action, initiator = nil)
|
||||||
domain = Epp::Domain.find(domain_id)
|
domain = Epp::Domain.find(domain_id)
|
||||||
Domains::UpdateConfirm::ProcessAction.run(domain: domain,
|
attrs = {
|
||||||
|
domain: domain,
|
||||||
action: action,
|
action: action,
|
||||||
initiator: initiator)
|
initiator: initiator,
|
||||||
|
}
|
||||||
|
Domains::UpdateConfirm::ProcessAction.run(attrs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -56,7 +56,7 @@ class DisputeStatusUpdateJobTest < ActiveJob::TestCase
|
||||||
|
|
||||||
# Dispute status is added automatically if starts_at is not in future
|
# Dispute status is added automatically if starts_at is not in future
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
Dispute.create(domain_name: 'shop.test', starts_at: Time.zone.parse('2010-07-05'))
|
Dispute.create(domain_name: 'shop.test', starts_at: Time.zone.today)
|
||||||
end
|
end
|
||||||
domain.reload
|
domain.reload
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue