internetee-registry/lib/serializers/registrant_api/contact.rb
oleghasjanov c256a1290a feat: Add system disclosed attributes for contact phone numbers
- Add system_disclosed_attributes array column to contacts table
- Update OrgRegistrantPhoneCheckerJob to manage both user and system disclosed attributes
- Include system_disclosed_attributes in contact API serializer

This change introduces a new way to track system-level disclosure of contact
attributes, separate from user-defined disclosures. When a phone number matches
the company register data, it will be marked as disclosed both in user and
system attributes. This allows better tracking of which attributes were
automatically disclosed by the system versus manually disclosed by users.
2025-06-27 12:27:59 +03:00

44 lines
1.2 KiB
Ruby

module Serializers
module RegistrantApi
class Contact
attr_reader :contact, :links
def initialize(contact, links)
@contact = contact
@links = links
end
def to_json(_obj = nil)
obj = {
id: contact.uuid,
name: contact.name,
code: contact.code,
ident: {
code: contact.ident,
type: contact.ident_type,
country_code: contact.ident_country_code,
},
email: contact.email,
phone: contact.phone,
fax: contact.fax,
address: {
street: contact.street,
zip: contact.zip,
city: contact.city,
state: contact.state,
country_code: contact.country_code,
},
auth_info: contact.auth_info,
statuses: contact.statuses,
disclosed_attributes: contact.disclosed_attributes,
system_disclosed_attributes: contact.system_disclosed_attributes,
registrant_publishable: contact.registrant_publishable,
}
obj[:links] = contact.related_domains if @links
obj
end
end
end
end