pina 0.12.3 → 0.13.0

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
  SHA1:
3
- metadata.gz: a0e0fc784734ad990bab94f5bc0d0fd0d03a2d2b
4
- data.tar.gz: 7474a75fb497a50f788d1e3e6ac95720924cffd6
3
+ metadata.gz: 12e1b8434afd19e87694e2ddccea223d43718d22
4
+ data.tar.gz: 54c5df65e806713cc4ca63e05438c1b5aa4e5030
5
5
  SHA512:
6
- metadata.gz: 17009cfabd36a15e1801d58b6c06ebe74307e8f4bf4da7ba2098a249619c7a111fc3835972d0af70ee22ab95197c4190e01595745e55a36380097310a9bcd8eb
7
- data.tar.gz: c8aa42cce40647febfbc50c75a74eaacd6c7afb4b9430f956497d0a862dc4920f7d8448aad6cb4e6be57cbe1d090119903be2e81658ca9296494480869f2c9b4
6
+ metadata.gz: 5ab21f7557e14a9e6a09dfc5d85483f2394d815e73c63096998dce35c9fa31b373a5b8038ade5e3cabdf5af7bba8b8028128a3de182960303f9b63383dbbbb6f
7
+ data.tar.gz: 3be306b670e6f25b815a0ac82d4d717ddb835d0494635f9903d9469c86b89f3904b24b00682916ad23c96a8ab08b84dc210ebd9ae89dfb97d3c15a7c35550117
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [0.13.0] - 2017-10-19
8
+ ### Changed
9
+
10
+ ### Added
11
+ - StatProcessedDocument api wrapper
12
+
13
+ ### Fixed
14
+
15
+
16
+
17
+
7
18
  ## [0.11.0] - 2017-03-10
8
19
  ### Changed
9
20
  - Typhoeus removed in favour of Net::HTTP
data/README.md CHANGED
@@ -220,6 +220,35 @@ Pina::ProcessedDocument.find(gid)
220
220
  Pina::ProcessedDocument.delete(gid)
221
221
  ```
222
222
 
223
+ ### Stat Processed Documents
224
+
225
+ #### All stat processed documents
226
+
227
+ ```ruby
228
+ Pina::StatProcessedDocument.all
229
+ ```
230
+
231
+ Gets all stat processed documents from your database. Results are paginated and you can access
232
+ first, next or previous page like this:
233
+
234
+ ```ruby
235
+ stats = Pina::StatProcessedDocument.all
236
+ stats.next_page
237
+ ```
238
+
239
+ ```ruby
240
+ stats = Pina::StatProcessedDocument.all
241
+ stats.previous_page
242
+
243
+ stats.first_page
244
+ ```
245
+
246
+ #### Fetching specific stat processed document
247
+
248
+ ```ruby
249
+ Pina::StatProcessedDocument.find(gid)
250
+ ```
251
+
223
252
  ### MyBankAccounts
224
253
 
225
254
  #### All my bank accoutns
@@ -15,6 +15,7 @@ require 'pina/rest_adapter'
15
15
  require 'pina/sales_order'
16
16
  require 'pina/receivable'
17
17
  require 'pina/processed_document'
18
+ require 'pina/stat_processed_document'
18
19
  require 'pina/my_bank_account'
19
20
  require 'pina/uploaded_document'
20
21
 
@@ -0,0 +1,7 @@
1
+ module Pina
2
+ module Collections
3
+ class StatProcessedDocument < Base
4
+ attribute :items, Array[::Pina::Models::StatProcessedDocument]
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,25 @@
1
+ module Pina
2
+ module Models
3
+ class StatProcessedDocument
4
+ include Virtus.model
5
+
6
+ attribute :gid
7
+ attribute :cuser
8
+ attribute :ctime
9
+ attribute :muser
10
+ attribute :mtime
11
+ attribute :isvalid
12
+ attribute :islocked
13
+ attribute :external_id
14
+ attribute :status
15
+ attribute :manually_processed
16
+ attribute :table
17
+ attribute :date
18
+ attribute :user
19
+ attribute :type
20
+ attribute :count
21
+ attribute :min
22
+ attribute :max
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,45 @@
1
+ require 'pina/models/stat_processed_document'
2
+ require 'pina/collections/stat_processed_document'
3
+
4
+ module Pina
5
+ class StatProcessedDocument
6
+ class << self
7
+ def new(params = nil)
8
+ Pina::Models::StatProcessedDocument.new(params)
9
+ end
10
+
11
+ def find(id)
12
+ response = Pina::RestAdapter.get(:stat_processed_documents, id)
13
+
14
+ return Pina::Models::StatProcessedDocument.new(attributes(response)) if
15
+ response.ok?
16
+
17
+ response
18
+ end
19
+
20
+ def where(hash, page = nil)
21
+ response = Pina::RestAdapter.get(:stat_processed_documents, hash)
22
+
23
+ return Pina::Collections::StatProcessedDocument.new(attributes(response)) if
24
+ response.ok?
25
+
26
+ response
27
+ end
28
+
29
+ def all(page = nil)
30
+ response = Pina::RestAdapter.get(:stat_processed_documents, page)
31
+
32
+ return Pina::Collections::StatProcessedDocument.new(attributes(response)) if
33
+ response.ok?
34
+
35
+ response
36
+ end
37
+
38
+ private
39
+
40
+ def attributes(response)
41
+ response.to_hash.merge(response: response)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -1,3 +1,3 @@
1
1
  module Pina
2
- VERSION = '0.12.3'
2
+ VERSION = '0.13.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Hronek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-03 00:00:00.000000000 Z
11
+ date: 2017-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -219,6 +219,7 @@ files:
219
219
  - lib/pina/collections/receivable.rb
220
220
  - lib/pina/collections/sales_invoice.rb
221
221
  - lib/pina/collections/sales_order.rb
222
+ - lib/pina/collections/stat_processed_document.rb
222
223
  - lib/pina/collections/uploaded_document.rb
223
224
  - lib/pina/contact.rb
224
225
  - lib/pina/models/address.rb
@@ -229,6 +230,7 @@ files:
229
230
  - lib/pina/models/sales_invoice.rb
230
231
  - lib/pina/models/sales_item.rb
231
232
  - lib/pina/models/sales_order.rb
233
+ - lib/pina/models/stat_processed_document.rb
232
234
  - lib/pina/models/uploaded_document.rb
233
235
  - lib/pina/my_bank_account.rb
234
236
  - lib/pina/processed_document.rb
@@ -236,6 +238,7 @@ files:
236
238
  - lib/pina/rest_adapter.rb
237
239
  - lib/pina/sales_invoice.rb
238
240
  - lib/pina/sales_order.rb
241
+ - lib/pina/stat_processed_document.rb
239
242
  - lib/pina/uploaded_document.rb
240
243
  - lib/pina/utils/pagination.rb
241
244
  - lib/pina/version.rb