Merge remote-tracking branch 'origin/master' into 1580-registrar-api-contacts-endpoint

This commit is contained in:
Karl Erik Õunapuu 2020-10-20 10:26:06 +03:00
commit 2b4a1889e4
No known key found for this signature in database
GPG key ID: C9DD647298A34764
4 changed files with 15 additions and 22 deletions

View file

@ -1,3 +1,7 @@
19.10.2020
* Improved logging for LHV-connect messages [#1712](https://github.com/internetee/registry/issues/1712)
* LHV-connect gem update to handle blank descriptions [#1714](https://github.com/internetee/registry/issues/1714)
16.10.2020
* Improved error handling for registrant API comapnies endpoint [#1713](https://github.com/internetee/registry/pull/1713)

View file

@ -45,7 +45,7 @@ GIT
GIT
remote: https://github.com/internetee/lhv.git
revision: 1825240b3bf8b262418cc6c8ef7ed1aba386dd7d
revision: 1fb07818369425510a0172ad53bc86e85b6f83cc
branch: master
specs:
lhv (0.1.0)

View file

@ -23,6 +23,9 @@ namespace :invoices do
end
if incoming_transactions.any?
log 'Got incoming transactions'
log incoming_transactions
bank_statement = BankStatement.new(bank_code: Setting.registry_bank_code,
iban: Setting.registry_iban)
@ -41,8 +44,15 @@ namespace :invoices do
transaction.autobind_invoice
end
end
else
log 'Got no incoming transactions parsed, aborting'
end
puts "Transactions processed: #{incoming_transactions.size}"
end
def log(msg)
@log ||= Logger.new(STDOUT)
@log.info(msg)
end
end

View file

@ -34,18 +34,6 @@ class RegistrantApiCompaniesTest < ApplicationIntegrationTest
assert_equal(:companies, response_json.keys.first)
end
def test_status_if_nil_result
contacts(:john).update!(ident: '12344321', ident_type: 'priv', ident_country_code: 'US')
CompanyRegister.const_set(:Client, CompanyRegisterClientZeroStub)
get '/api/v1/registrant/companies', headers: @auth_headers
response_json = JSON.parse(response.body, symbolize_names: true)
assert_equal(1, response_json.count)
assert_equal(200, response.status)
assert_equal(:companies, response_json.keys.first)
end
private
def auth_token
@ -54,12 +42,3 @@ class RegistrantApiCompaniesTest < ApplicationIntegrationTest
"Bearer #{hash[:access_token]}"
end
end
class CompanyRegisterClientZeroStub
Company = Struct.new(:registration_number, :company_name)
def representation_rights(citizen_personal_code:, citizen_country_code:)
[]
end
end