mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 12:47:29 +02:00
Rename admin_domain_contacts_attributes to admin_contacts
This commit is contained in:
parent
e2f377f1c2
commit
83bfc493bb
4 changed files with 11 additions and 12 deletions
|
@ -35,9 +35,9 @@ module Repp
|
||||||
param :ipv4, Array, desc: 'Array of IPv4 addresses'
|
param :ipv4, Array, desc: 'Array of IPv4 addresses'
|
||||||
param :ipv6, Array, desc: 'Array of IPv4 addresses'
|
param :ipv6, Array, desc: 'Array of IPv4 addresses'
|
||||||
end
|
end
|
||||||
param :admin_domain_contacts_attributes, Array, required: false,
|
param :admin_contacts, Array, required: false,
|
||||||
desc: 'Admin domain contacts codes'
|
desc: 'Admin domain contacts codes'
|
||||||
param :tech_domain_contacts_attributes, Array, required: false,
|
param :tech_contacts, Array, required: false,
|
||||||
desc: 'Tech domain contacts codes'
|
desc: 'Tech domain contacts codes'
|
||||||
param :dnskeys_attributes, Array, required: false, desc: 'DNSSEC keys for domain' do
|
param :dnskeys_attributes, Array, required: false, desc: 'DNSSEC keys for domain' do
|
||||||
param_group :dns_keys_apidoc, Repp::V1::Domains::DnssecController
|
param_group :dns_keys_apidoc, Repp::V1::Domains::DnssecController
|
||||||
|
@ -219,8 +219,8 @@ module Repp
|
||||||
params.require(:domain).permit(:name, :registrant_id, :period, :period_unit, :registrar_id,
|
params.require(:domain).permit(:name, :registrant_id, :period, :period_unit, :registrar_id,
|
||||||
dnskeys_attributes: [%i[flags alg protocol public_key]],
|
dnskeys_attributes: [%i[flags alg protocol public_key]],
|
||||||
nameservers_attributes: [[:hostname, ipv4: [], ipv6: []]],
|
nameservers_attributes: [[:hostname, ipv4: [], ipv6: []]],
|
||||||
admin_domain_contacts_attributes: [],
|
admin_contacts: [],
|
||||||
tech_domain_contacts_attributes: [])
|
tech_contacts: [])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -129,8 +129,8 @@ module Actions
|
||||||
def assign_domain_contacts
|
def assign_domain_contacts
|
||||||
@admin_contacts = []
|
@admin_contacts = []
|
||||||
@tech_contacts = []
|
@tech_contacts = []
|
||||||
params[:admin_domain_contacts_attributes]&.each { |c| assign_contact(c) }
|
params[:admin_contacts]&.each { |c| assign_contact(c) }
|
||||||
params[:tech_domain_contacts_attributes]&.each { |c| assign_contact(c, admin: false) }
|
params[:tech_contacts]&.each { |c| assign_contact(c, admin: false) }
|
||||||
|
|
||||||
domain.admin_domain_contacts_attributes = @admin_contacts
|
domain.admin_domain_contacts_attributes = @admin_contacts
|
||||||
domain.tech_domain_contacts_attributes = @tech_contacts
|
domain.tech_domain_contacts_attributes = @tech_contacts
|
||||||
|
@ -144,8 +144,7 @@ module Actions
|
||||||
domain.expire_time = calculate_expiry(period)
|
domain.expire_time = calculate_expiry(period)
|
||||||
end
|
end
|
||||||
|
|
||||||
def calculate_expiry(period)
|
def calculate_expiry(period) plural_period_unit_name = (domain.period_unit == 'm' ? 'months' : 'years').to_sym
|
||||||
plural_period_unit_name = (domain.period_unit == 'm' ? 'months' : 'years').to_sym
|
|
||||||
(Time.zone.now.advance(plural_period_unit_name => period) + 1.day).beginning_of_day
|
(Time.zone.now.advance(plural_period_unit_name => period) + 1.day).beginning_of_day
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ module Deserializers
|
||||||
|
|
||||||
def call
|
def call
|
||||||
obj = domain
|
obj = domain
|
||||||
obj[:admin_domain_contacts_attributes] = admin_contacts
|
obj[:admin_contacts] = admin_contacts
|
||||||
obj[:tech_domain_contacts_attributes] = tech_contacts
|
obj[:tech_contacts] = tech_contacts
|
||||||
obj[:nameservers_attributes] = nameservers
|
obj[:nameservers_attributes] = nameservers
|
||||||
obj[:dnskeys_attributes] = dns_keys
|
obj[:dnskeys_attributes] = dns_keys
|
||||||
obj[:legal_document] = legal_document
|
obj[:legal_document] = legal_document
|
||||||
|
|
|
@ -94,8 +94,8 @@ class ReppV1DomainsCreateTest < ActionDispatch::IntegrationTest
|
||||||
registrant_id: contact.code,
|
registrant_id: contact.code,
|
||||||
period: 1,
|
period: 1,
|
||||||
period_unit: 'y',
|
period_unit: 'y',
|
||||||
admin_domain_contacts_attributes: [ admin_contact.code ],
|
admin_contacts: [ admin_contact.code ],
|
||||||
tech_domain_contacts_attributes: [ tech_contact.code ],
|
tech_contacts: [ tech_contact.code ],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue