egov_utils 1.5.0.alpha12 → 1.5.0.alpha13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/egov_utils/iszr/find_person_by_ico.rb +25 -20
- data/lib/egov_utils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6cb927e59075f7edb5c8d95dc9d8f8a4013f718027c6e96a9c1ce09cd2b5cf9
|
4
|
+
data.tar.gz: 5f43a78e3d93d0315a5f9fbf4377312e4443c0f17a6be10728d5078e6fff14f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25c8bb2281b20f5795ee228d09b259cce0a12ec5de2fb464917a455f2417a2516ae5778ec95ec391d2931f6268f9182f2893e42bc0b50492959de3fcfb9face3
|
7
|
+
data.tar.gz: 977382a8cb09988bb23dde63860fd088eedb063ee6561abc40e420851a427a4c9d8ed4577d45e07e466b63f189e6ed70e2fb53fbc9f06aa29953023437fd4d25
|
@@ -1,8 +1,6 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
module EgovUtils
|
4
2
|
module Iszr
|
5
|
-
class
|
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[
|
17
|
+
xml['e256'].RosCtiIco2(
|
20
18
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
21
|
-
'xsi:schemaLocation' => 'urn:cz:isvs:iszr:schemas:
|
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:
|
21
|
+
'xmlns:e256' => 'urn:cz:isvs:iszr:schemas:IszrRosCtiIco2:v1',
|
24
22
|
'xmlns:reg' => 'urn:cz:isvs:reg:schemas:RegTypy:v1',
|
25
|
-
'xmlns:
|
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 '
|
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[
|
49
|
-
xml[
|
50
|
-
xml['
|
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
|
-
'
|
64
|
+
'E256'
|
60
65
|
end
|
61
66
|
end
|
62
67
|
end
|
data/lib/egov_utils/version.rb
CHANGED