Merge remote-tracking branch 'origin/master' into registrant-api-fetch-improvements

This commit is contained in:
Karl Erik Õunapuu 2020-11-30 10:34:28 +02:00
commit 3761fe7bbd
No known key found for this signature in database
GPG key ID: C9DD647298A34764
97 changed files with 2824 additions and 821 deletions

BIN
lib/serializers/registrant_api/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,36 @@
module Serializers
module Repp
class Contact
attr_reader :contact
def initialize(contact, show_address:)
@contact = contact
@show_address = show_address
end
def to_json(obj = contact)
json = { id: obj.code, name: obj.name, ident: ident,
email: obj.email, phone: obj.phone, fax: obj.fax,
auth_info: obj.auth_info, statuses: obj.statuses,
disclosed_attributes: obj.disclosed_attributes }
json[:address] = address if @show_address
json
end
def ident
{
code: contact.ident,
type: contact.ident_type,
country_code: contact.ident_country_code,
}
end
def address
{ street: contact.street, zip: contact.zip, city: contact.city,
state: contact.state, country_code: contact.country_code }
end
end
end
end