mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Add interactor for renewal
This commit is contained in:
parent
c0fc7ebca9
commit
7dd3005bf3
3 changed files with 18 additions and 3 deletions
|
@ -13,7 +13,9 @@ class Registrar
|
||||||
@expire_date = params[:expire_date].to_date
|
@expire_date = params[:expire_date].to_date
|
||||||
@domains = domains_by_date(@expire_date)
|
@domains = domains_by_date(@expire_date)
|
||||||
if domain_ids_for_bulk_renew.present?
|
if domain_ids_for_bulk_renew.present?
|
||||||
flash[:notice] = t(:bulk_renew_enqueued)
|
domains = Epp::Domain.where(id: domain_ids_for_bulk_renew).to_a
|
||||||
|
task = Domains::BulkRenew::Start.run(domains: domains)
|
||||||
|
flash[:notice] = t(:bulk_renew_completed)
|
||||||
end
|
end
|
||||||
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
|
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
|
||||||
end
|
end
|
||||||
|
@ -37,7 +39,7 @@ class Registrar
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_ids_for_bulk_renew
|
def domain_ids_for_bulk_renew
|
||||||
params.dig('domain_ids').reject{ |id| id.blank? }
|
params.dig('domain_ids')&.reject{ |id| id.blank? }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
13
app/interactions/domains/bulk_renew/start.rb
Normal file
13
app/interactions/domains/bulk_renew/start.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
module Domains
|
||||||
|
module BulkRenew
|
||||||
|
class Start < ActiveInteraction::Base
|
||||||
|
array :domains do
|
||||||
|
object class: Epp::Domain
|
||||||
|
end
|
||||||
|
|
||||||
|
def execute
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -662,4 +662,4 @@ en:
|
||||||
iban: IBAN
|
iban: IBAN
|
||||||
sign_in: "Sign in"
|
sign_in: "Sign in"
|
||||||
signed_in_successfully: "Signed in successfully"
|
signed_in_successfully: "Signed in successfully"
|
||||||
bulk_renew_enqueued: "Bulk renew for domains was enqueued"
|
bulk_renew_completed: "Bulk renew for domains completed"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue