refactoring

This commit is contained in:
olegphenomenon 2021-09-20 15:30:30 +03:00
parent 4501463434
commit 419e5a587d
3 changed files with 29 additions and 9 deletions

View file

@ -17,13 +17,13 @@ class RegistrantUser < User
Country.new(alpha2_code)
end
def companies(company_register = nil)
def companies(company_register = CompanyRegister::Client.new)
return [] if ident.include?('-')
[OpenStruct.new(registration_number: '43344412', company_name: 'TestFirma'),
OpenStruct.new(registration_number: '12345678', company_name: 'SuperFirma OU')]
company_register.representation_rights(citizen_personal_code: ident,
citizen_country_code: country.alpha3)
end
def contacts(representable: true)
Contact.registrant_user_contacts(self, representable: representable)
end