Skip to content

Commit 8bd43cb

Browse files
✨ add support for address fields + update products
1 parent b5f4d99 commit 8bd43cb

23 files changed

Lines changed: 311 additions & 131 deletions

docs/energy_bill_fra_v1.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,58 @@ echo $apiResponse->document;
3333
########
3434
Document
3535
########
36-
:Mindee ID: 17f0ccef-e3fe-4a28-838d-d704489d6ce7
36+
:Mindee ID: ff1f2ca8-4d29-44d8-a564-599a982a4ef7
3737
:Filename: default_sample.pdf
3838
3939
Inference
4040
#########
41-
:Product: mindee/energy_bill_fra v1.0
42-
:Rotation applied: No
41+
:Product: mindee/energy_bill_fra v1.2
42+
:Rotation applied: Yes
4343
4444
Prediction
4545
==========
46-
:Invoice Number: 10123590373
47-
:Contract ID: 1234567890
46+
:Invoice Number: 1234567890
47+
:Contract ID: 9876543210
4848
:Delivery Point: 98765432109876
4949
:Invoice Date: 2021-01-29
5050
:Due Date: 2021-02-15
5151
:Total Before Taxes: 1241.03
5252
:Total Taxes: 238.82
5353
:Total Amount: 1479.85
5454
:Energy Supplier:
55-
:Address: TSA 12345, 12345 DEMOCITY CEDEX, 75001 PARIS
55+
:Address: TSA 12345, 12345 DEMOCITY CEDEX
5656
:Name: EDF
5757
:Energy Consumer:
58-
:Address: 12 AVENUE DES RÊVES, RDC A 123 COUR FAUSSE A, 75000 PARIS
59-
:Name: John Doe
58+
:Address: 123 RUE DE L'IMAGINAIRE, 75001 PARIS
59+
:Name: JOHN DOE
6060
:Subscription:
6161
+--------------------------------------+------------+------------+----------+-----------+------------+
6262
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
6363
+======================================+============+============+==========+===========+============+
6464
| Abonnement électricité | 2021-02-28 | 2021-01-01 | 5.50 | 59.00 | 29.50 |
6565
+--------------------------------------+------------+------------+----------+-----------+------------+
6666
:Energy Usage:
67-
+--------------------------------------+------------+------------+----------+-----------+------------+
68-
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
69-
+======================================+============+============+==========+===========+============+
70-
| Consommation (HT) | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | 10.47 |
71-
+--------------------------------------+------------+------------+----------+-----------+------------+
67+
+-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+
68+
| Consumption | Description | End Date | Start Date | Tax Rate | Total | Unit of Measure | Unit Price |
69+
+=============+======================================+============+============+==========+===========+=================+============+
70+
| 8581.00 | Consommation électricité | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | kWh | 0.1047 |
71+
+-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+
7272
:Taxes and Contributions:
7373
+--------------------------------------+------------+------------+----------+-----------+------------+
7474
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
7575
+======================================+============+============+==========+===========+============+
76-
| Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 2.25 |
76+
| Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 0.0225 |
7777
+--------------------------------------+------------+------------+----------+-----------+------------+
78-
| Départementale sur la Conso Final... | 2020-12-31 | 2020-11-28 | 20.00 | 13.98 | 0.3315 |
78+
| Taxe Départementale sur la Conso ... | 2021-01-27 | 2020-11-28 | 20.00 | 13.98 | 0.003315 |
7979
+--------------------------------------+------------+------------+----------+-----------+------------+
80-
| Communale sur la Conso Finale Ele... | 2021-01-27 | 2021-01-01 | 20.00 | 28.56 | 0.6545 |
80+
| Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 28.56 | 0.006545 |
8181
+--------------------------------------+------------+------------+----------+-----------+------------+
82-
| Contribution Tarifaire d'Achemine... | 2020-12-31 | 2020-11-28 | 20.00 | 27.96 | 0.663 |
82+
| Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 27.96 | 0.00663 |
8383
+--------------------------------------+------------+------------+----------+-----------+------------+
8484
:Meter Details:
8585
:Meter Number: 620
8686
:Meter Type: electricity
87-
:Unit of Measure: kWh
87+
:Unit of Power: 36kVA
8888
```
8989

9090
# Field Types

docs/expense_receipts_v5.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ The following fields are extracted for Receipt V5:
222222
- 'gasoline'
223223
- 'telecom'
224224
- 'miscellaneous'
225+
- 'software'
226+
- 'shopping'
227+
- 'energy'
225228

226229
```php
227230
echo $result->document->inference->prediction->category->value;
@@ -278,6 +281,15 @@ echo $result->document->inference->prediction->receiptNumber->value;
278281
- 'train'
279282
- 'restaurant'
280283
- 'shopping'
284+
- 'other'
285+
- 'groceries'
286+
- 'cultural'
287+
- 'electronics'
288+
- 'office_supplies'
289+
- 'micromobility'
290+
- 'car_rental'
291+
- 'public'
292+
- 'delivery'
281293
- null
282294

283295
```php

docs/financial_document_v1.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ echo $apiResponse->document;
5353
########
5454
Document
5555
########
56-
:Mindee ID: a80ac0ee-26f6-4e2e-988a-960b240d5ba7
56+
:Mindee ID: 6dd26385-719b-4527-bf6f-87d9da619de5
5757
:Filename: default_sample.jpg
5858
5959
Inference
6060
#########
61-
:Product: mindee/financial_document v1.11
61+
:Product: mindee/financial_document v1.14
6262
:Rotation applied: Yes
6363
6464
Prediction
@@ -94,6 +94,7 @@ Prediction
9494
:Shipping Address: 2019 Redbud Drive New York, NY 10011
9595
:Billing Address: 4312 Wood Road New York, NY 10031
9696
:Document Type: INVOICE
97+
:Document Type Extended: INVOICE
9798
:Purchase Subcategory:
9899
:Purchase Category: miscellaneous
99100
:Total Tax: 9.75
@@ -146,6 +147,7 @@ Page 0
146147
:Shipping Address: 2019 Redbud Drive New York, NY 10011
147148
:Billing Address: 4312 Wood Road New York, NY 10031
148149
:Document Type: INVOICE
150+
:Document Type Extended: INVOICE
149151
:Purchase Subcategory:
150152
:Purchase Category: miscellaneous
151153
:Total Tax: 9.75
@@ -183,6 +185,20 @@ A typical `BaseField` object will have the following attributes:
183185

184186
Aside from the previous attributes, all basic fields have access to a custom `__toString` method that can be used to print their value as a string.
185187

188+
### AddressField
189+
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:
190+
191+
* **streetNumber** (`?string`): String representation of the street number. Can be `null`.
192+
* **streetName** (`?string`): Name of the street. Can be `null`.
193+
* **poBox** (`?string`): String representation of the PO Box number. Can be `null`.
194+
* **addressComplement** (`?string`): Address complement. Can be `null`.
195+
* **city** (`?string`): City name. Can be `null`.
196+
* **postalCode** (`?string`): String representation of the postal code. Can be `null`.
197+
* **state** (`?string`): State name. Can be `null`.
198+
* **country** (`?string`): Country name. Can be `null`.
199+
200+
Note: The `value` field of an AddressField should be a concatenation of the rest of the values.
201+
186202

187203
### AmountField
188204
The amount field `AmountField` only has one constraint: its **value** is an optional `?float`.
@@ -266,7 +282,7 @@ echo $result->document->inference->prediction->billingAddress->value;
266282
```
267283

268284
## Purchase Category
269-
**category** : The purchase category, only for receipts.
285+
**category** : The purchase category.
270286

271287
#### Possible values include:
272288
- 'toll'
@@ -277,6 +293,9 @@ echo $result->document->inference->prediction->billingAddress->value;
277293
- 'gasoline'
278294
- 'telecom'
279295
- 'miscellaneous'
296+
- 'software'
297+
- 'shopping'
298+
- 'energy'
280299

281300
```php
282301
echo $result->document->inference->prediction->category->value;
@@ -428,14 +447,23 @@ echo $result->document->inference->prediction->shippingAddress->value;
428447
```
429448

430449
## Purchase Subcategory
431-
**subcategory** : The purchase subcategory for transport and food, only for receipts.
450+
**subcategory** : The purchase subcategory for transport, food and shooping.
432451

433452
#### Possible values include:
434453
- 'plane'
435454
- 'taxi'
436455
- 'train'
437456
- 'restaurant'
438457
- 'shopping'
458+
- 'other'
459+
- 'groceries'
460+
- 'cultural'
461+
- 'electronics'
462+
- 'office_supplies'
463+
- 'micromobility'
464+
- 'car_rental'
465+
- 'public'
466+
- 'delivery'
439467
- null
440468

441469
```php

docs/ind_passport_v1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Document
3838
3939
Inference
4040
#########
41-
:Product: mindee/ind_passport v1.0
41+
:Product: mindee/ind_passport v1.2
4242
:Rotation applied: Yes
4343
4444
Prediction
@@ -61,10 +61,10 @@ Prediction
6161
:Name of Mother:
6262
:Old Passport Date of Issue:
6363
:Old Passport Number:
64+
:Old Passport Place of Issue:
6465
:Address Line 1:
6566
:Address Line 2:
6667
:Address Line 3:
67-
:Old Passport Place of Issue:
6868
:File Number:
6969
```
7070

docs/invoices_v4.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ echo $apiResponse->document;
5353
########
5454
Document
5555
########
56-
:Mindee ID: b55db8f9-ae3b-4f05-b2f1-ec0ced5e5b70
56+
:Mindee ID: 744748d5-9051-461c-b70c-bbf81f5ff943
5757
:Filename: default_sample.jpg
5858
5959
Inference
6060
#########
61-
:Product: mindee/invoices v4.9
61+
:Product: mindee/invoices v4.11
6262
:Rotation applied: Yes
6363
6464
Prediction
@@ -93,6 +93,9 @@ Prediction
9393
:Shipping Address:
9494
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
9595
:Document Type: INVOICE
96+
:Document Type Extended: INVOICE
97+
:Purchase Subcategory:
98+
:Purchase Category: miscellaneous
9699
:Line Items:
97100
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
98101
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
@@ -139,6 +142,9 @@ Page 0
139142
:Shipping Address:
140143
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
141144
:Document Type: INVOICE
145+
:Document Type Extended: INVOICE
146+
:Purchase Subcategory:
147+
:Purchase Category: miscellaneous
142148
:Line Items:
143149
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
144150
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
@@ -171,6 +177,20 @@ A typical `BaseField` object will have the following attributes:
171177

172178
Aside from the previous attributes, all basic fields have access to a custom `__toString` method that can be used to print their value as a string.
173179

180+
### AddressField
181+
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:
182+
183+
* **streetNumber** (`?string`): String representation of the street number. Can be `null`.
184+
* **streetName** (`?string`): Name of the street. Can be `null`.
185+
* **poBox** (`?string`): String representation of the PO Box number. Can be `null`.
186+
* **addressComplement** (`?string`): Address complement. Can be `null`.
187+
* **city** (`?string`): City name. Can be `null`.
188+
* **postalCode** (`?string`): String representation of the postal code. Can be `null`.
189+
* **state** (`?string`): State name. Can be `null`.
190+
* **country** (`?string`): Country name. Can be `null`.
191+
192+
Note: The `value` field of an AddressField should be a concatenation of the rest of the values.
193+
174194

175195
### AmountField
176196
The amount field `AmountField` only has one constraint: its **value** is an optional `?float`.
@@ -253,6 +273,25 @@ The following fields are extracted for Invoice V4:
253273
echo $result->document->inference->prediction->billingAddress->value;
254274
```
255275

276+
## Purchase Category
277+
**category** : The purchase category.
278+
279+
#### Possible values include:
280+
- 'toll'
281+
- 'food'
282+
- 'parking'
283+
- 'transport'
284+
- 'accommodation'
285+
- 'telecom'
286+
- 'miscellaneous'
287+
- 'software'
288+
- 'shopping'
289+
- 'energy'
290+
291+
```php
292+
echo $result->document->inference->prediction->category->value;
293+
```
294+
256295
## Customer Address
257296
**customerAddress** : The address of the customer.
258297

@@ -382,6 +421,30 @@ foreach ($result->document->inference->prediction->referenceNumbers as $referenc
382421
echo $result->document->inference->prediction->shippingAddress->value;
383422
```
384423

424+
## Purchase Subcategory
425+
**subcategory** : The purchase subcategory for transport, food and shopping.
426+
427+
#### Possible values include:
428+
- 'plane'
429+
- 'taxi'
430+
- 'train'
431+
- 'restaurant'
432+
- 'shopping'
433+
- 'other'
434+
- 'groceries'
435+
- 'cultural'
436+
- 'electronics'
437+
- 'office_supplies'
438+
- 'micromobility'
439+
- 'car_rental'
440+
- 'public'
441+
- 'delivery'
442+
- null
443+
444+
```php
445+
echo $result->document->inference->prediction->subcategory->value;
446+
```
447+
385448
## Supplier Address
386449
**supplierAddress** : The address of the supplier or merchant.
387450

0 commit comments

Comments
 (0)