egov_utils 1.5.0.alpha14 → 1.5.0.alpha16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d363c163c061946ca1a51e7b8469a635e0242a74ec2078ef18323e790ecbffa9
4
- data.tar.gz: 7dd47263f0000350ae2379869ae3d124f793e54ba4c8c784e7f65c1ccd59e978
3
+ metadata.gz: 42577786177c1af8817f136fe3f860c925d2cd91540f49e17dc11b2fe3635397
4
+ data.tar.gz: fbb299d6905f40c3102c22cb28403ff3c5c0ffd032fb1de7934d30de40c3bf92
5
5
  SHA512:
6
- metadata.gz: f176f92bbffb1bc961d5203c23b718ce15a563a0ee0785381e0e7970f2267652f0f0afaf59b5514a27b2d23880ceafceeae52f8085470f682ca07b066b2417de
7
- data.tar.gz: cebe41d86d4bb9f41f663dbef1f2cb62784641e1db593ae30c48ad449d3777ef3b77ab524a423a33d68fa859d78159a70fdd910e6828a58fc6e0091d2e178765
6
+ metadata.gz: 966c54f84cf6b291350dc61a80369541fef8dc322346d2c4fffef384a07cfd37ae74a30165ab626e8d538168927f50ec79cbfb29656c7f964dd7f21c575f037a
7
+ data.tar.gz: d315fe2d9a406873884bf5a3d88970b843653bf9fa5ce6254851f79fe83947e2b73b95a3bb76700d928d95606079823b92242d26ae7faea646294128e8ccd892
@@ -8,7 +8,7 @@ module EgovUtils
8
8
  string :person_type
9
9
 
10
10
  def execute
11
- strategy_class.run!(remote_id: remote_id)
11
+ strategy_class.run!(remote_id:)
12
12
  end
13
13
 
14
14
  private
@@ -7,7 +7,7 @@ module EgovUtils
7
7
 
8
8
  def handle_response!
9
9
  {
10
- name: response_body.xpath('//OsobaNazev').text.capitalize,
10
+ name: response_body.xpath('//NazevOsoby').text.capitalize,
11
11
  ico: remote_id
12
12
  }
13
13
  end
@@ -40,9 +40,18 @@ module EgovUtils
40
40
  end
41
41
  end
42
42
 
43
+ def invalid_record_code
44
+ return @invalid_record_code if defined?(@invalid_record_code)
45
+
46
+ @invalid_record_code =
47
+ if response_body.xpath('//NarozeniSvet').text.present?
48
+ 'not_found'
49
+ end
50
+ end
51
+
43
52
  def handle_response!
44
- if internal_error_code
45
- errors.add(:base, internal_error_code)
53
+ if internal_error_code || invalid_record_code
54
+ errors.add(:base, internal_error_code || invalid_record_code)
46
55
  return
47
56
  end
48
57
 
@@ -50,7 +59,7 @@ module EgovUtils
50
59
  firstname: response_body.xpath('//Jmeno').text.capitalize,
51
60
  lastname: response_body.xpath('//Prijmeni').text.capitalize,
52
61
  birth_date: response_body.xpath('//DatumNarozeni').text,
53
- birth_place: response_body.xpath('//Lokalita/Nazev').text,
62
+ birth_place: response_body.xpath('//Lokalita/Nazev').text.presence,
54
63
  remote_id: response_body.xpath('//GlobalniAifo').text
55
64
  )
56
65
  end
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '1.5.0.alpha14'
2
+ VERSION = '1.5.0.alpha16'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.alpha14
4
+ version: 1.5.0.alpha16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-08 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -941,7 +941,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
941
941
  - !ruby/object:Gem::Version
942
942
  version: '0'
943
943
  requirements: []
944
- rubygems_version: 3.5.16
944
+ rubygems_version: 3.5.22
945
945
  signing_key:
946
946
  specification_version: 4
947
947
  summary: The eGoverment utilities is set of functionalities to support basic eGoverment