egov_utils 1.5.0.alpha11 → 1.5.0.alpha13

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: 1ed4c6bdd27ab9c2423bc2e68e5fd8b06d5e21d2f2e411e52e52dc066db560c3
4
- data.tar.gz: d4d4fec938a553811e3d8889055a0863f57f3ea66f5788a6ac6112230ff1d827
3
+ metadata.gz: e6cb927e59075f7edb5c8d95dc9d8f8a4013f718027c6e96a9c1ce09cd2b5cf9
4
+ data.tar.gz: 5f43a78e3d93d0315a5f9fbf4377312e4443c0f17a6be10728d5078e6fff14f9
5
5
  SHA512:
6
- metadata.gz: 165986c704bcb0dbe843eb4ad1492dcf449e99141efd6ad6691d65d1ccc709ca37c88773c09e36a45c212538369ae2df4edb3a4ef5615108ca5e3fd21f2d4e3f
7
- data.tar.gz: 387830b245543af1c1b0f239706ef927c6d4cba2c55a54dfb1c8dfdcc51c08ac7ebf652c6a8d7d275040a2fd1fb9236e0e2c4052d881e80546503c13db9b9237
6
+ metadata.gz: 25c8bb2281b20f5795ee228d09b259cce0a12ec5de2fb464917a455f2417a2516ae5778ec95ec391d2931f6268f9182f2893e42bc0b50492959de3fcfb9face3
7
+ data.tar.gz: 977382a8cb09988bb23dde63860fd088eedb063ee6561abc40e420851a427a4c9d8ed4577d45e07e466b63f189e6ed70e2fb53fbc9f06aa29953023437fd4d25
@@ -1,77 +1,75 @@
1
1
  module EgovUtils
2
2
  module Iszr
3
- module LegalPeople
4
- class FindAddressByIco < Request
5
- string :remote_id
3
+ class FindAddressByIco < Request
4
+ string :remote_id
6
5
 
7
- private
6
+ private
8
7
 
9
- def handle_response!
10
- EgovUtils::Address.new(
11
- street:
12
- response_body.xpath('//UliceNazev').text.presence || response_body.xpath('//CastObceNazev').text,
13
- house_number: response_body.xpath('//CisloDomovni').text,
14
- orientation_number: response_body.xpath('//CisloOrientacni').text,
15
- city: response_body.xpath('//ObecNazev').text,
16
- postcode: response_body.xpath('//PostaKod').text,
17
- egov_identifier: response_body.xpath('//AdresniMistoKod').text,
18
- country: 203,
19
- district: district.name,
20
- region: region.name
21
- )
22
- end
8
+ def handle_response!
9
+ EgovUtils::Address.new(
10
+ street:
11
+ response_body.xpath('//UliceNazev').text.presence || response_body.xpath('//CastObceNazev').text,
12
+ house_number: response_body.xpath('//CisloDomovni').text,
13
+ orientation_number: response_body.xpath('//CisloOrientacni').text,
14
+ city: response_body.xpath('//ObecNazev').text,
15
+ postcode: response_body.xpath('//PostaKod').text,
16
+ egov_identifier: response_body.xpath('//AdresniMistoKod').text,
17
+ country: 203,
18
+ district: district.name,
19
+ region: region.name
20
+ )
21
+ end
23
22
 
