mindee 3.7.0 → 3.9.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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/CHANGELOG.md +12 -1
  4. data/docs/expense_receipts_v5.md +7 -0
  5. data/docs/financial_document_v1.md +68 -9
  6. data/docs/invoices_v4.md +42 -6
  7. data/lib/mindee/product/barcode_reader/barcode_reader_v1.rb +1 -1
  8. data/lib/mindee/product/barcode_reader/barcode_reader_v1_document.rb +1 -1
  9. data/lib/mindee/product/barcode_reader/barcode_reader_v1_page.rb +1 -1
  10. data/lib/mindee/product/cropper/cropper_v1.rb +1 -1
  11. data/lib/mindee/product/cropper/cropper_v1_document.rb +1 -1
  12. data/lib/mindee/product/cropper/cropper_v1_page.rb +1 -1
  13. data/lib/mindee/product/eu/driver_license/driver_license_v1.rb +1 -1
  14. data/lib/mindee/product/eu/driver_license/driver_license_v1_document.rb +1 -1
  15. data/lib/mindee/product/eu/driver_license/driver_license_v1_page.rb +1 -1
  16. data/lib/mindee/product/eu/license_plate/license_plate_v1.rb +1 -1
  17. data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +1 -1
  18. data/lib/mindee/product/eu/license_plate/license_plate_v1_page.rb +1 -1
  19. data/lib/mindee/product/financial_document/financial_document_v1.rb +1 -1
  20. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +37 -2
  21. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
  22. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1.rb +1 -1
  23. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rb +1 -1
  24. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_page.rb +1 -1
  25. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2.rb +1 -1
  26. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb +1 -1
  27. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rb +1 -1
  28. data/lib/mindee/product/fr/carte_grise/carte_grise_v1.rb +1 -1
  29. data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +1 -1
  30. data/lib/mindee/product/fr/carte_grise/carte_grise_v1_page.rb +1 -1
  31. data/lib/mindee/product/fr/carte_vitale/carte_vitale_v1.rb +1 -1
  32. data/lib/mindee/product/fr/carte_vitale/carte_vitale_v1_document.rb +1 -1
  33. data/lib/mindee/product/fr/carte_vitale/carte_vitale_v1_page.rb +1 -1
  34. data/lib/mindee/product/fr/id_card/id_card_v1.rb +1 -1
  35. data/lib/mindee/product/fr/id_card/id_card_v1_document.rb +1 -1
  36. data/lib/mindee/product/fr/id_card/id_card_v1_page.rb +1 -1
  37. data/lib/mindee/product/fr/id_card/id_card_v2.rb +1 -1
  38. data/lib/mindee/product/fr/id_card/id_card_v2_document.rb +1 -1
  39. data/lib/mindee/product/fr/id_card/id_card_v2_page.rb +1 -1
  40. data/lib/mindee/product/international_id/international_id_v2.rb +1 -1
  41. data/lib/mindee/product/international_id/international_id_v2_document.rb +1 -1
  42. data/lib/mindee/product/international_id/international_id_v2_page.rb +1 -1
  43. data/lib/mindee/product/invoice/invoice_v4.rb +1 -1
  44. data/lib/mindee/product/invoice/invoice_v4_document.rb +21 -1
  45. data/lib/mindee/product/invoice/invoice_v4_page.rb +1 -1
  46. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rb +1 -1
  47. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb +1 -1
  48. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rb +1 -1
  49. data/lib/mindee/product/passport/passport_v1.rb +1 -1
  50. data/lib/mindee/product/passport/passport_v1_document.rb +1 -1
  51. data/lib/mindee/product/passport/passport_v1_page.rb +1 -1
  52. data/lib/mindee/product/proof_of_address/proof_of_address_v1.rb +1 -1
  53. data/lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb +1 -1
  54. data/lib/mindee/product/proof_of_address/proof_of_address_v1_page.rb +1 -1
  55. data/lib/mindee/product/receipt/receipt_v5.rb +1 -1
  56. data/lib/mindee/product/receipt/receipt_v5_document.rb +6 -1
  57. data/lib/mindee/product/receipt/receipt_v5_page.rb +1 -1
  58. data/lib/mindee/product/resume/resume_v1.rb +1 -1
  59. data/lib/mindee/product/resume/resume_v1_document.rb +1 -1
  60. data/lib/mindee/product/resume/resume_v1_page.rb +1 -1
  61. data/lib/mindee/product/us/bank_check/bank_check_v1.rb +1 -1
  62. data/lib/mindee/product/us/bank_check/bank_check_v1_document.rb +1 -1
  63. data/lib/mindee/product/us/bank_check/bank_check_v1_page.rb +1 -1
  64. data/lib/mindee/product/us/driver_license/driver_license_v1.rb +1 -1
  65. data/lib/mindee/product/us/driver_license/driver_license_v1_document.rb +1 -1
  66. data/lib/mindee/product/us/driver_license/driver_license_v1_page.rb +1 -1
  67. data/lib/mindee/product/us/w9/w9_v1.rb +1 -1
  68. data/lib/mindee/product/us/w9/w9_v1_document.rb +1 -1
  69. data/lib/mindee/product/us/w9/w9_v1_page.rb +1 -1
  70. data/lib/mindee/version.rb +1 -1
  71. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b22c708fcdd44e0e5104e5b5e0f9cf669b7f41e46f1c627af252b86ed5b45d7
