Create domain renew action

This commit is contained in:
Karl Erik Õunapuu 2021-01-21 13:08:54 +02:00
parent 454433cf10
commit dcb55a1af9
No known key found for this signature in database
GPG key ID: C9DD647298A34764
2 changed files with 36 additions and 2 deletions

View file

@ -0,0 +1,33 @@
module Actions
class DomainRenew
attr_reader :domain
attr_reader :params
attr_reader :user
def initialize(domain, params, user)
@domain = domain
@params = params
@user = user
end
def call
renew
end
def renew
period = params[:period]
unit = params[:period_unit]
task = Domains::BulkRenew::SingleDomainRenew.run(domain: domain,
period: params[:period],
unit: params[:period_unit],
registrar: user)
return true if task
puts task.errors
false
end
end
end