egov_utils 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4642c25b9931dafadd03a9c2f84243a8380f921a96ca1f902038fe98b3230f35
4
- data.tar.gz: f1a24c1f1216ce4fe25c640b9538631ef507cad07668452fa13f3910b12fa399
3
+ metadata.gz: f2660a5e3990b9a1e04c3ee2143b7fc04bcdb2b7ee36461bef0844d4126cb3eb
4
+ data.tar.gz: d396d3750b49423ba640ab35150c43b19350821eb931878c8418c22fd39acd96
5
5
  SHA512:
6
- metadata.gz: d321a53ff478ecfccfbeb31e49ea13ae4f751e2b39a84cf61adf52d6f181f6c375d694a3a05285264149c9a6aa77cb2709a2cca02741bd4c5a4c08927ba09e82
7
- data.tar.gz: 5379b369f0408bb0e50a7ffe83bcdba623832fa248e4aa0a1c10db7c3746ee35e1542d0d469cdf071b7916c498d690e56c8279321c11d462a7c0957caa88b8a4
6
+ metadata.gz: 044ebe11c2b66d36bc9287660e807c5756acbced9a2f1e882d1a28d3a02c5a5e21d45d69c141627332c6ee9a6833128b1256fa312a9cb784ce5a4c2ada86c5b1
7
+ data.tar.gz: 491bf67c11602d3ae5b0026ebcc64d8fbee628dfc1ab36effe13ddcfabbe0e4baee8d90432840b488647be4a0ecb09fd56612c6134c242ac075a5f60e2a24ccb
@@ -7,8 +7,8 @@ module EgovUtils
7
7
  private
8
8
 
9
9
  def handle_response!
10
- if internal_error_code
11
- errors.add(:base, internal_error_code)
10
+ if internal_error_code || invalid_record_code
11
+ errors.add(:base, internal_error_code || invalid_record_code)
12
12
  return
13
13
  end
14
14
 
@@ -67,6 +67,15 @@ module EgovUtils
67
67
  end
68
68
  end
69
69
 
70
+ def invalid_record_code
71
+ return @invalid_record_code if defined?(@invalid_record_code)
72
+
73
+ @invalid_record_code =
74
+ if response_body.xpath('//AdresaTextem').text.blank? && response_body.xpath('//UliceNazev').text.blank?
75
+ 'invalid_address'
76
+ end
77
+ end
78
+
70
79
  def service_id
71
80
  'E256'
72
81
  end
@@ -46,6 +46,8 @@ module EgovUtils
46
46
  @invalid_record_code =
47
47
  if response_body.xpath('//NarozeniSvet').text.present?
48
48
  'not_found'
49
+ elsif response_body.xpath('//AdresaTextem').text.blank? && response_body.xpath('//UliceNazev').text.blank?
50
+ 'invalid_address'
49
51
  end
50
52
  end
51
53
 
@@ -130,9 +130,10 @@
130
130
  $error_div = $('<div>').addClass('alert').addClass('alert-danger').append($icon).append(' Nalezeno více osob, zadejte místo narození');
131
131
  $npr.find('.card-body').prepend($error_div);
132
132
  }
133
- else if(error_kind == 'extended_search_multiple_records_found' || error_kind == 'extended_search_not_found') {
133
+ else if(error_kind == 'extended_search_multiple_records_found' || error_kind == 'extended_search_not_found' || error_kind == 'invalid_address') {
134
134
  $icon = $('<i>').addClass('fa').addClass('fa-times');
135
- $error_div = $('<div>').addClass('alert').addClass('alert-danger').append($icon).append(' Nalezeno více osob, pokračujte, prosím, ručním zadáním údajů');
135
+ error_text = error_kind == 'invalid_address' ? ' Osoba nemá v registru zadanou adresu, pokračujte, prosím, ručním zadáním údajů' : ' Nalezeno více osob, pokračujte, prosím, ručním zadáním údajů';
136
+ $error_div = $('<div>').addClass('alert').addClass('alert-danger').append($icon).append(error_text);
136
137
 
137
138
  $('.old-person-form').prepend($error_div);
138
139
  $('.new-person-form').addClass('hidden').hide();
@@ -256,7 +256,7 @@ cs:
256
256
  extended_search_not_found: Nebylo možné nalézt osobu
257
257
  extended_search_multiple_records_found: Nalezeno více shod, je nutné údaje ručně vyplnit
258
258
  not_found: Osobu nebylo možné najít
259
-
259
+ invalid_address: Osoba nemá v registru zadanou adresu, je nutné ručně vyplnit údaje
260
260
 
261
261
  egov_utils:
262
262
  current_users:
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '1.5.5'
2
+ VERSION = '1.5.6'
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.5
4
+ version: 1.5.6
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: 2025-12-01 00:00:00.000000000 Z
11
+ date: 2026-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails