mindee 3.3.1 → 3.4.0

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: 9c6039978a362b6a5faab3b92fb4ef24fd9cbf85060f66614b007b371d851843
4
- data.tar.gz: 4aa9ef461ee5fcc19f483dde6f584c583390e53ebba1889d5283b1864a26169c
3
+ metadata.gz: fe1aef5bf5c30b3b599d426140de05074840a57f29800129359d647e7ee1bbd5
4
+ data.tar.gz: 43c93a85a9a6d65fcba85345d1410844b07b5ca7d49a8a8f2487ccd5adcf767f
5
5
  SHA512:
6
- metadata.gz: 226aa7601ad8b1a80dc6fb1071ad655a9aae647d70118184d0ada431b314503eb3f6157abdc59eb0205e157c3d7d8cc501ceb26258690ed9ad038b4d41336f93
7
- data.tar.gz: a1d215cb0834ded50c9bcb913d2cf074d7e711ec73aaa67380705c71d51e29b6c15a162fa7afcadcab027954831155fdf065563cee1ce2aa0a7b300359cd7421
6
+ metadata.gz: eff5e3f90cb351664059c4d6dcf78b839dca0e463d0d09b1b4b15a963828355c372845b0806369c21d6b46ed3b2ce45fd199e0bf7aa4c874df3fc06cae569d22
7
+ data.tar.gz: cb724d0b07bc0a4729d288076b26221fb99fc74d146d181bdae578b95fa9a374ae7deb43e3bb8cadbf7a8d3e5d9e98ea6737c7917565e375668d1fc4e93f95e3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v3.4.0 - 2024-01-30
4
+ ### Changes
5
+ * :arrow_up: update invoices to v4.4
6
+ * :sparkles: add support for `raw_value` in string fields
7
+
8
+
3
9
  ## v3.3.1 - 2023-12-15
4
10
  ### Changes
5
11
  * :recycle: tweak async delays & retry
data/docs/invoices_v4.md CHANGED
@@ -34,12 +34,12 @@ puts result.document
34
34
  ########
35
35
  Document
36
36
  ########
37
- :Mindee ID: 16bd8752-8c4d-450f-8213-f33b2097504c
37
+ :Mindee ID: 80f2328c-58a5-486a-9599-eb2d738680f0
38
38
  :Filename: default_sample.jpg
39
39
 
40
40
  Inference
41
41
  #########
42
- :Product: mindee/invoices v4.2
42
+ :Product: mindee/invoices v4.4
43
43
  :Rotation applied: Yes
44
44
 
45
45
  Prediction
@@ -51,6 +51,7 @@ Prediction
51
51
  :Due Date: 2018-09-25
52
52
  :Total Net:
53
53
  :Total Amount: 2608.20
54
+ :Total Tax: 193.20
54
55
  :Taxes:
55
56
  +---------------+--------+----------+---------------+
56
57
  | Base | Code | Rate (%) | Amount |
@@ -58,7 +59,7 @@ Prediction
58
59
  | | | 8.00 | 193.20 |
59
60
  +---------------+--------+----------+---------------+
60
61
  :Supplier Payment Details:
61
- :Supplier Name: TURNPIKE DESIGNS CO.
62
+ :Supplier Name: TURNPIKE DESIGNS
62
63
  :Supplier Company Registrations:
63
64
  :Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7
64
65
  :Customer Name: JIRO DOI
@@ -88,6 +89,7 @@ Page 0
88
89
  :Due Date: 2018-09-25
89
90
  :Total Net:
90
91
  :Total Amount: 2608.20
92
+ :Total Tax: 193.20
91
93
  :Taxes:
92
94
  +---------------+--------+----------+---------------+
93
95
  | Base | Code | Rate (%) | Amount |
@@ -95,7 +97,7 @@ Page 0
95
97
  | | | 8.00 | 193.20 |
96
98
  +---------------+--------+----------+---------------+
97
99
  :Supplier Payment Details:
