mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +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
|
||||
@domains = domains_by_date(@expire_date)
|
||||
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
|
||||
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
|
||||
end
|
||||
|
@ -37,7 +39,7 @@ class Registrar
|
|||
end
|
||||
|
||||
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
|
||||
|
|
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
|
||||
sign_in: "Sign in"
|
||||
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