Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle company register API data type errors #2731

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.6
3.0.3
3 changes: 3 additions & 0 deletions app/jobs/company_register_status_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,18 @@ def lift_force_delete(contact)
end

def delete_process(contact)
Rails.logger.info("Processing company details for contact #{contact.id} with ident: #{contact.ident} (#{contact.ident.class})")
company_details_response = contact.return_company_details

if company_details_response.empty?
Rails.logger.info("Empty company details response for contact #{contact.id}")
schedule_force_delete(contact)

return
end

kandeliik_tekstina = extract_kandeliik_tekstina(company_details_response)
Rails.logger.info("Kandeliik tekstina for contact #{contact.id}: #{kandeliik_tekstina}")

if kandeliik_tekstina == PAYMENT_STATEMENT_BUSINESS_REGISTRY_REASON
soft_delete_company(contact)
Expand Down
2 changes: 1 addition & 1 deletion app/models/contact/company_register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def return_company_data
def return_company_details
return unless org?

company_register.company_details(registration_number: ident)
company_register.company_details(registration_number: ident.to_s)
rescue CompanyRegister::NotAvailableError
[]
end
Expand Down
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true,
"automerge": false,
"automergeType": "pr"
},
{
Expand Down