4
- data.tar.gz: 5695f02623e644bbce0d26a3cec7096370d103b01914a97402887a87eba8cc2d
3
+ metadata.gz: 3a863bb97566add59f1d2385e9688cab9841a3c4b22228138dd72023ad0521fc
4
+ data.tar.gz: ff3097cb84eba1ceef71f229a1b6f0152ba2a5659b5b9955dae313046eacfc39
5
5
  SHA512:
6
- metadata.gz: 6b1e14cdac5f7e0a54d5326a2a9a54387568bddc7060e505468ee3f56896cba9a6d1da341d9a5918f695e99ef7aa79d95d065b43a692f8f036892fd0c4fae070
7
- data.tar.gz: 92a95c7c1802fc6099a5ce13a869add7d7865ace5331c8d5a449ca4ed83d4e5e6573a193ed151e75f7b4ec8c2da41f30bd23cc2c71e1889d83ddf4012978123d
6
+ metadata.gz: 26c78e63b0464261718d20718628d30df2f1b805c55e9d0d87670abfc4d97e7f0b0fdcab21c8e7810cffe0562923dde6a551fb59a8a8d393c535e89e7ed12d3c
7
+ data.tar.gz: dd333f2e4169061884be3bc39649862fab3fdcfc2bc9039f0b850cc2e5690194fa5915917dcaeb5d622b0df444bf8a8e81647ea9edc6b940c94324c37aefa7d6
data/.rubocop.yml CHANGED
@@ -32,7 +32,7 @@ Metrics/BlockLength:
32
32
  - '**/*.gemspec'
33
33
 
34
34
  Metrics/MethodLength:
35
- Max: 45
35
+ Max: 50
36
36
 
37
37
  Metrics/ClassLength:
38
38
  Max: 200
data/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
- ## v3.6.2 - 2024-03-28
3
+ ## v3.9.0 - 2024-05-16
4
+ ### Changes
5
+ * :sparkles: update financial document to v1.7 & receipts to v5.2
6
+
7
+
8
+ ## v3.8.0 - 2024-05-02
9
+ ### Changes
10
+ * :recycle: update products to newer syntax
11
+ * :sparkles: update financial document to v1.6 & invoice to v4.6
12
+
13
+
14
+ ## v3.7.0 - 2024-03-28
4
15
  ### Changes
5
16
  * :sparkles: update Invoice to v4.5
6
17
  ### Fixes
@@ -221,6 +221,13 @@ end
221
221
  puts result.document.inference.prediction.locale.value
222
222
  ```
223
223
 
224
+ ## Receipt Number
225
+ **receipt_number** ([StringField](#string-field)): The receipt number or identifier.
226
+
227
+ ```rb
228
+ puts result.document.inference.prediction.receipt_number.value
229
+ ```
230
+
224
231
  ## Purchase Subcategory
225
232
  **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
226
233
 
@@ -34,20 +34,20 @@ puts result.document
34
34
  ########
35
35
  Document
36
36
  ########
37
- :Mindee ID: a6b54e2d-a7fa-4e08-8de6-6cd296f50f3d
37
+ :Mindee ID: 503895c6-eced-42e2-a6fc-0292b7ccf680
38
38
  :Filename: default_sample.jpg
39
39
 
40
40
  Inference
41
41
  #########
42
- :Product: mindee/financial_document v1.2
42
+ :Product: mindee/financial_document v1.6
43
43
  :Rotation applied: Yes
44
44
 
45
45
  Prediction
46
46
  ==========
47
- :Locale: en; en; USD;
47
+ :Locale: en; USD;
48
48
  :Invoice Number: INT-001
49
49
  :Reference Numbers: 2412/2019
50
- :Purchase Date: 2019-02-11
50
+ :Purchase Date: 2019-11-02
51
51
  :Due Date: 2019-02-26
52
52
  :Total Net: 195.00
53
53
  :Total Amount: 204.75
@@ -63,8 +63,13 @@ Prediction
63
63
  :Supplier Address: 4490 Oak Drive Albany, NY 12210
64
64
  :Supplier Phone Number:
65
65
  :Customer Name: JESSIE M HORNE
66
+ :Supplier Website:
67
+ :Supplier Email:
66
68
  :Customer Company Registrations:
67
69
  :Customer Address: 2019 Redbud Drive New York, NY 10011
70
+ :Customer ID: 1234567890
71
+ :Shipping Address: 2019 Redbud Drive New York, NY 10011
72
+ :Billing Address: 4312 Wood Road New York, NY 10031
68
73
  :Document Type: INVOICE
69
74
  :Purchase Subcategory:
70
75
  :Purchase Category: miscellaneous
@@ -79,7 +84,7 @@ Prediction
79
84
  +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
80
85
  | New set of pedal arms | | 2.00 | | | 50.00 | 25.00 |
81
86
  +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
82
- | Labon 3hrs | | 3.00 | | | 45.00 | 15.00 |
87
+ | Labor 3hrs | | 3.00 | | | 45.00 | 15.00 |
83
88
  +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
84
89
 
85
90
  Page Predictions
@@ -87,10 +92,10 @@ Page Predictions
87
92
 
88
93
  Page 0
89
94
  ------
90
- :Locale: en; en; USD;
95
+ :Locale: en; USD;
91
96
  :Invoice Number: INT-001
92
97
  :Reference Numbers: 2412/2019
93
- :Purchase Date: 2019-02-11
98
+ :Purchase Date: 2019-11-02
94
99
  :Due Date: 2019-02-26
95
100
  :Total Net: 195.00
96
101
  :Total Amount: 204.75
@@ -106,8 +111,13 @@ Page 0
106
111
  :Supplier Address: 4490 Oak Drive Albany, NY 12210
107
112
  :Supplier Phone Number:
108
113
  :Customer Name: JESSIE M HORNE
114
+ :Supplier Website:
115
+ :Supplier Email:
109
116
  :Customer Company Registrations:
110
117
  :Customer Address: 2019 Redbud Drive New York, NY 10011
118
+ :Customer ID: 1234567890
119
+ :Shipping Address: 2019 Redbud Drive New York, NY 10011
120
+ :Billing Address: 4312 Wood Road New York, NY 10031
111
121
  :Document Type: INVOICE
112
122
  :Purchase Subcategory:
113
123
  :Purchase Category: miscellaneous
@@ -122,7 +132,7 @@ Page 0
122
132
  +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
123
133
  | New set of pedal arms | | 2.00 | | | 50.00 | 25.00 |
124
134
  +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
125
- | Labon 3hrs | | 3.00 | | | 45.00 | 15.00 |
135
+ | Labor 3hrs | | 3.00 | | | 45.00 | 15.00 |
126
136
  +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
127
137
  ```
128
138
 
@@ -215,6 +225,13 @@ A `FinancialDocumentV1LineItem` implements the following attributes:
215
225
  # Attributes
216
226
  The following fields are extracted for Financial Document V1:
217
227
 
228
+ ## Billing Address
229
+ **billing_address** ([StringField](#string-field)): The customer's address used for billing.
230
+
231
+ ```rb
232
+ puts result.document.inference.prediction.billing_address.value
233
+ ```
234
+
218
235
  ## Purchase Category
219
236
  **category** ([ClassificationField](#classification-field)): The purchase category among predefined classes.
220
237
 
@@ -238,6 +255,13 @@ for customer_company_registrations_elem in result.document.inference.prediction.
238
255
  end
239
256
  ```
240
257
 
258
+ ## Customer ID
259
+ **customer_id** ([StringField](#string-field)): The customer account number or identifier from the supplier.
260
+
261
+ ```rb
262
+ puts result.document.inference.prediction.customer_id.value
263
+ ```
264
+
241
265
  ## Customer Name
242
266
  **customer_name** ([StringField](#string-field)): The name of the customer.
243
267
 
@@ -252,6 +276,13 @@ puts result.document.inference.prediction.customer_name.value
252
276
  puts result.document.inference.prediction.date.value
253
277
  ```
254
278
 
279
+ ## Document Number
280
+ **document_number** ([StringField](#string-field)): The document number or identifier.
281
+
282
+ ```rb
283
+ puts result.document.inference.prediction.document_number.value
284
+ ```
285
+
255
286
  ## Document Type
256
287
  **document_type** ([ClassificationField](#classification-field)): One of: 'INVOICE', 'CREDIT NOTE', 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
257
288
 
@@ -267,7 +298,7 @@ puts result.document.inference.prediction.due_date.value
267
298
  ```
268
299
 
269
300
  ## Invoice Number
270
- **invoice_number** ([StringField](#string-field)): The invoice number or identifier.
301
+ **invoice_number** ([StringField](#string-field)): The invoice number or identifier only if document is an invoice.
271
302
 
272
303
  ```rb
273
304
  puts result.document.inference.prediction.invoice_number.value
@@ -289,6 +320,13 @@ end
289
320
  puts result.document.inference.prediction.locale.value
290
321
  ```
291
322
 
323
+ ## Receipt Number
324
+ **receipt_number** ([StringField](#string-field)): The receipt number or identifier only if document is a receipt.
325
+
326
+ ```rb
327
+ puts result.document.inference.prediction.receipt_number.value
328
+ ```
329
+
292
330
  ## Reference Numbers
293
331
  **reference_numbers** (Array<[StringField](#string-field)>): List of Reference numbers, including PO number.
294
332
 
@@ -298,6 +336,13 @@ for reference_numbers_elem in result.document.inference.prediction.reference_num
298
336
  end
299
337
  ```
300
338
 
339
+ ## Shipping Address
340
+ **shipping_address** ([StringField](#string-field)): The customer's address used for shipping.
341
+
342
+ ```rb
343
+ puts result.document.inference.prediction.shipping_address.value
344
+ ```
345
+
301
346
  ## Purchase Subcategory
302
347
  **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
303
348
 
@@ -321,6 +366,13 @@ for supplier_company_registrations_elem in result.document.inference.prediction.
321
366
  end
322
367
  ```
323
368
 
369
+ ## Supplier Email
370
+ **supplier_email** ([StringField](#string-field)): The email of the supplier or merchant.
371
+
372
+ ```rb
373
+ puts result.document.inference.prediction.supplier_email.value
374
+ ```
375
+
324
376
  ## Supplier Name
325
377
  **supplier_name** ([StringField](#string-field)): The name of the supplier or merchant.
326
378
 
@@ -347,6 +399,13 @@ end
347
399
  puts result.document.inference.prediction.supplier_phone_number.value
348
400
  ```
349
401
 
402
+ ## Supplier Website
403
+ **supplier_website** ([StringField](#string-field)): The website URL of the supplier or merchant.
404
+
405
+ ```rb
406
+ puts result.document.inference.prediction.supplier_website.value
407
+ ```
408
+
350
409
  ## Taxes
351
410
  **taxes** (Array<[TaxField](#taxes-field)>): List of tax lines information.
352
411
 
data/docs/invoices_v4.md CHANGED
@@ -34,12 +34,12 @@ puts result.document
34
34
  ########
35
35
  Document
36
36
  ########
37
- :Mindee ID: a9062dd1-0d34-42ab-9505-0481a8545106
37
+ :Mindee ID: 5c0371d0-1433-43a4-b8fb-a3b11aaf9a0e
38
38
  :Filename: default_sample.jpg
39
39
 
40
40
  Inference
41
41
  #########
42
- :Product: mindee/invoices v4.5
42
+ :Product: mindee/invoices v4.6
43
43
  :Rotation applied: Yes
44
44
 
45
45
  Prediction
@@ -48,7 +48,7 @@ Prediction
48
48
  :Invoice Number: 14
49
49
  :Reference Numbers: AD29094
50
50
  :Purchase Date: 2018-09-25
51
- :Due Date: 2018-09-25
51
+ :Due Date:
52
52
  :Total Net:
53
53
  :Total Amount: 2608.20
54
54
  :Total Tax: 193.20
@@ -61,10 +61,14 @@ Prediction
61
61
  :Supplier Payment Details:
62
62
  :Supplier Name: TURNPIKE DESIGNS
63
63
  :Supplier Company Registrations:
64
- :Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7
64
+ :Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
65
+ :Supplier Phone Number: 4165551212
66
+ :Supplier Website:
67
+ :Supplier Email: i_doi@example.com
65
68
  :Customer Name: JIRO DOI
66
69
  :Customer Company Registrations:
67
70
  :Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
71
+ :Customer ID:
68
72
  :Shipping Address:
69
73
  :Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
70
74
  :Document Type: INVOICE
@@ -88,7 +92,7 @@ Page 0
88
92
  :Invoice Number: 14
89
93
  :Reference Numbers: AD29094
90
94
  :Purchase Date: 2018-09-25
91
- :Due Date: 2018-09-25
95
+ :Due Date:
92
96
  :Total Net:
93
97
  :Total Amount: 2608.20
94
98
  :Total Tax: 193.20
@@ -101,10 +105,14 @@ Page 0
101
105
  :Supplier Payment Details:
102
106
  :Supplier Name: TURNPIKE DESIGNS
103
107
  :Supplier Company Registrations:
104
- :Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7
108
+ :Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
109
+ :Supplier Phone Number: 4165551212
110
+ :Supplier Website:
111
+ :Supplier Email: i_doi@example.com
105
112
  :Customer Name: JIRO DOI
106
113
  :Customer Company Registrations:
107
114
  :Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
115
+ :Customer ID:
108
116
  :Shipping Address:
109
117
  :Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
110
118
  :Document Type: INVOICE
@@ -232,6 +240,13 @@ for customer_company_registrations_elem in result.document.inference.prediction.
232
240
  end
233
241
  ```
234
242
 
243
+ ## Customer ID
244
+ **customer_id** ([StringField](#string-field)): The customer account number or identifier from the supplier.
245
+
246
+ ```rb
247
+ puts result.document.inference.prediction.customer_id.value
248
+ ```
249
+
235
250
  ## Customer Name
236
251
  **customer_name** ([StringField](#string-field)): The name of the customer or client.
237
252
 
@@ -315,6 +330,13 @@ for supplier_company_registrations_elem in result.document.inference.prediction.
315
330
  end
316
331
  ```
317
332
 
333
+ ## Supplier Email
334
+ **supplier_email** ([StringField](#string-field)): The email of the supplier or merchant.
335
+
336
+ ```rb
337
+ puts result.document.inference.prediction.supplier_email.value
338
+ ```
339
+
318
340
  ## Supplier Name
319
341
  **supplier_name** ([StringField](#string-field)): The name of the supplier or merchant.
320
342
 
@@ -334,6 +356,20 @@ for supplier_payment_details_elem in result.document.inference.prediction.suppli
334
356
  end
335
357
  ```
336
358
 
359
+ ## Supplier Phone Number
360
+ **supplier_phone_number** ([StringField](#string-field)): The phone number of the supplier or merchant.
361
+
362
+ ```rb
363
+ puts result.document.inference.prediction.supplier_phone_number.value
364
+ ```
365
+
366
+ ## Supplier Website
367
+ **supplier_website** ([StringField](#string-field)): The website URL of the supplier or merchant.
368
+
369
+ ```rb
370
+ puts result.document.inference.prediction.supplier_website.value
371
+ ```
372
+
337
373
  ## Taxes
338
374
  **taxes** (Array<[TaxField](#taxes-field)>): List of tax line details.
339
375
 
@@ -8,7 +8,7 @@ module Mindee
8
8
  module Product
9
9
  # Barcode Reader module.
10
10
  module BarcodeReader
11
- # Barcode Reader V1 prediction inference.
11
+ # Barcode Reader API version 1 inference prediction.
12
12
  class BarcodeReaderV1 < Mindee::Parsing::Common::Inference
13
13
  @endpoint_name = 'barcode_reader'
14
14
  @endpoint_version = '1'
@@ -5,7 +5,7 @@ require_relative '../../parsing'
5
5
  module Mindee
6
6
  module Product
7
7
  module BarcodeReader
8
- # Barcode Reader V1 document prediction.
8
+ # Barcode Reader API version 1.0 document data.
9
9
  class BarcodeReaderV1Document < Mindee::Parsing::Common::Prediction
10
10
  include Mindee::Parsing::Standard
11
11
  # List of decoded 1D barcodes.
@@ -6,7 +6,7 @@ require_relative 'barcode_reader_v1_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module BarcodeReader
9
- # Barcode Reader V1 page.
9
+ # Barcode Reader API version 1.0 page data.
10
10
  class BarcodeReaderV1Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -8,7 +8,7 @@ module Mindee
8
8
  module Product
9
9
  # Cropper module.
10
10
  module Cropper
11
- # Cropper V1 prediction inference.
11
+ # Cropper API version 1 inference prediction.
12
12
  class CropperV1 < Mindee::Parsing::Common::Inference
13
13
  @endpoint_name = 'cropper'
14
14
  @endpoint_version = '1'
@@ -5,7 +5,7 @@ require_relative '../../parsing'
5
5
  module Mindee
6
6
  module Product
7
7
  module Cropper
8
- # Cropper V1 document prediction.
8
+ # Cropper API version 1.1 document data.
9
9
  class CropperV1Document < Mindee::Parsing::Common::Prediction
10
10
  end
11
11
  end
@@ -6,7 +6,7 @@ require_relative 'cropper_v1_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module Cropper
9
- # Cropper V1 page.
9
+ # Cropper API version 1.1 page data.
10
10
  class CropperV1Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -9,7 +9,7 @@ module Mindee
9
9
  module EU
10
10
  # Driver License module.
11
11
  module DriverLicense
12
- # Driver License V1 prediction inference.
12
+ # Driver License API version 1 inference prediction.
13
13
  class DriverLicenseV1 < Mindee::Parsing::Common::Inference
14
14
  @endpoint_name = 'eu_driver_license'
15
15
  @endpoint_version = '1'
@@ -6,7 +6,7 @@ module Mindee
6
6
  module Product
7
7
  module EU
8
8
  module DriverLicense
9
- # Driver License V1 document prediction.
9
+ # Driver License API version 1.0 document data.
10
10
  class DriverLicenseV1Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # EU driver license holders address
@@ -7,7 +7,7 @@ module Mindee
7
7
  module Product
8
8
  module EU
9
9
  module DriverLicense
10
- # Driver License V1 page.
10
+ # Driver License API version 1.0 page data.
11
11
  class DriverLicenseV1Page < Mindee::Parsing::Common::Page
12
12
  # @param prediction [Hash]
13
13
  def initialize(prediction)
@@ -9,7 +9,7 @@ module Mindee
9
9
  module EU
10
10
  # License Plate module.
11
11
  module LicensePlate
12
- # License Plate V1 prediction inference.
12
+ # License Plate API version 1 inference prediction.
13
13
  class LicensePlateV1 < Mindee::Parsing::Common::Inference
14
14
  @endpoint_name = 'license_plates'
15
15
  @endpoint_version = '1'
@@ -6,7 +6,7 @@ module Mindee
6
6
  module Product
7
7
  module EU
8
8
  module LicensePlate
9
- # License Plate V1 document prediction.
9
+ # License Plate API version 1.1 document data.
10
10
  class LicensePlateV1Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # List of all license plates found in the image.
@@ -7,7 +7,7 @@ module Mindee
7
7
  module Product
8
8
  module EU
9
9
  module LicensePlate
10
- # License Plate V1 page.
10
+ # License Plate API version 1.1 page data.
11
11
  class LicensePlateV1Page < Mindee::Parsing::Common::Page
12
12
  # @param prediction [Hash]
13
13
  def initialize(prediction)
@@ -8,7 +8,7 @@ module Mindee
8
8
  module Product
9
9
  # Financial Document module.
10
10
  module FinancialDocument
11
- # Financial Document V1 prediction inference.
11
+ # Financial Document API version 1 inference prediction.
12
12
  class FinancialDocumentV1 < Mindee::Parsing::Common::Inference
13
13
  @endpoint_name = 'financial_document'
14
14
  @endpoint_version = '1'
@@ -6,9 +6,12 @@ require_relative 'financial_document_v1_line_item'
6
6
  module Mindee
7
7
  module Product
8
8
  module FinancialDocument
9
- # Financial Document V1 document prediction.
9
+ # Financial Document API version 1.7 document data.
10
10
  class FinancialDocumentV1Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
+ # The customer's address used for billing.
13
+ # @return [Mindee::Parsing::Standard::StringField]
14
+ attr_reader :billing_address
12
15
  # The purchase category among predefined classes.
13
16
  # @return [Mindee::Parsing::Standard::ClassificationField]
14
17
  attr_reader :category
@@ -18,19 +21,25 @@ module Mindee
18
21
  # List of company registrations associated to the customer.
19
22
  # @return [Array<Mindee::Parsing::Standard::CompanyRegistrationField>]
20
23
  attr_reader :customer_company_registrations
24
+ # The customer account number or identifier from the supplier.
25
+ # @return [Mindee::Parsing::Standard::StringField]
26
+ attr_reader :customer_id
21
27
  # The name of the customer.
22
28
  # @return [Mindee::Parsing::Standard::StringField]
23
29
  attr_reader :customer_name
24
30
  # The date the purchase was made.
25
31
  # @return [Mindee::Parsing::Standard::DateField]
26
32
  attr_reader :date
33
+ # The document number or identifier.
34
+ # @return [Mindee::Parsing::Standard::StringField]
35
+ attr_reader :document_number
27
36
  # One of: 'INVOICE', 'CREDIT NOTE', 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
28
37
  # @return [Mindee::Parsing::Standard::ClassificationField]
29
38
  attr_reader :document_type
30
39
  # The date on which the payment is due.
31
40
  # @return [Mindee::Parsing::Standard::DateField]
32
41
  attr_reader :due_date
33
- # The invoice number or identifier.
42
+ # The invoice number or identifier only if document is an invoice.
34
43
  # @return [Mindee::Parsing::Standard::StringField]
35
44
  attr_reader :invoice_number
36
45
  # List of line item details.
@@ -39,9 +48,15 @@ module Mindee
39
48
  # The locale detected on the document.
40
49
  # @return [Mindee::Parsing::Standard::LocaleField]
41
50
  attr_reader :locale
51
+ # The receipt number or identifier only if document is a receipt.
52
+ # @return [Mindee::Parsing::Standard::StringField]
53
+ attr_reader :receipt_number
42
54
  # List of Reference numbers, including PO number.
43
55
  # @return [Array<Mindee::Parsing::Standard::StringField>]
44
56
  attr_reader :reference_numbers
57
+ # The customer's address used for shipping.
58
+ # @return [Mindee::Parsing::Standard::StringField]
59
+ attr_reader :shipping_address
45
60
  # The purchase subcategory among predefined classes for transport and food.
46
61
  # @return [Mindee::Parsing::Standard::ClassificationField]
47
62
  attr_reader :subcategory
@@ -51,6 +66,9 @@ module Mindee
51
66
  # List of company registrations associated to the supplier.
52
67
  # @return [Array<Mindee::Parsing::Standard::CompanyRegistrationField>]
53
68
  attr_reader :supplier_company_registrations
69
+ # The email of the supplier or merchant.
70
+ # @return [Mindee::Parsing::Standard::StringField]
71
+ attr_reader :supplier_email
54
72
  # The name of the supplier or merchant.
55
73
  # @return [Mindee::Parsing::Standard::StringField]
56
74
  attr_reader :supplier_name
@@ -60,6 +78,9 @@ module Mindee
60
78
  # The phone number of the supplier or merchant.
61
79
  # @return [Mindee::Parsing::Standard::StringField]
62
80
  attr_reader :supplier_phone_number
81
+ # The website URL of the supplier or merchant.
82
+ # @return [Mindee::Parsing::Standard::StringField]
83
+ attr_reader :supplier_website
63
84
  # List of tax lines information.
64
85
  # @return [Mindee::Parsing::Standard::Taxes]
65
86
  attr_reader :taxes
@@ -83,14 +104,17 @@ module Mindee
83
104
  # @param page_id [Integer, nil]
84
105
  def initialize(prediction, page_id)
85
106
  super()
107
+ @billing_address = StringField.new(prediction['billing_address'], page_id)
86
108
  @category = ClassificationField.new(prediction['category'], page_id)
87
109
  @customer_address = StringField.new(prediction['customer_address'], page_id)
88
110
  @customer_company_registrations = []
89
111
  prediction['customer_company_registrations'].each do |item|
90
112
  @customer_company_registrations.push(CompanyRegistrationField.new(item, page_id))
91
113
  end
114
+ @customer_id = StringField.new(prediction['customer_id'], page_id)
92
115
  @customer_name = StringField.new(prediction['customer_name'], page_id)
93
116
  @date = DateField.new(prediction['date'], page_id)
117
+ @document_number = StringField.new(prediction['document_number'], page_id)
94
118
  @document_type = ClassificationField.new(prediction['document_type'], page_id)
95
119
  @due_date = DateField.new(prediction['due_date'], page_id)
96
120
  @invoice_number = StringField.new(prediction['invoice_number'], page_id)
@@ -99,22 +123,26 @@ module Mindee
99
123
  @line_items.push(FinancialDocumentV1LineItem.new(item, page_id))
100
124
  end
101
125
  @locale = LocaleField.new(prediction['locale'], page_id)
126
+ @receipt_number = StringField.new(prediction['receipt_number'], page_id)
102
127
  @reference_numbers = []
103
128
  prediction['reference_numbers'].each do |item|
104
129
  @reference_numbers.push(StringField.new(item, page_id))
105
130
  end
131
+ @shipping_address = StringField.new(prediction['shipping_address'], page_id)
106
132
  @subcategory = ClassificationField.new(prediction['subcategory'], page_id)
107
133
  @supplier_address = StringField.new(prediction['supplier_address'], page_id)
108
134
  @supplier_company_registrations = []
109
135
  prediction['supplier_company_registrations'].each do |item|
110
136
  @supplier_company_registrations.push(CompanyRegistrationField.new(item, page_id))
111
137
  end
138
+ @supplier_email = StringField.new(prediction['supplier_email'], page_id)
112
139
  @supplier_name = StringField.new(prediction['supplier_name'], page_id)
113
140
  @supplier_payment_details = []
114
141
  prediction['supplier_payment_details'].each do |item|
115
142
  @supplier_payment_details.push(PaymentDetailsField.new(item, page_id))
116
143
  end
117
144
  @supplier_phone_number = StringField.new(prediction['supplier_phone_number'], page_id)
145
+ @supplier_website = StringField.new(prediction['supplier_website'], page_id)
118
146
  @taxes = Taxes.new(prediction['taxes'], page_id)
119
147
  @time = StringField.new(prediction['time'], page_id)
120
148
  @tip = AmountField.new(prediction['tip'], page_id)
@@ -133,6 +161,8 @@ module Mindee
133
161
  out_str = String.new
134
162
  out_str << "\n:Locale: #{@locale}".rstrip
135
163
  out_str << "\n:Invoice Number: #{@invoice_number}".rstrip
164
+ out_str << "\n:Receipt Number: #{@receipt_number}".rstrip
165
+ out_str << "\n:Document Number: #{@document_number}".rstrip
136
166
  out_str << "\n:Reference Numbers: #{reference_numbers}".rstrip
137
167
  out_str << "\n:Purchase Date: #{@date}".rstrip
138
168
  out_str << "\n:Due Date: #{@due_date}".rstrip
@@ -145,8 +175,13 @@ module Mindee
145
175
  out_str << "\n:Supplier Address: #{@supplier_address}".rstrip
146
176
  out_str << "\n:Supplier Phone Number: #{@supplier_phone_number}".rstrip
147
177
  out_str << "\n:Customer Name: #{@customer_name}".rstrip
178
+ out_str << "\n:Supplier Website: #{@supplier_website}".rstrip
179
+ out_str << "\n:Supplier Email: #{@supplier_email}".rstrip
148
180
  out_str << "\n:Customer Company Registrations: #{customer_company_registrations}".rstrip
149
181
  out_str << "\n:Customer Address: #{@customer_address}".rstrip
182
+ out_str << "\n:Customer ID: #{@customer_id}".rstrip
183
+ out_str << "\n:Shipping Address: #{@shipping_address}".rstrip
184
+ out_str << "\n:Billing Address: #{@billing_address}".rstrip
150
185
  out_str << "\n:Document Type: #{@document_type}".rstrip
151
186
  out_str << "\n:Purchase Subcategory: #{@subcategory}".rstrip
152
187
  out_str << "\n:Purchase Category: #{@category}".rstrip
@@ -6,7 +6,7 @@ require_relative 'financial_document_v1_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module FinancialDocument
9
- # Financial Document V1 page.
9
+ # Financial Document API version 1.7 page data.
10
10
  class FinancialDocumentV1Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -9,7 +9,7 @@ module Mindee
9
9
  module FR
10
10
  # Bank Account Details module.
11
11
  module BankAccountDetails
12
- # Bank Account Details V1 prediction inference.
12
+ # Bank Account Details API version 1 inference prediction.
13
13
  class BankAccountDetailsV1 < Mindee::Parsing::Common::Inference
14
14
  @endpoint_name = 'bank_account_details'
15
15
  @endpoint_version = '1'
@@ -6,7 +6,7 @@ module Mindee
6
6
  module Product
7
7
  module FR
8
8
  module BankAccountDetails
9
- # Bank Account Details V1 document prediction.
9
+ # Bank Account Details API version 1.0 document data.
10
10
  class BankAccountDetailsV1Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # The name of the account holder as seen on the document.