ox-tender-abstract 0.0.1

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.
data/.rspec_status ADDED
@@ -0,0 +1,73 @@
1
+ example_id | status | run_time |
2
+ ---------------------------------------------------------- | ------ | --------------- |
3
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:1:1:1] | failed | 0.01328 seconds |
4
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:1:2:1] | passed | 0.0008 seconds |
5
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:1:3:1] | passed | 0.00013 seconds |
6
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:1:4:1] | passed | 0.00037 seconds |
7
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:2:1:1] | passed | 0.0008 seconds |
8
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:2:2:1] | passed | 0.0088 seconds |
9
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:3:1] | passed | 0.00154 seconds |
10
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:3:2] | passed | 0.00028 seconds |
11
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:4:1] | passed | 0.00084 seconds |
12
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:4:2] | passed | 0.00088 seconds |
13
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:4:3] | passed | 0.00072 seconds |
14
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:5:1] | passed | 0.00034 seconds |
15
+ ./spec/oxtenderabstract/archive_processor_spec.rb[1:6:1] | passed | 0.00004 seconds |
16
+ ./spec/oxtenderabstract/client_spec.rb[1:1:1:1] | passed | 0.00032 seconds |
17
+ ./spec/oxtenderabstract/client_spec.rb[1:1:2:1] | passed | 0.00046 seconds |
18
+ ./spec/oxtenderabstract/client_spec.rb[1:1:3:1] | passed | 0.00004 seconds |
19
+ ./spec/oxtenderabstract/client_spec.rb[1:1:4:1] | passed | 0.00004 seconds |
20
+ ./spec/oxtenderabstract/client_spec.rb[1:2:1:1] | failed | 0.00484 seconds |
21
+ ./spec/oxtenderabstract/client_spec.rb[1:2:2:1] | passed | 0.00008 seconds |
22
+ ./spec/oxtenderabstract/client_spec.rb[1:2:2:2] | passed | 0.00034 seconds |
23
+ ./spec/oxtenderabstract/client_spec.rb[1:3:1:1] | failed | 0.00199 seconds |
24
+ ./spec/oxtenderabstract/client_spec.rb[1:3:2:1] | passed | 0.00009 seconds |
25
+ ./spec/oxtenderabstract/client_spec.rb[1:4:1] | passed | 0.00034 seconds |
26
+ ./spec/oxtenderabstract/client_spec.rb[1:5:1] | passed | 0.0002 seconds |
27
+ ./spec/oxtenderabstract/client_spec.rb[1:6:1:1] | passed | 0.00014 seconds |
28
+ ./spec/oxtenderabstract/client_spec.rb[1:6:2:1] | passed | 0.00009 seconds |
29
+ ./spec/oxtenderabstract/client_spec.rb[1:6:3:1] | passed | 0.00016 seconds |
30
+ ./spec/oxtenderabstract/client_spec.rb[1:6:3:2] | passed | 0.00015 seconds |
31
+ ./spec/oxtenderabstract/client_spec.rb[1:7:1] | passed | 0.00011 seconds |
32
+ ./spec/oxtenderabstract/configuration_spec.rb[1:1:1] | passed | 0.00033 seconds |
33
+ ./spec/oxtenderabstract/configuration_spec.rb[1:2:1] | passed | 0.00003 seconds |
34
+ ./spec/oxtenderabstract/configuration_spec.rb[1:2:2] | passed | 0.00003 seconds |
35
+ ./spec/oxtenderabstract/configuration_spec.rb[1:2:3] | passed | 0.00002 seconds |
36
+ ./spec/oxtenderabstract/configuration_spec.rb[1:3:1] | passed | 0.00084 seconds |
37
+ ./spec/oxtenderabstract/configuration_spec.rb[1:3:2] | passed | 0.00017 seconds |
38
+ ./spec/oxtenderabstract/configuration_spec.rb[1:3:3] | passed | 0.0002 seconds |
39
+ ./spec/oxtenderabstract/configuration_spec.rb[1:3:4] | passed | 0.00033 seconds |
40
+ ./spec/oxtenderabstract/configuration_spec.rb[1:4:1] | passed | 0.00003 seconds |
41
+ ./spec/oxtenderabstract/configuration_spec.rb[1:4:2] | passed | 0.00002 seconds |
42
+ ./spec/oxtenderabstract/configuration_spec.rb[1:4:3] | passed | 0.00002 seconds |
43
+ ./spec/oxtenderabstract/configuration_spec.rb[1:4:4] | passed | 0.00002 seconds |
44
+ ./spec/oxtenderabstract/configuration_spec.rb[1:4:5] | passed | 0.00002 seconds |
45
+ ./spec/oxtenderabstract/configuration_spec.rb[1:4:6] | passed | 0.00003 seconds |
46
+ ./spec/oxtenderabstract/result_spec.rb[1:1:1] | passed | 0.00005 seconds |
47
+ ./spec/oxtenderabstract/result_spec.rb[1:2:1] | passed | 0.00004 seconds |
48
+ ./spec/oxtenderabstract/result_spec.rb[1:3:1] | passed | 0.00002 seconds |
49
+ ./spec/oxtenderabstract/result_spec.rb[1:3:2] | passed | 0.00002 seconds |
50
+ ./spec/oxtenderabstract/result_spec.rb[1:4:1] | passed | 0.00002 seconds |
51
+ ./spec/oxtenderabstract/result_spec.rb[1:4:2] | passed | 0.00002 seconds |
52
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:1:1] | passed | 0.00009 seconds |
53
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:2:1] | passed | 0.00004 seconds |
54
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:3:1] | failed | 0.00075 seconds |
55
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:3:2] | passed | 0.00058 seconds |
56
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:3:3] | failed | 0.00052 seconds |
57
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:4:1] | passed | 0.00007 seconds |
58
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:5:1] | passed | 0.00007 seconds |
59
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:1:6:1] | passed | 0.00007 seconds |
60
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:2:1:1] | failed | 0.00009 seconds |
61
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:2:2:1] | failed | 0.00009 seconds |
62
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:2:3:1] | failed | 0.00014 seconds |
63
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:3:1] | passed | 0.00005 seconds |
64
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:3:2] | passed | 0.00004 seconds |
65
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:3:3] | passed | 0.00004 seconds |
66
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:3:4] | passed | 0.00006 seconds |
67
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:4:1:1] | failed | 0.00029 seconds |
68
+ ./spec/oxtenderabstract/xml_parser_spec.rb[1:4:2:1] | failed | 0.00006 seconds |
69
+ ./spec/oxtenderabstract_spec.rb[1:1:1] | passed | 0.00031 seconds |
70
+ ./spec/oxtenderabstract_spec.rb[1:2:1] | passed | 0.00003 seconds |
71
+ ./spec/oxtenderabstract_spec.rb[1:3:1] | passed | 0.00003 seconds |
72
+ ./spec/oxtenderabstract_spec.rb[1:4:1:1] | passed | 0.00018 seconds |
73
+ ./spec/oxtenderabstract_spec.rb[1:4:2:1] | passed | 0.00013 seconds |
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.4
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## [0.1.0] - 2025-07-10
2
+
3
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at smolev@me.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 neonix20b
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,297 @@
1
+ # OxTenderAbstract
2
+
3
+ Ruby library for working with Russian procurement system API (zakupki.gov.ru) via SOAP-XML. Provides modular architecture for fetching and parsing tender data.
4
+
5
+ ## Features
6
+
7
+ - 🚀 Modular architecture with separate components
8
+ - 📊 Complete XML tender document parsing
9
+ - 📁 Automatic archive processing (GZIP + ZIP)
10
+ - 🔧 Simple configuration and usage
11
+ - 📝 Returns structured Hash results
12
+ - 🛡️ Error handling and logging
13
+
14
+ ## Installation
15
+
16
+ Add to your Gemfile:
17
+
18
+ ```ruby
19
+ gem 'ox-tender-abstract'
20
+ ```
21
+
22
+ Or install directly:
23
+
24
+ ```bash
25
+ gem install ox-tender-abstract
26
+ ```
27
+
28
+ ## Quick Start
29
+
30
+ ### Configuration
31
+
32
+ ```ruby
33
+ require 'ox-tender-abstract'
34
+
35
+ # Global configuration
36
+ OxTenderAbstract.configure do |config|
37
+ config.token = key
38
+ config.timeout_open = 30
39
+ config.timeout_read = 120
40
+ config.logger = Logger.new(STDOUT)
41
+ end
42
+ ```
43
+
44
+ ### Search tenders by region and date
45
+
46
+ ```ruby
47
+ # Search tenders for a specific date
48
+ result = OxTenderAbstract.search_tenders(
49
+ org_region: "77", # Region code (77 = Moscow)
50
+ exact_date: "2025-07-09" # Date in YYYY-MM-DD format
51
+ )
52
+
53
+ if result.success?
54
+ puts "Found tenders: #{result.data[:tenders].size}"
55
+
56
+ result.data[:tenders].first(3).each do |tender|
57
+ puts "Registry Number: #{tender[:reestr_number]}"
58
+ puts "Price: #{tender[:max_price]} rubles"
59
+ puts "Organization: #{tender[:organization_name]}"
60
+ puts "Contact: #{tender[:contact_email]}"
61
+ puts "---"
62
+ end
63
+ else
64
+ puts "Error: #{result.error}"
65
+ end
66
+
67
+ # Example output:
68
+ # Found tenders: 564
69
+ # Registry Number: 0373100066925000138
70
+ # Price: 25606.51 rubles
71
+ # Organization: FEDERAL STATE INSTITUTION "STATE INSTITUTION FOR THE OPERATION OF ADMINISTRATIVE BUILDINGS..."
72
+ # Contact: otd_zakupki@guaz.ru
73
+ ```
74
+
75
+ ### Enhanced search with detailed information
76
+
77
+ The `enhanced_search_tenders` method automatically downloads and processes archives to extract comprehensive tender information including attachments, contact details, addresses, and metadata.
78
+
79
+ ```ruby
80
+ # Enhanced search with detailed information including attachments
81
+ result = OxTenderAbstract.enhanced_search_tenders(
82
+ org_region: "77", # Region code (77 = Moscow)
83
+ exact_date: "2025-07-09", # Date in YYYY-MM-DD format
84
+ include_attachments: true # Include attachment information
85
+ )
86
+
87
+ if result.success?
88
+ puts "Found tenders: #{result.data[:tenders].size}"
89
+
90
+ result.data[:tenders].first(3).each do |tender|
91
+ puts "Registry Number: #{tender[:reestr_number]}"
92
+ puts "Title: #{tender[:title]}"
93
+ puts "Price: #{tender[:max_price]} #{tender[:currency]}"
94
+ puts "Organization: #{tender[:organization_name]}"
95
+ puts "Contact Person: #{tender[:contact_person_name]}"
96
+ puts "Contact Email: #{tender[:contact_email]}"
97
+ puts "Contact Phone: #{tender[:contact_phone]}"
98
+ puts "Address: #{tender[:post_address]}"
99
+ puts "ETP: #{tender[:etp_name]} (#{tender[:etp_url]})"
100
+ puts "Start Date: #{tender[:start_date]}"
101
+ puts "End Date: #{tender[:end_date]}"
102
+ puts "Attachments: #{tender[:attachments_count]}"
103
+
104
+ if tender[:attachments]
105
+ tender[:attachments].each do |attachment|
106
+ puts " - #{attachment[:file_name]} (#{attachment[:file_size]} bytes)"
107
+ puts " Description: #{attachment[:description]}"
108
+ puts " URL: #{attachment[:url]}"
109
+ end
110
+ end
111
+ puts "---"
112
+ end
113
+ else
114
+ puts "Error: #{result.error}"
115
+ end
116
+ ```
117
+
118
+ ### Get documents by registry number
119
+
120
+ ```ruby
121
+ result = OxTenderAbstract.get_docs_by_reestr_number(
122
+ reestr_number: "0373100013125000767"
123
+ )
124
+
125
+ if result.success?
126
+ puts "Found archives: #{result.data[:archive_urls].size}"
127
+ end
128
+ ```
129
+
130
+ ### Working with client directly
131
+
132
+ ```ruby
133
+ # Create client with token
134
+ client = OxTenderAbstract.client(token: "your_token")
135
+
136
+ # Or use global configuration
137
+ client = OxTenderAbstract.client
138
+
139
+ # Search by region
140
+ result = client.get_docs_by_region(
141
+ org_region: "77",
142
+ subsystem_type: "PRIZ",
143
+ document_type: "epNotificationEF2020",
144
+ exact_date: "2025-07-09"
145
+ )
146
+
147
+ # Download and process archive
148
+ if result.success?
149
+ result.data[:archive_urls].each do |archive_url|
150
+ archive_result = client.download_archive_data(archive_url)
151
+ if archive_result.success?
152
+ files = archive_result.data[:files]
153
+ puts "Files in archive: #{files.size}"
154
+
155
+ # Parse XML files
156
+ xml_files = files.select { |name, _| name.downcase.end_with?(".xml") }
157
+ xml_files.each do |file_name, file_data|
158
+ xml_result = client.parse_xml_document(file_data[:content])
159
+ if xml_result.success? && xml_result.data[:document_type] == :tender
160
+ tender = xml_result.data[:content]
161
+ puts "Tender: #{tender[:reestr_number]} - #{tender[:max_price]} rubles"
162
+ end
163
+ end
164
+ end
165
+ end
166
+ end
167
+ ```
168
+
169
+ ## Architecture
170
+
171
+ The library consists of the following modules:
172
+
173
+ - **Client** - main SOAP API client
174
+ - **XmlParser** - XML document parser
175
+ - **ArchiveProcessor** - archive handler
176
+ - **Configuration** - library configuration
177
+ - **Result** - result structure
178
+ - **DocumentTypes** - document types and constants
179
+
180
+ ## Supported subsystem types
181
+
182
+ ```ruby
183
+ SUBSYSTEM_TYPES = %w[
184
+ PRIZ RPEC RPGZ RJ RDI BTK RPKLKP RPNZ RGK EA UR REC RPP RVP RRK RRA
185
+ RNP RKPO PPRF615 RD615 LKOK OZ OD223 RD223 MSP223 IPVP223 TRU223
186
+ RJ223 RPP223 RPZ223 RI223 RZ223 OV223 TPOZ223 POZ223 RNP223 POM223 ZC
187
+ ]
188
+ ```
189
+
190
+ ## Electronic notification types
191
+
192
+ ```ruby
193
+ ELECTRONIC_NOTIFICATION_TYPES = %w[
194
+ epNotificationEF2020 epNotificationEF epNotificationOK2020
195
+ epNotificationEP2020 epNotificationZK2020 epNotificationZP2020
196
+ epNotificationISM2020 fcsNotificationEF fcsNotificationOK
197
+ fcsNotificationEP fcsNotificationZK fcsNotificationZP
198
+ fcsNotificationISM fcsPlacement fcsPlacementResult
199
+ ]
200
+ ```
201
+
202
+ ## Result structure
203
+
204
+ ```ruby
205
+ {
206
+ success: true,
207
+ data: {
208
+ tenders: [
209
+ {
210
+ reestr_number: "0373100066925000138",
211
+ title: nil, # May be empty for some tenders
212
+ max_price: "25606.51",
213
+ currency: "РОССИЙСКИЙ РУБЛЬ",
214
+ organization_name: "ФЕДЕРАЛЬНОЕ КАЗЕННОЕ УЧРЕЖДЕНИЕ \"ГОСУДАРСТВЕННОЕ УЧРЕЖДЕНИЕ ПО ЭКСПЛУАТАЦИИ АДМИНИСТРАТИВНЫХ ЗДАНИЙ И ДАЧНОГО ХОЗЯЙСТВА МИНИСТЕРСТВА ФИНАНСОВ РОССИЙСКОЙ ФЕДЕРАЦИИ\"",
215
+ contact_email: "otd_zakupki@guaz.ru",
216
+ contact_phone: nil,
217
+ contact_name: nil,
218
+ start_date: nil,
219
+ end_date: nil,
220
+ placement_type: "Электронный аукцион",
221
+ # Additional metadata
222
+ source_file: "epNotificationEF2020_0373100066925000138_1.xml",
223
+ archive_url: "https://int.zakupki.gov.ru/dstore/ip/download/PRIZ/file.zip?ticket=...",
224
+ processed_at: 2025-07-10 12:51:57 +0300
225
+ }
226
+ ],
227
+ total_archives: 6,
228
+ total_files: 564,
229
+ processed_at: 2025-07-10 12:51:57 +0300
230
+ },
231
+ error: nil,
232
+ metadata: {}
233
+ }
234
+ ```
235
+
236
+ ## Error handling
237
+
238
+ ```ruby
239
+ begin
240
+ result = OxTenderAbstract.search_tenders(
241
+ org_region: "77",
242
+ exact_date: "2025-07-09"
243
+ )
244
+ rescue OxTenderAbstract::AuthenticationError => e
245
+ puts "Authentication error: #{e.message}"
246
+ rescue OxTenderAbstract::NetworkError => e
247
+ puts "Network error: #{e.message}"
248
+ rescue OxTenderAbstract::ParseError => e
249
+ puts "Parsing error: #{e.message}"
250
+ end
251
+ ```
252
+
253
+ ## Real-world performance
254
+
255
+ Based on production testing with zakupki.gov.ru API:
256
+
257
+ - **564 tenders** processed in ~14 seconds
258
+ - **6 archives** downloaded and extracted
259
+ - **564 XML files** parsed successfully
260
+ - Average processing time: ~25ms per tender
261
+
262
+ ```ruby
263
+ # Real example from July 9, 2025 - Moscow region
264
+ result = OxTenderAbstract.search_tenders(
265
+ org_region: "77",
266
+ exact_date: "2025-07-09"
267
+ )
268
+
269
+ puts result.data[:tenders].size # => 564
270
+ puts result.data[:total_files] # => 564
271
+ puts result.data[:total_archives] # => 6
272
+
273
+ # Processing typically takes 10-15 seconds for a full day's data
274
+ ```
275
+
276
+ ## Requirements
277
+
278
+ - Ruby >= 3.0.0
279
+ - API token for zakupki.gov.ru
280
+
281
+ ## Development
282
+
283
+ After cloning the repository:
284
+
285
+ ```bash
286
+ bin/setup
287
+ ```
288
+
289
+ To run tests:
290
+
291
+ ```bash
292
+ bundle exec rspec
293
+ ```
294
+
295
+ ## License
296
+
297
+ This gem is available as open source under the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'oxtenderabstract/version'
4
+ require_relative 'oxtenderabstract/logger'
5
+ require_relative 'oxtenderabstract/errors'
6
+ require_relative 'oxtenderabstract/result'
7
+ require_relative 'oxtenderabstract/document_types'
8
+ require_relative 'oxtenderabstract/configuration'
9
+ require_relative 'oxtenderabstract/xml_parser'
10
+ require_relative 'oxtenderabstract/archive_processor'
11
+ require_relative 'oxtenderabstract/client'
12
+
13
+ # Main module for OxTenderAbstract library
14
+ module OxTenderAbstract
15
+ class Error < StandardError; end
16
+
17
+ # Convenience method to create a new client
18
+ def self.client(token: nil)
19
+ Client.new(token: token)
20
+ end
21
+
22
+ # Search tenders by region and date (convenience method)
23
+ def self.search_tenders(org_region:, exact_date:, token: nil, **options)
24
+ client = Client.new(token: token)
25
+ client.search_tenders(org_region: org_region, exact_date: exact_date, **options)
26
+ end
27
+
28
+ # Enhanced search tenders with detailed information (convenience method)
29
+ def self.enhanced_search_tenders(org_region:, exact_date:, token: nil, **options)
30
+ client = Client.new(token: token)
31
+ client.enhanced_search_tenders(org_region: org_region, exact_date: exact_date, **options)
32
+ end
33
+
34
+ # Get documents by registry number (convenience method)
35
+ def self.get_docs_by_reestr_number(reestr_number:, token: nil, **options)
36
+ client = Client.new(token: token)
37
+ client.get_docs_by_reestr_number(reestr_number: reestr_number, **options)
38
+ end
39
+ end