mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
- Add environment variable 'allow_validate_business_contacts' to control business contact validation - Remove redundant company_is_relevant? method - Add integration test for skipping company validation
34 lines
727 B
Ruby
34 lines
727 B
Ruby
module Contact::CompanyRegister
|
|
extend ActiveSupport::Concern
|
|
|
|
REGISTERED = 'R'.freeze
|
|
LIQUIDATED = 'L'.freeze
|
|
BANKRUPT = 'N'.freeze
|
|
DELETED = 'K'.freeze
|
|
|
|
def return_company_status
|
|
return if return_company_data.blank?
|
|
|
|
return_company_data.first[:status]
|
|
end
|
|
|
|
def return_company_data
|
|
return unless org?
|
|
|
|
company_register.simple_data(registration_number: ident.to_s)
|
|
rescue CompanyRegister::NotAvailableError
|
|
[]
|
|
end
|
|
|
|
def return_company_details
|
|
return unless org?
|
|
|
|
company_register.company_details(registration_number: ident.to_s)
|
|
rescue CompanyRegister::NotAvailableError
|
|
[]
|
|
end
|
|
|
|
def company_register
|
|
@company_register ||= CompanyRegister::Client.new
|
|
end
|
|
end
|