mirror of
https://github.com/internetee/registry.git
synced 2025-05-29 17:10:08 +02:00
Story#129684535 updaet deletion and outzone and do not use time when to expire
This commit is contained in:
parent
6c177bcbe4
commit
06c92b1cfe
1 changed files with 6 additions and 6 deletions
|
@ -546,7 +546,7 @@ class Domain < ActiveRecord::Base
|
||||||
self.registered_at = Time.zone.now
|
self.registered_at = Time.zone.now
|
||||||
self.valid_from = Time.zone.now
|
self.valid_from = Time.zone.now
|
||||||
# we need + 1 day as this is more correct from juridical side
|
# we need + 1 day as this is more correct from juridical side
|
||||||
self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit) + 1.day
|
self.valid_to = valid_from.utc.beginning_of_day + self.class.convert_period_to_time(period, period_unit) + 1.day
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
|
@ -577,7 +577,7 @@ class Domain < ActiveRecord::Base
|
||||||
statuses << DomainStatus::SERVER_MANUAL_INZONE
|
statuses << DomainStatus::SERVER_MANUAL_INZONE
|
||||||
end
|
end
|
||||||
|
|
||||||
self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).utc.beginning_of_day unless force_delete_at
|
self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days)).utc.beginning_of_day unless force_delete_at
|
||||||
transaction do
|
transaction do
|
||||||
save!(validate: false)
|
save!(validate: false)
|
||||||
registrar.messages.create!(
|
registrar.messages.create!(
|
||||||
|
@ -605,16 +605,16 @@ class Domain < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_graceful_expired
|
def set_graceful_expired
|
||||||
self.outzone_at = valid_to + Setting.expire_warning_period.days
|
self.outzone_at = (valid_to + Setting.expire_warning_period.days).utc.beginning_of_day
|
||||||
self.delete_at = (outzone_at + (Setting.redemption_grace_period.days + 1.day)).utc.beginning_of_day
|
self.delete_at = (outzone_at + Setting.redemption_grace_period.days).utc.beginning_of_day
|
||||||
self.statuses |= [DomainStatus::EXPIRED]
|
self.statuses |= [DomainStatus::EXPIRED]
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_expired
|
def set_expired
|
||||||
# TODO: currently valid_to attribute update logic is open
|
# TODO: currently valid_to attribute update logic is open
|
||||||
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
|
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
|
||||||
self.outzone_at = Time.zone.now + Setting.expire_warning_period.days
|
self.outzone_at = (valid_to + Setting.expire_warning_period.days).utc.beginning_of_day
|
||||||
self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).utc.beginning_of_day
|
self.delete_at = (outzone_at + Setting.redemption_grace_period.days).utc.beginning_of_day
|
||||||
statuses << DomainStatus::EXPIRED
|
statuses << DomainStatus::EXPIRED
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue