mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 12:17:30 +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 :ipv6, Array, desc: 'Array of IPv4 addresses'
|
||||
end
|
||||
param :admin_domain_contacts_attributes, Array, required: false,
|
||||
param :admin_contacts, Array, required: false,
|
||||
desc: 'Admin domain contacts codes'
|
||||
param :tech_domain_contacts_attributes, Array, required: false,
|
||||
param :tech_contacts, Array, required: false,
|
||||
desc: 'Tech domain contacts codes'
|
||||
param :dnskeys_attributes, Array, required: false, desc: 'DNSSEC keys for domain' do
|
||||
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,
|
||||
dnskeys_attributes: [%i[flags alg protocol public_key]],
|
||||
nameservers_attributes: [[:hostname, ipv4: [], ipv6: []]],
|
||||
admin_domain_contacts_attributes: [],
|
||||
tech_domain_contacts_attributes: [])
|
||||
admin_contacts: [],
|
||||
tech_contacts: [])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -129,8 +129,8 @@ module Actions
|
|||
def assign_domain_contacts
|
||||
@admin_contacts = []
|
||||
@tech_contacts = []
|
||||
params[:admin_domain_contacts_attributes]&.each { |c| assign_contact(c) }
|
||||
params[:tech_domain_contacts_attributes]&.each { |c| assign_contact(c, admin: false) }
|
||||
params[:admin_contacts]&.each { |c| assign_contact(c) }
|
||||
params[:tech_contacts]&.each { |c| assign_contact(c, admin: false) }
|
||||
|
||||
domain.admin_domain_contacts_attributes = @admin_contacts
|
||||
domain.tech_domain_contacts_attributes = @tech_contacts
|
||||
|
@ -144,8 +144,7 @@ module Actions
|
|||
domain.expire_time = calculate_expiry(period)
|
||||
end
|
||||
|
||||
def calculate_expiry(period)
|
||||
plural_period_unit_name = (domain.period_unit == 'm' ? 'months' : 'years').to_sym
|
||||
def calculate_expiry(period) 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
|
||||
end
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ module Deserializers
|
|||
|
||||
def call
|
||||
obj = domain
|
||||
obj[:admin_domain_contacts_attributes] = admin_contacts
|
||||
obj[:tech_domain_contacts_attributes] = tech_contacts
|
||||
obj[:admin_contacts] = admin_contacts
|
||||
obj[:tech_contacts] = tech_contacts
|
||||
obj[:nameservers_attributes] = nameservers
|
||||
obj[:dnskeys_attributes] = dns_keys
|
||||
obj[:legal_document] = legal_document
|
||||
|
|
|
@ -94,8 +94,8 @@ class ReppV1DomainsCreateTest < ActionDispatch::IntegrationTest
|
|||
registrant_id: contact.code,
|
||||
period: 1,
|
||||
period_unit: 'y',
|
||||
admin_domain_contacts_attributes: [ admin_contact.code ],
|
||||
tech_domain_contacts_attributes: [ tech_contact.code ],
|
||||
admin_contacts: [ admin_contact.code ],
|
||||
tech_contacts: [ tech_contact.code ],
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue