From 6d810bb604009f21fe1d63b2e1bf710970082c31 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Mon, 25 Nov 2024 12:50:30 +0200 Subject: [PATCH] call company status directly --- app/interactions/actions/contact_create.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/interactions/actions/contact_create.rb b/app/interactions/actions/contact_create.rb index cb3c9f5be..ab3b73efb 100644 --- a/app/interactions/actions/contact_create.rb +++ b/app/interactions/actions/contact_create.rb @@ -83,7 +83,14 @@ def maybe_company_is_relevant Rails.logger.info "======= I AM HERE" - company_status = contact.return_company_status + # company_status = contact.return_company_status + # Rails.logger.info "company_status: #{company_status}" + + company_register = CompanyRegister::Client.new + res = company_register.simple_data(registration_number: ident.to_s) + Rails.logger.info "res: #{res.inspect}" + + company_status = res.first[:status] Rails.logger.info "company_status: #{company_status}" return if [Contact::REGISTERED, Contact::LIQUIDATED].include? company_status