Skip to content

Commit 5e2d6c9

Browse files
♻️ fix internal, indexes & CLI for products (#337)
1 parent f7b3944 commit 5e2d6c9

25 files changed

+683
-386
lines changed

docs/expense_receipts_v5.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ The `Taxes` field represents an array-like collection of `TaxField` objects. As
207207
Fields which are specific to this product; they are not used in any other product.
208208

209209
### Line Items Field
210-
List of line item details.
210+
List of all line items on the receipt.
211211

212212
A `ReceiptV5LineItem` implements the following attributes:
213213

@@ -220,17 +220,17 @@ A `ReceiptV5LineItem` implements the following attributes:
220220
The following fields are extracted for Receipt V5:
221221

222222
## Purchase Category
223-
**category** ([ClassificationField](#classification-field)): The purchase category among predefined classes.
223+
**category** ([ClassificationField](#classification-field)): The purchase category of the receipt.
224224

225225
#### Possible values include:
226-
- toll
227-
- food
228-
- parking
229-
- transport
230-
- accommodation
231-
- gasoline
232-
- telecom
233-
- miscellaneous
226+
- 'toll'
227+
- 'food'
228+
- 'parking'
229+
- 'transport'
230+
- 'accommodation'
231+
- 'gasoline'
232+
- 'telecom'
233+
- 'miscellaneous'
234234

235235
```js
236236
console.log(result.document.inference.prediction.category.value);
@@ -244,18 +244,18 @@ console.log(result.document.inference.prediction.date.value);
244244
```
245245

246246
## Document Type
247-
**documentType** ([ClassificationField](#classification-field)): One of: 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
247+
**documentType** ([ClassificationField](#classification-field)): The type of receipt: EXPENSE RECEIPT or CREDIT CARD RECEIPT.
248248

249249
#### Possible values include:
250-
- expense_receipt
251-
- credit_card_receipt
250+
- 'EXPENSE RECEIPT'
251+
- 'CREDIT CARD RECEIPT'
252252

253253
```js
254254
console.log(result.document.inference.prediction.documentType.value);
255255
```
256256

257257
## Line Items
258-
**lineItems** ([ReceiptV5LineItem](#line-items-field)[]): List of line item details.
258+
**lineItems** ([ReceiptV5LineItem](#line-items-field)[]): List of all line items on the receipt.
259259

260260
```js
261261
for (const lineItemsElem of result.document.inference.prediction.lineItems) {
@@ -264,7 +264,7 @@ for (const lineItemsElem of result.document.inference.prediction.lineItems) {
264264
```
265265

266266
## Expense Locale
267-
**locale** ([LocaleField](#locale-field)): The locale detected on the document.
267+
**locale** ([LocaleField](#locale-field)): The locale of the document.
268268

269269
```js
270270
console.log(result.document.inference.prediction.locale.value);
@@ -278,14 +278,15 @@ console.log(result.document.inference.prediction.receiptNumber.value);
278278
```
279279

280280
## Purchase Subcategory
281-
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
281+
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory of the receipt for transport and food.
282282

283283
#### Possible values include:
284-
- plane
285-
- taxi
286-
- train
287-
- restaurant
288-
- shopping
284+
- 'plane'
285+
- 'taxi'
286+
- 'train'
287+
- 'restaurant'
288+
- 'shopping'
289+
- null
289290

290291
```js
291292
console.log(result.document.inference.prediction.subcategory.value);
@@ -299,7 +300,7 @@ console.log(result.document.inference.prediction.supplierAddress.value);
299300
```
300301

301302
## Supplier Company Registrations
302-
**supplierCompanyRegistrations** ([CompanyRegistrationField](#company-registration-field)[]): List of company registrations associated to the supplier.
303+
**supplierCompanyRegistrations** ([CompanyRegistrationField](#company-registration-field)[]): List of company registration numbers associated to the supplier.
303304

304305
```js
305306
for (const supplierCompanyRegistrationsElem of result.document.inference.prediction.supplierCompanyRegistrations) {
@@ -322,7 +323,7 @@ console.log(result.document.inference.prediction.supplierPhoneNumber.value);
322323
```
323324

324325
## Taxes
325-
**taxes** ([TaxField](#taxes-field)[]): List of tax lines information.
326+
**taxes** ([TaxField](#taxes-field)[]): The list of taxes present on the receipt.
326327

327328
```js
328329
for (const taxesElem of result.document.inference.prediction.taxes) {
@@ -359,7 +360,7 @@ console.log(result.document.inference.prediction.totalNet.value);
359360
```
360361

361362
## Total Tax
362-
**totalTax** ([AmountField](#amount-field)): The total amount of taxes.
363+
**totalTax** ([AmountField](#amount-field)): The sum of all taxes.
363364

364365
```js
365366
console.log(result.document.inference.prediction.totalTax.value);

docs/financial_document_v1.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ The `Taxes` field represents an array-like collection of `TaxField` objects. As
251251
Fields which are specific to this product; they are not used in any other product.
252252

253253
### Line Items Field
254-
List of line item details.
254+
List of line item present on the document.
255255

256256
A `FinancialDocumentV1LineItem` implements the following attributes:
257257

@@ -275,17 +275,17 @@ console.log(result.document.inference.prediction.billingAddress.value);
275275
```
276276

277277
## Purchase Category
278-
**category** ([ClassificationField](#classification-field)): The purchase category among predefined classes.
278+
**category** ([ClassificationField](#classification-field)): The purchase category, only for receipts.
279279

280280
#### Possible values include:
281-
- toll
282-
- food
283-
- parking
284-
- transport
285-
- accommodation
286-
- gasoline
287-
- telecom
288-
- miscellaneous
281+
- 'toll'
282+
- 'food'
283+
- 'parking'
284+
- 'transport'
285+
- 'accommodation'
286+
- 'gasoline'
287+
- 'telecom'
288+
- 'miscellaneous'
289289

290290
```js
291291
console.log(result.document.inference.prediction.category.value);
@@ -299,7 +299,7 @@ console.log(result.document.inference.prediction.customerAddress.value);
299299
```
300300

301301
## Customer Company Registrations
302-
**customerCompanyRegistrations** ([CompanyRegistrationField](#company-registration-field)[]): List of company registrations associated to the customer.
302+
**customerCompanyRegistrations** ([CompanyRegistrationField](#company-registration-field)[]): List of company registration numbers associated to the customer.
303303

304304
```js
305305
for (const customerCompanyRegistrationsElem of result.document.inference.prediction.customerCompanyRegistrations) {
@@ -329,20 +329,20 @@ console.log(result.document.inference.prediction.date.value);
329329
```
330330

331331
## Document Number
332-
**documentNumber** ([StringField](#string-field)): The document number or identifier.
332+
**documentNumber** ([StringField](#string-field)): The document number or identifier (invoice number or receipt number).
333333

334334
```js
335335
console.log(result.document.inference.prediction.documentNumber.value);
336336
```
337337

338338
## Document Type
339-
**documentType** ([ClassificationField](#classification-field)): One of: 'INVOICE', 'CREDIT NOTE', 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
339+
**documentType** ([ClassificationField](#classification-field)): The type of the document: INVOICE or CREDIT NOTE if it is an invoice, CREDIT CARD RECEIPT or EXPENSE RECEIPT if it is a receipt.
340340

341341
#### Possible values include:
342-
- INVOICE
343-
- CREDIT NOTE
344-
- CREDIT CARD RECEIPT
345-
- EXPENSE RECEIPT
342+
- 'INVOICE'
343+
- 'CREDIT NOTE'
344+
- 'CREDIT CARD RECEIPT'
345+
- 'EXPENSE RECEIPT'
346346

347347
```js
348348
console.log(result.document.inference.prediction.documentType.value);
@@ -363,7 +363,7 @@ console.log(result.document.inference.prediction.invoiceNumber.value);
363363
```
364364

365365
## Line Items
366-
**lineItems** ([FinancialDocumentV1LineItem](#line-items-field)[]): List of line item details.
366+
**lineItems** ([FinancialDocumentV1LineItem](#line-items-field)[]): List of line item present on the document.
367367

368368
```js
369369
for (const lineItemsElem of result.document.inference.prediction.lineItems) {
@@ -372,7 +372,7 @@ for (const lineItemsElem of result.document.inference.prediction.lineItems) {
372372
```
373373

374374
## Locale
375-
**locale** ([LocaleField](#locale-field)): The locale detected on the document.
375+
**locale** ([LocaleField](#locale-field)): The locale of the document.
376376

377377
```js
378378
console.log(result.document.inference.prediction.locale.value);
@@ -386,7 +386,7 @@ console.log(result.document.inference.prediction.paymentDate.value);
386386
```
387387

388388
## Purchase Order Number
389-
**poNumber** ([StringField](#string-field)): The purchase order number.
389+
**poNumber** ([StringField](#string-field)): The purchase order number, only if the document is an invoice.
390390

391391
```js
392392
console.log(result.document.inference.prediction.poNumber.value);
@@ -400,7 +400,7 @@ console.log(result.document.inference.prediction.receiptNumber.value);
400400
```
401401

402402
## Reference Numbers
403-
**referenceNumbers** ([StringField](#string-field)[]): List of Reference numbers, including PO number.
403+
**referenceNumbers** ([StringField](#string-field)[]): List of Reference numbers, including PO number, only if the document is an invoice.
404404

405405
```js
406406
for (const referenceNumbersElem of result.document.inference.prediction.referenceNumbers) {
@@ -416,14 +416,15 @@ console.log(result.document.inference.prediction.shippingAddress.value);
416416
```
417417

418418
## Purchase Subcategory
419-
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
419+
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport and food, only for receipts.
420420

421421
#### Possible values include:
422-
- plane
423-
- taxi
424-
- train
425-
- restaurant
426-
- shopping
422+
- 'plane'
423+
- 'taxi'
424+
- 'train'
425+
- 'restaurant'
426+
- 'shopping'
427+
- null
427428

428429
```js
429430
console.log(result.document.inference.prediction.subcategory.value);
@@ -437,7 +438,7 @@ console.log(result.document.inference.prediction.supplierAddress.value);
437438
```
438439

439440
## Supplier Company Registrations
440-
**supplierCompanyRegistrations** ([CompanyRegistrationField](#company-registration-field)[]): List of company registrations associated to the supplier.
441+
**supplierCompanyRegistrations** ([CompanyRegistrationField](#company-registration-field)[]): List of company registration numbers associated to the supplier.
441442

442443
```js
443444
for (const supplierCompanyRegistrationsElem of result.document.inference.prediction.supplierCompanyRegistrations) {
@@ -460,7 +461,7 @@ console.log(result.document.inference.prediction.supplierName.value);
460461
```
461462

462463
## Supplier Payment Details
463-
**supplierPaymentDetails** ([PaymentDetailsField](#payment-details-field)[]): List of payment details associated to the supplier.
464+
**supplierPaymentDetails** ([PaymentDetailsField](#payment-details-field)[]): List of payment details associated to the supplier (only for invoices).
464465

465466
```js
466467
for (const supplierPaymentDetailsElem of result.document.inference.prediction.supplierPaymentDetails) {
@@ -486,7 +487,7 @@ console.log(result.document.inference.prediction.supplierWebsite.value);
486487
```
487488

488489
## Taxes
489-
**taxes** ([TaxField](#taxes-field)[]): List of tax lines information.
490+
**taxes** ([TaxField](#taxes-field)[]): List of all taxes on the document.
490491

491492
```js
492493
for (const taxesElem of result.document.inference.prediction.taxes) {
@@ -495,7 +496,7 @@ for (const taxesElem of result.document.inference.prediction.taxes) {
495496
```
496497

497498
## Purchase Time
498-
**time** ([StringField](#string-field)): The time the purchase was made.
499+
**time** ([StringField](#string-field)): The time the purchase was made (only for receipts).
499500

500501
```js
501502
console.log(result.document.inference.prediction.time.value);
@@ -523,7 +524,7 @@ console.log(result.document.inference.prediction.totalNet.value);
523524
```
524525

525526
## Total Tax
526-
**totalTax** ([AmountField](#amount-field)): The total amount of taxes.
527+
**totalTax** ([AmountField](#amount-field)): The sum of all taxes present on the document.
527528

528529
```js
529530
console.log(result.document.inference.prediction.totalTax.value);

docs/idcard_fr_v2.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ console.log(result.document.inference.prediction.documentNumber.value);
177177
[📄](#page-level-fields "This field is only present on individual pages.")**documentSide** ([ClassificationField](#classification-field)): The sides of the document which are visible.
178178

179179
#### Possible values include:
180-
- RECTO
181-
- VERSO
182-
- RECTO & VERSO
180+
- 'RECTO'
181+
- 'VERSO'
182+
- 'RECTO & VERSO'
183183

184184
```js
185185
for (const documentSideElem of result.document.documentSide) {
@@ -191,8 +191,8 @@ for (const documentSideElem of result.document.documentSide) {
191191
[📄](#page-level-fields "This field is only present on individual pages.")**documentType** ([ClassificationField](#classification-field)): The document type or format.
192192

193193
#### Possible values include:
194-
- NEW
195-
- OLD
194+
- 'NEW'
195+
- 'OLD'
196196

197197
```js
198198
for (const documentTypeElem of result.document.documentType) {

docs/ind_passport_v1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ console.log(result.document.inference.prediction.fileNumber.value);
171171
**gender** ([ClassificationField](#classification-field)): The gender of the passport holder.
172172

173173
#### Possible values include:
174-
- M
175-
- F
174+
- 'M'
175+
- 'F'
176176

177177
```js
178178
console.log(result.document.inference.prediction.gender.value);
@@ -266,8 +266,8 @@ console.log(result.document.inference.prediction.oldPassportPlaceOfIssue.value);
266266
**pageNumber** ([ClassificationField](#classification-field)): The page number of the passport document.
267267

268268
#### Possible values include:
269-
- 1
270-
- 2
269+
- '1'
270+
- '2'
271271

272272
```js
273273
console.log(result.document.inference.prediction.pageNumber.value);

docs/international_id_v2.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ console.log(result.document.inference.prediction.documentNumber.value);
145145
**documentType** ([ClassificationField](#classification-field)): The type of personal identification document.
146146

147147
#### Possible values include:
148-
- IDENTIFICATION_CARD
149-
- PASSPORT
150-
- DRIVER_LICENSE
151-
- VISA
152-
- RESIDENCY_CARD
153-
- VOTER_REGISTRATION
148+
- 'IDENTIFICATION_CARD'
149+
- 'PASSPORT'
150+
- 'DRIVER_LICENSE'
151+
- 'VISA'
152+
- 'RESIDENCY_CARD'
153+
- 'VOTER_REGISTRATION'
154154

155155
```js
156156
console.log(result.document.inference.prediction.documentType.value);

docs/invoice_splitter_v1.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,19 @@ Document
4444
4545
Inference
4646
#########
47-
:Product: mindee/invoice_splitter v1.1
47+
:Product: mindee/invoice_splitter v1.2
4848
:Rotation applied: No
4949
5050
Prediction
5151
==========
5252
:Invoice Page Groups:
53-
:Page indexes: 0
54-
:Page indexes: 1
55-
56-
Page Predictions
57-
================
58-
59-
Page 0
60-
------
61-
:Invoice Page Groups:
62-
63-
Page 1
64-
------
65-
:Invoice Page Groups:
53+
+--------------------------------------------------------------------------+
54+
| Page Indexes |
55+
+==========================================================================+
56+
| 0 |
57+
+--------------------------------------------------------------------------+
58+
| 1 |
59+
+--------------------------------------------------------------------------+
6660
```
6761

6862
# Field Types

0 commit comments

Comments
 (0)