diff --git a/docs/global_products/financial_document_v1.md b/docs/global_products/financial_document_v1.md index 41a41855..28ac6b84 100644 --- a/docs/global_products/financial_document_v1.md +++ b/docs/global_products/financial_document_v1.md @@ -12,7 +12,7 @@ The Ruby Client Library supports the [Financial Document API](https://platform.m > | Specification | Details | > | ------------------------------ | -------------------------------------------------- | > | Endpoint Name | `financial_document` | -> | Recommended Version | `v1.11` | +> | Recommended Version | `v1.12` | > | Supports Polling/Webhooks | βœ”οΈ Yes | > | Support Synchronous HTTP Calls | βœ”οΈ Yes | > | Geography | 🌐 Global | @@ -93,7 +93,7 @@ puts result.document ######## Document ######## -:Mindee ID: f469a24d-3875-4a83-ad43-e0d5aa9da604 +:Mindee ID: a80ac0ee-26f6-4e2e-988a-960b240d5ba7 :Filename: default_sample.jpg Inference @@ -118,7 +118,7 @@ Prediction +---------------+--------+----------+---------------+ | Base | Code | Rate (%) | Amount | +===============+========+==========+===============+ - | | | 5.00 | 9.75 | + | 195.00 | | 5.00 | 9.75 | +---------------+--------+----------+---------------+ :Supplier Payment Details: :Supplier Name: JOHN SMITH @@ -170,7 +170,7 @@ Page 0 +---------------+--------+----------+---------------+ | Base | Code | Rate (%) | Amount | +===============+========+==========+===============+ - | | | 5.00 | 9.75 | + | 195.00 | | 5.00 | 9.75 | +---------------+--------+----------+---------------+ :Supplier Payment Details: :Supplier Name: JOHN SMITH @@ -382,6 +382,24 @@ puts result.document.inference.prediction.document_number.value puts result.document.inference.prediction.document_type.value ``` +## Document Type Extended +**document_type_extended** ([ClassificationField](#classification-field)): Document type extended. + +#### Possible values include: + - 'CREDIT NOTE' + - 'INVOICE' + - 'OTHER' + - 'OTHER_FINANCIAL' + - 'PAYSLIP' + - 'PURCHASE ORDER' + - 'QUOTE' + - 'RECEIPT' + - 'STATEMENT' + +```rb +puts result.document.inference.prediction.document_type_extended.value +``` + ## Due Date **due_date** ([DateField](#date-field)): The date on which the payment is due. diff --git a/docs/global_products/invoices_v4.md b/docs/global_products/invoices_v4.md index f23346a3..81fb8f3d 100644 --- a/docs/global_products/invoices_v4.md +++ b/docs/global_products/invoices_v4.md @@ -12,7 +12,7 @@ The Ruby Client Library supports the [Invoice API](https://platform.mindee.com/m > | Specification | Details | > | ------------------------------ | -------------------------------------------------- | > | Endpoint Name | `invoices` | -> | Recommended Version | `v4.9` | +> | Recommended Version | `v4.10` | > | Supports Polling/Webhooks | βœ”οΈ Yes | > | Support Synchronous HTTP Calls | βœ”οΈ Yes | > | Geography | 🌐 Global | @@ -93,7 +93,7 @@ puts result.document ######## Document ######## -:Mindee ID: 86b1833f-138b-4a01-8387-860204b0e631 +:Mindee ID: b55db8f9-ae3b-4f05-b2f1-ec0ced5e5b70 :Filename: default_sample.jpg Inference @@ -117,7 +117,7 @@ Prediction +---------------+--------+----------+---------------+ | Base | Code | Rate (%) | Amount | +===============+========+==========+===============+ - | | | 8.00 | 193.20 | + | 2145.00 | | 8.00 | 193.20 | +---------------+--------+----------+---------------+ :Supplier Payment Details: :Supplier Name: TURNPIKE DESIGNS @@ -163,7 +163,7 @@ Page 0 +---------------+--------+----------+---------------+ | Base | Code | Rate (%) | Amount | +===============+========+==========+===============+ - | | | 8.00 | 193.20 | + | 2145.00 | | 8.00 | 193.20 | +---------------+--------+----------+---------------+ :Supplier Payment Details: :Supplier Name: TURNPIKE DESIGNS @@ -344,6 +344,24 @@ puts result.document.inference.prediction.date.value puts result.document.inference.prediction.document_type.value ``` +## Document Type Extended +**document_type_extended** ([ClassificationField](#classification-field)): Document type extended. + +#### Possible values include: + - 'CREDIT NOTE' + - 'INVOICE' + - 'OTHER' + - 'OTHER_FINANCIAL' + - 'PAYSLIP' + - 'PURCHASE ORDER' + - 'QUOTE' + - 'RECEIPT' + - 'STATEMENT' + +```rb +puts result.document.inference.prediction.document_type_extended.value +``` + ## Due Date **due_date** ([DateField](#date-field)): The date on which the payment is due. diff --git a/docs/localized_products/us_healthcare_cards_v1.md b/docs/localized_products/us_healthcare_cards_v1.md index e4452bf0..1ae07dbb 100644 --- a/docs/localized_products/us_healthcare_cards_v1.md +++ b/docs/localized_products/us_healthcare_cards_v1.md @@ -12,7 +12,7 @@ The Ruby Client Library supports the [Healthcare Card API](https://platform.mind > | Specification | Details | > | ------------------------------ | -------------------------------------------------- | > | Endpoint Name | `us_healthcare_cards` | -> | Recommended Version | `v1.1` | +> | Recommended Version | `v1.2` | > | Supports Polling/Webhooks | βœ”οΈ Yes | > | Support Synchronous HTTP Calls | ❌ No | > | Geography | πŸ‡ΊπŸ‡Έ United States | @@ -138,6 +138,15 @@ A `HealthcareCardV1Copay` implements the following attributes: * `service_fees` (Float): The price of service. * `service_name` (String): The name of service of the copay. +#### Possible values include: + - primary_care + - emergency_room + - urgent_care + - specialist + - office_visit + - prescription + + # Attributes The following fields are extracted for Healthcare Card V1: @@ -222,6 +231,13 @@ puts result.document.inference.prediction.rx_bin.value puts result.document.inference.prediction.rx_grp.value ``` +## RX ID +**rx_id** ([StringField](#string-field)): The ID number for prescription drug coverage. + +```rb +puts result.document.inference.prediction.rx_id.value +``` + ## RX PCN **rx_pcn** ([StringField](#string-field)): The PCN number for prescription drug coverage. diff --git a/lib/mindee/product/financial_document/financial_document_v1_document.rb b/lib/mindee/product/financial_document/financial_document_v1_document.rb index 77da1d8b..beb49848 100644 --- a/lib/mindee/product/financial_document/financial_document_v1_document.rb +++ b/lib/mindee/product/financial_document/financial_document_v1_document.rb @@ -6,7 +6,7 @@ module Mindee module Product module FinancialDocument - # Financial Document API version 1.11 document data. + # Financial Document API version 1.12 document data. class FinancialDocumentV1Document < Mindee::Parsing::Common::Prediction include Mindee::Parsing::Standard # The customer's address used for billing. @@ -37,6 +37,9 @@ class FinancialDocumentV1Document < Mindee::Parsing::Common::Prediction # RECEIPT if it is a receipt. # @return [Mindee::Parsing::Standard::ClassificationField] attr_reader :document_type + # Document type extended. + # @return [Mindee::Parsing::Standard::ClassificationField] + attr_reader :document_type_extended # The date on which the payment is due. # @return [Mindee::Parsing::Standard::DateField] attr_reader :due_date @@ -144,6 +147,10 @@ def initialize(prediction, page_id) prediction['document_type'], page_id ) + @document_type_extended = Parsing::Standard::ClassificationField.new( + prediction['document_type_extended'], + page_id + ) @due_date = Parsing::Standard::DateField.new( prediction['due_date'], page_id @@ -262,6 +269,7 @@ def to_s out_str << "\n:Shipping Address: #{@shipping_address}".rstrip out_str << "\n:Billing Address: #{@billing_address}".rstrip out_str << "\n:Document Type: #{@document_type}".rstrip + out_str << "\n:Document Type Extended: #{@document_type_extended}".rstrip out_str << "\n:Purchase Subcategory: #{@subcategory}".rstrip out_str << "\n:Purchase Category: #{@category}".rstrip out_str << "\n:Total Tax: #{@total_tax}".rstrip diff --git a/lib/mindee/product/financial_document/financial_document_v1_page.rb b/lib/mindee/product/financial_document/financial_document_v1_page.rb index 5917e3e9..68d39741 100644 --- a/lib/mindee/product/financial_document/financial_document_v1_page.rb +++ b/lib/mindee/product/financial_document/financial_document_v1_page.rb @@ -6,7 +6,7 @@ module Mindee module Product module FinancialDocument - # Financial Document API version 1.11 page data. + # Financial Document API version 1.12 page data. class FinancialDocumentV1Page < Mindee::Parsing::Common::Page # @param prediction [Hash] def initialize(prediction) diff --git a/lib/mindee/product/invoice/invoice_v4_document.rb b/lib/mindee/product/invoice/invoice_v4_document.rb index 88561e4f..095f0862 100644 --- a/lib/mindee/product/invoice/invoice_v4_document.rb +++ b/lib/mindee/product/invoice/invoice_v4_document.rb @@ -6,7 +6,7 @@ module Mindee module Product module Invoice - # Invoice API version 4.9 document data. + # Invoice API version 4.10 document data. class InvoiceV4Document < Mindee::Parsing::Common::Prediction include Mindee::Parsing::Standard # The customer billing address. @@ -30,6 +30,9 @@ class InvoiceV4Document < Mindee::Parsing::Common::Prediction # Document type: INVOICE or CREDIT NOTE. # @return [Mindee::Parsing::Standard::ClassificationField] attr_reader :document_type + # Document type extended. + # @return [Mindee::Parsing::Standard::ClassificationField] + attr_reader :document_type_extended # The date on which the payment is due. # @return [Mindee::Parsing::Standard::DateField] attr_reader :due_date @@ -117,6 +120,10 @@ def initialize(prediction, page_id) prediction['document_type'], page_id ) + @document_type_extended = Parsing::Standard::ClassificationField.new( + prediction['document_type_extended'], + page_id + ) @due_date = Parsing::Standard::DateField.new( prediction['due_date'], page_id @@ -222,6 +229,7 @@ def to_s out_str << "\n:Shipping Address: #{@shipping_address}".rstrip out_str << "\n:Billing Address: #{@billing_address}".rstrip out_str << "\n:Document Type: #{@document_type}".rstrip + out_str << "\n:Document Type Extended: #{@document_type_extended}".rstrip out_str << "\n:Line Items:" out_str << line_items out_str[1..].to_s diff --git a/lib/mindee/product/invoice/invoice_v4_page.rb b/lib/mindee/product/invoice/invoice_v4_page.rb index f8f33616..3125bef0 100644 --- a/lib/mindee/product/invoice/invoice_v4_page.rb +++ b/lib/mindee/product/invoice/invoice_v4_page.rb @@ -6,7 +6,7 @@ module Mindee module Product module Invoice - # Invoice API version 4.9 page data. + # Invoice API version 4.10 page data. class InvoiceV4Page < Mindee::Parsing::Common::Page # @param prediction [Hash] def initialize(prediction) diff --git a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb index 296e8f06..347905c0 100644 --- a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +++ b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb @@ -39,7 +39,7 @@ def table_printable_values printable = {} printable[:service_fees] = @service_fees.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@service_fees) - printable[:service_name] = format_for_display(@service_name, nil) + printable[:service_name] = format_for_display(@service_name, 20) printable end @@ -48,7 +48,7 @@ def to_table_line printable = table_printable_values out_str = String.new out_str << format('| %- 13s', printable[:service_fees]) - out_str << format('| %- 13s', printable[:service_name]) + out_str << format('| %- 21s', printable[:service_name]) out_str << '|' end diff --git a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb index 16c401fe..7133420d 100644 --- a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb +++ b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb @@ -27,7 +27,7 @@ def initialize(prediction, page_id) def self.line_items_separator(char) out_str = String.new out_str << "+#{char * 14}" - out_str << "+#{char * 14}" + out_str << "+#{char * 22}" out_str end @@ -41,7 +41,7 @@ def to_s out_str = String.new out_str << ("\n#{self.class.line_items_separator('-')}\n ") out_str << ' | Service Fees' - out_str << ' | Service Name' + out_str << ' | Service Name ' out_str << (" |\n#{self.class.line_items_separator('=')}") out_str + lines end diff --git a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb index 357c8236..8f2f3dcb 100644 --- a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +++ b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb @@ -7,7 +7,7 @@ module Mindee module Product module US module HealthcareCard - # Healthcare Card API version 1.1 document data. + # Healthcare Card API version 1.2 document data. class HealthcareCardV1Document < Mindee::Parsing::Common::Prediction include Mindee::Parsing::Standard # The name of the company that provides the healthcare plan. @@ -43,6 +43,9 @@ class HealthcareCardV1Document < Mindee::Parsing::Common::Prediction # The group number for prescription drug coverage. # @return [Mindee::Parsing::Standard::StringField] attr_reader :rx_grp + # The ID number for prescription drug coverage. + # @return [Mindee::Parsing::Standard::StringField] + attr_reader :rx_id # The PCN number for prescription drug coverage. # @return [Mindee::Parsing::Standard::StringField] attr_reader :rx_pcn @@ -92,6 +95,7 @@ def initialize(prediction, page_id) prediction['rx_grp'], page_id ) + @rx_id = Parsing::Standard::StringField.new(prediction['rx_id'], page_id) @rx_pcn = Parsing::Standard::StringField.new( prediction['rx_pcn'], page_id @@ -111,6 +115,7 @@ def to_s out_str << "\n:Group Number: #{@group_number}".rstrip out_str << "\n:Payer ID: #{@payer_id}".rstrip out_str << "\n:RX BIN: #{@rx_bin}".rstrip + out_str << "\n:RX ID: #{@rx_id}".rstrip out_str << "\n:RX GRP: #{@rx_grp}".rstrip out_str << "\n:RX PCN: #{@rx_pcn}".rstrip out_str << "\n:copays:" @@ -127,7 +132,7 @@ def copays_separator(char) out_str = String.new out_str << ' ' out_str << "+#{char * 14}" - out_str << "+#{char * 14}" + out_str << "+#{char * 22}" out_str << '+' out_str end @@ -141,7 +146,7 @@ def copays_to_s out_str << "\n#{copays_separator('-')}" out_str << "\n |" out_str << ' Service Fees |' - out_str << ' Service Name |' + out_str << ' Service Name |' out_str << "\n#{copays_separator('=')}" out_str << "\n #{line_items}" out_str << "\n#{copays_separator('-')}" diff --git a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb index b4b572e1..e23dd6f3 100644 --- a/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +++ b/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb @@ -7,7 +7,7 @@ module Mindee module Product module US module HealthcareCard - # Healthcare Card API version 1.1 page data. + # Healthcare Card API version 1.2 page data. class HealthcareCardV1Page < Mindee::Parsing::Common::Page # @param prediction [Hash] def initialize(prediction) diff --git a/sig/mindee/product/financial_document/financial_document_v1_document.rbs b/sig/mindee/product/financial_document/financial_document_v1_document.rbs index b38c14b8..7e58ab0c 100644 --- a/sig/mindee/product/financial_document/financial_document_v1_document.rbs +++ b/sig/mindee/product/financial_document/financial_document_v1_document.rbs @@ -14,6 +14,7 @@ module Mindee def date: -> (Parsing::Standard::DateField) def document_number: -> (Parsing::Standard::StringField) def document_type: -> (Parsing::Standard::ClassificationField) + def document_type_extended: -> (Parsing::Standard::ClassificationField) def due_date: -> (Parsing::Standard::DateField) def invoice_number: -> (Parsing::Standard::StringField) def line_items: -> (Product::FinancialDocument::FinancialDocumentV1LineItems) diff --git a/sig/mindee/product/invoice/invoice_v4_document.rbs b/sig/mindee/product/invoice/invoice_v4_document.rbs index bb69dd3d..29f0233d 100644 --- a/sig/mindee/product/invoice/invoice_v4_document.rbs +++ b/sig/mindee/product/invoice/invoice_v4_document.rbs @@ -12,6 +12,7 @@ module Mindee def customer_name: -> (Parsing::Standard::StringField) def date: -> (Parsing::Standard::DateField) def document_type: -> (Parsing::Standard::ClassificationField) + def document_type_extended: -> (Parsing::Standard::ClassificationField) def due_date: -> (Parsing::Standard::DateField) def invoice_number: -> (Parsing::Standard::StringField) def line_items: -> (Product::Invoice::InvoiceV4LineItems) diff --git a/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs b/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs index 9dccc1c5..f0efc21e 100644 --- a/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +++ b/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs @@ -17,6 +17,7 @@ module Mindee def payer_id: -> (Parsing::Standard::StringField) def rx_bin: -> (Parsing::Standard::StringField) def rx_grp: -> (Parsing::Standard::StringField) + def rx_id: -> (Parsing::Standard::StringField) def rx_pcn: -> (Parsing::Standard::StringField) def copays_separator: (String) -> String def copays_to_s: -> String diff --git a/spec/data b/spec/data index 01336a09..0c9cfe34 160000 --- a/spec/data +++ b/spec/data @@ -1 +1 @@ -Subproject commit 01336a096b6e31d30668afdb86b3f677d8ed93d0 +Subproject commit 0c9cfe3416babad79b0689b40eb71917ab996beb diff --git a/spec/product/financial_document_v1_spec.rb b/spec/product/financial_document_v1_spec.rb index ae3d2c23..1bd40bf5 100644 --- a/spec/product/financial_document_v1_spec.rb +++ b/spec/product/financial_document_v1_spec.rb @@ -22,6 +22,26 @@ expect(prediction.invoice_number.bounding_box).to be_nil expect(prediction.date.value).to be_nil expect(prediction.date.page_id).to be_nil + expect(prediction.locale.value).to be_nil + expect(prediction.total_amount.value).to be_nil + expect(prediction.total_net.value).to be_nil + expect(prediction.total_tax.value).to be_nil + expect(prediction.billing_address.value).to be_nil + expect(prediction.due_date.value).to be_nil + expect(prediction.document_number.value).to be_nil + expect(prediction.document_type.value).to eq('EXPENSE RECEIPT') + expect(prediction.document_type_extended.value).to eq('EXPENSE RECEIPT') + expect(prediction.supplier_name.value).to be_nil + expect(prediction.supplier_address.value).to be_nil + expect(prediction.customer_id.value).to be_nil + expect(prediction.customer_name.value).to be_nil + expect(prediction.customer_address.value).to be_nil + expect(prediction.customer_company_registrations.length).to eq(0) + expect(prediction.taxes.length).to eq(0) + expect(prediction.supplier_payment_details.length).to eq(0) + expect(prediction.supplier_company_registrations.length).to eq(0) + expect(prediction.tip.value).to be_nil + expect(prediction.time.value).to be_nil end it 'should load a complete document prediction' do