98
- :Supplier Name: TURNPIKE DESIGNS CO.
100
+ :Supplier Name: TURNPIKE DESIGNS
99
101
  :Supplier Company Registrations:
100
102
  :Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7
101
103
  :Customer Name: JIRO DOI
@@ -308,9 +310,6 @@ puts result.document.inference.prediction.supplier_name.value
308
310
  ```rb
309
311
  for supplier_payment_details_elem in result.document.inference.prediction.supplier_payment_details do
310
312
  puts supplier_payment_details_elem.value
311
- puts supplier_payment_details_elem.rate
312
- puts supplier_payment_details_elem.code
313
- puts supplier_payment_details_elem.basis
314
313
  end
315
314
  ```
316
315
 
@@ -319,7 +318,7 @@ end
319
318
 
320
319
  ```rb
321
320
  for taxes_elem in result.document.inference.prediction.taxes do
322
- puts taxes_elem.value
321
+ puts taxes_elem.to_s
323
322
  end
324
323
  ```
325
324
 
@@ -337,5 +336,12 @@ puts result.document.inference.prediction.total_amount.value
337
336
  puts result.document.inference.prediction.total_net.value
338
337
  ```
339
338
 
339
+ ## Total Tax
340
+ **total_tax** ([AmountField](#amount-field)): The total tax: includes all the taxes paid for this invoice.
341
+
342
+ ```rb
343
+ puts result.document.inference.prediction.total_tax.value
344
+ ```
345
+
340
346
  # Questions?
341
347
  [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
@@ -10,6 +10,14 @@ module Mindee
10
10
  # Value as String
11
11
  # @return [String, nil]
12
12
  attr_reader :value
13
+ # Value as String
14
+ # @return [String, nil]
15
+ attr_reader :raw_value
16
+
17
+ def initialize(prediction, page_id = nil, reconstructed: false)
18
+ super
19
+ @raw_value = prediction['raw_value']
20
+ end
13
21
  end
14
22
  end
15
23
  end
@@ -60,6 +60,9 @@ module Mindee
60
60
  # The net amount paid: does not include taxes, fees, and discounts.
61
61
  # @return [Mindee::Parsing::Standard::AmountField]
62
62
  attr_reader :total_net
63
+ # The total tax: includes all the taxes paid for this invoice.
64
+ # @return [Mindee::Parsing::Standard::AmountField]
65
+ attr_reader :total_tax
63
66
 
64
67
  # @param prediction [Hash]
65
68
  # @param page_id [Integer, nil]
@@ -97,6 +100,7 @@ module Mindee
97
100
  @taxes = Taxes.new(prediction['taxes'], page_id)
98
101
  @total_amount = AmountField.new(prediction['total_amount'], page_id)
99
102
  @total_net = AmountField.new(prediction['total_net'], page_id)
103
+ @total_tax = AmountField.new(prediction['total_tax'], page_id)
100
104
  end
101
105
 
102
106
  # @return [String]
@@ -114,6 +118,7 @@ module Mindee
114
118
  out_str << "\n:Due Date: #{@due_date}".rstrip
115
119
  out_str << "\n:Total Net: #{@total_net}".rstrip
116
120
  out_str << "\n:Total Amount: #{@total_amount}".rstrip
121
+ out_str << "\n:Total Tax: #{@total_tax}".rstrip
117
122
  out_str << "\n:Taxes:#{@taxes}".rstrip
118
123
  out_str << "\n:Supplier Payment Details: #{supplier_payment_details}".rstrip
119
124
  out_str << "\n:Supplier Name: #{@supplier_name}".rstrip
@@ -3,7 +3,7 @@
3
3
  # Mindee
4
4
  module Mindee
5
5
  # Current version.
6
- VERSION = '3.3.1'
6
+ VERSION = '3.4.0'
7
7
 
8
8
  # Finds and return the current platform.
9
9
  # @return [String]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mindee
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindee, SA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-15 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: marcel