24
- def body
25
- Nokogiri::XML::Builder.new do |xml|
26
- xml['e256'].RosCtiIco2(
27
- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
28
- 'xsi:schemaLocation' => 'urn:cz:isvs:iszr:schemas:IszrRosCtiIco2:v1 IszrRosCtiIco2.xsd',
29
- 'xmlns:abs' => 'urn:cz:isvs:iszr:schemas:IszrAbstract:v1',
30
- 'xmlns:e256' => 'urn:cz:isvs:iszr:schemas:IszrRosCtiIco2:v1',
31
- 'xmlns:reg' => 'urn:cz:isvs:reg:schemas:RegTypy:v1',
32
- 'xmlns:ros' => 'urn:cz:isvs:ros:schemas:RosDotazyData:v2'
33
- ) {
34
- xml['abs'].ZadostInfo {
35
- xml['reg'].CasZadosti Time.current.iso8601
36
- xml['reg'].Agenda EgovUtils::Settings['iszr']['agenda']
37
- xml['reg'].AgendovaRole EgovUtils::Settings['iszr']['agendova_role']
38
- xml['reg'].Ovm '00025429'
39
- xml['reg'].Ais EgovUtils::Settings['iszr']['ais']
40
- xml['reg'].Subjekt '00025429'
41
- xml['reg'].Uzivatel 'Administrator'
42
- xml['reg'].DuvodUcel 'ztotozneni'
43
- xml['reg'].AgendaZadostId SecureRandom.uuid
44
- }
45
- xml['abs'].AutorizaceInfo {
46
- xml['abs'].SeznamUdaju 'ObchodniNazev AdresaSidla ROBCti ROSCti RUIANCti'
47
- }
48
- xml['e256'].Zadost {
49
- xml['e256'].RosCtiIco2Data {
50
- xml['ros'].Ico remote_id
51
- }
23
+ def body
24
+ Nokogiri::XML::Builder.new do |xml|
25
+ xml['e256'].RosCtiIco2(
26
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
27
+ 'xsi:schemaLocation' => 'urn:cz:isvs:iszr:schemas:IszrRosCtiIco2:v1 IszrRosCtiIco2.xsd',
28
+ 'xmlns:abs' => 'urn:cz:isvs:iszr:schemas:IszrAbstract:v1',
29
+ 'xmlns:e256' => 'urn:cz:isvs:iszr:schemas:IszrRosCtiIco2:v1',
30
+ 'xmlns:reg' => 'urn:cz:isvs:reg:schemas:RegTypy:v1',
31
+ 'xmlns:ros' => 'urn:cz:isvs:ros:schemas:RosDotazyData:v2'
32
+ ) {
33
+ xml['abs'].ZadostInfo {
34
+ xml['reg'].CasZadosti Time.current.iso8601
35
+ xml['reg'].Agenda EgovUtils::Settings['iszr']['agenda']
36
+ xml['reg'].AgendovaRole EgovUtils::Settings['iszr']['agendova_role']
37
+ xml['reg'].Ovm '00025429'
38
+ xml['reg'].Ais EgovUtils::Settings['iszr']['ais']
39
+ xml['reg'].Subjekt '00025429'
40
+ xml['reg'].Uzivatel 'Administrator'
41
+ xml['reg'].DuvodUcel 'ztotozneni'
42
+ xml['reg'].AgendaZadostId SecureRandom.uuid
43
+ }
44
+ xml['abs'].AutorizaceInfo {
45
+ xml['abs'].SeznamUdaju 'ObchodniNazev AdresaSidla ROBCti ROSCti RUIANCti'
46
+ }
47
+ xml['e256'].Zadost {
48
+ xml['e256'].RosCtiIco2Data {
49
+ xml['ros'].Ico remote_id
52
50
  }
53
51
  }
54
- end
52
+ }
55
53
  end
54
+ end
56
55
 
57
- def response_error_code
58
- @response_error_code ||=
59
- response_body.xpath('//VysledekSubKod').last&.text&.presence
60
- end
56
+ def response_error_code
57
+ @response_error_code ||=
58
+ response_body.xpath('//VysledekSubKod').last&.text&.presence
59
+ end
61
60
 
62
- def internal_error_code
63
- return unless response_error_code
61
+ def internal_error_code
62
+ return unless response_error_code
64
63
 
65
- if response_error_code == 'ZAZNAM NENALEZEN'
66
- "not_found"
67
- elsif response_error_code == 'PREKROCEN POCET'
68
- "multiple_records_found"
69
- end
64
+ if response_error_code == 'ZAZNAM NENALEZEN'
65
+ "not_found"
66
+ elsif response_error_code == 'PREKROCEN POCET'
67
+ "multiple_records_found"
70
68
  end
69
+ end
71
70
 
72
- def service_id
73
- 'E256'
74
- end
71
+ def service_id
72
+ 'E256'
75
73
  end
76
74
  end
77
75
  end
@@ -1,8 +1,6 @@
1
- # frozen_string_literal: true
2
-
3
1
  module EgovUtils
4
2
  module Iszr
5
- class FindPersonByAifo < Request
3
+ class FindPersonByIco < Request
6
4
  string :remote_id
7
5
 
8
6
  private
@@ -16,14 +14,13 @@ module EgovUtils
16
14
 
17
15
  def body
18
16
  Nokogiri::XML::Builder.new do |xml|
19
- xml[service_id].RobCtiAifo2(
17
+ xml['e256'].RosCtiIco2(
20
18
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
21
- 'xsi:schemaLocation' => 'urn:cz:isvs:iszr:schemas:IszrRobCtiAifo2:v1 IszrRobCtiAifo2.xsd',
19
+ 'xsi:schemaLocation' => 'urn:cz:isvs:iszr:schemas:IszrRosCtiIco2:v1 IszrRosCtiIco2.xsd',
22
20
  'xmlns:abs' => 'urn:cz:isvs:iszr:schemas:IszrAbstract:v1',
23
- 'xmlns:E276' => 'urn:cz:isvs:iszr:schemas:IszrRobCtiAifo2:v1',
21
+ 'xmlns:e256' => 'urn:cz:isvs:iszr:schemas:IszrRosCtiIco2:v1',
24
22
  'xmlns:reg' => 'urn:cz:isvs:reg:schemas:RegTypy:v1',
25
- 'xmlns:rod' => 'urn:cz:isvs:rob:schemas:RobDotazyData:v1',
26
- 'xmlns:rob' => 'urn:cz:isvs:rob:schemas:RobTypy:v1'
23
+ 'xmlns:ros' => 'urn:cz:isvs:ros:schemas:RosDotazyData:v2'
27
24
  ) {
28
25
  xml['abs'].ZadostInfo {
29
26
  xml['reg'].CasZadosti Time.current.iso8601
@@ -37,26 +34,34 @@ module EgovUtils
37
34
  xml['reg'].AgendaZadostId SecureRandom.uuid
38
35
  }
39
36
  xml['abs'].AutorizaceInfo {
40
- xml['abs'].SeznamUdaju 'Aifo Prijmeni Jmeno DatumNarozeni RUIANCti AdresaPobytu MistoNarozeni'
41
- }
42
- xml['abs'].MapaAifo(nacistData: true) {
43
- xml['reg'].PrevodAifo {
44
- xml['reg'].LokalniAifo 1
45
- xml['reg'].GlobalniAifo remote_id
46
- }
37
+ xml['abs'].SeznamUdaju 'ObchodniNazev AdresaSidla ROBCti ROSCti RUIANCti'
47
38
  }
48
- xml[service_id].Zadost {
49
- xml[service_id].RobCtiAifo2Data {
50
- xml['rod'].Aifo 1
51
- xml['rod'].VyuzitiPoskytnuti 'poskytnuti'
39
+ xml['e256'].Zadost {
40
+ xml['e256'].RosCtiIco2Data {
41
+ xml['ros'].Ico remote_id
52
42
  }
53
43
  }
54
44
  }
55
45
  end
56
46
  end
57
47
 
48
+ def response_error_code
49
+ @response_error_code ||=
50
+ response_body.xpath('//VysledekSubKod').last&.text&.presence
51
+ end
52
+
53
+ def internal_error_code
54
+ return unless response_error_code
55
+
56
+ if response_error_code == 'ZAZNAM NENALEZEN'
57
+ "not_found"
58
+ elsif response_error_code == 'PREKROCEN POCET'
59
+ "multiple_records_found"
60
+ end
61
+ end
62
+
58
63
  def service_id
59
- 'E276'
64
+ 'E256'
60
65
  end
61
66
  end
62
67
  end
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '1.5.0.alpha11'
2
+ VERSION = '1.5.0.alpha13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.alpha11
4
+ version: 1.5.0.alpha13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr