diff --git a/bin/v1/products.rb b/bin/v1/products.rb index 7f7b9186..e7133fc8 100644 --- a/bin/v1/products.rb +++ b/bin/v1/products.rb @@ -13,36 +13,12 @@ sync: true, async: false, }, - 'bill-of-lading' => { - description: 'Bill of Lading', - doc_class: Mindee::V1::Product::BillOfLading::BillOfLadingV1, - sync: false, - async: true, - }, - 'business-card' => { - description: 'Business Card', - doc_class: Mindee::V1::Product::BusinessCard::BusinessCardV1, - sync: false, - async: true, - }, 'cropper' => { description: 'Cropper', doc_class: Mindee::V1::Product::Cropper::CropperV1, sync: true, async: false, }, - 'delivery-note' => { - description: 'Delivery note', - doc_class: Mindee::V1::Product::DeliveryNote::DeliveryNoteV1, - sync: false, - async: true, - }, - 'driver-license' => { - description: 'Driver License', - doc_class: Mindee::V1::Product::DriverLicense::DriverLicenseV1, - sync: false, - async: true, - }, 'financial-document' => { description: 'Financial Document', doc_class: Mindee::V1::Product::FinancialDocument::FinancialDocumentV1, @@ -61,42 +37,12 @@ sync: false, async: true, }, - 'fr-carte-grise' => { - description: 'Carte Grise', - doc_class: Mindee::V1::Product::FR::CarteGrise::CarteGriseV1, - sync: true, - async: false, - }, - 'fr-energy-bill' => { - description: 'Energy Bill', - doc_class: Mindee::V1::Product::FR::EnergyBill::EnergyBillV1, - sync: false, - async: true, - }, - 'fr-health-card' => { - description: 'Health Card', - doc_class: Mindee::V1::Product::FR::HealthCard::HealthCardV1, - sync: false, - async: true, - }, 'fr-carte-nationale-d-identite' => { description: "Carte Nationale d'Identité", doc_class: Mindee::V1::Product::FR::IdCard::IdCardV2, sync: true, async: false, }, - 'fr-payslip' => { - description: 'Payslip', - doc_class: Mindee::V1::Product::FR::Payslip::PayslipV3, - sync: false, - async: true, - }, - 'ind-passport-india' => { - description: 'Passport - India', - doc_class: Mindee::V1::Product::IND::IndianPassport::IndianPassportV1, - sync: false, - async: true, - }, 'international-id' => { description: 'International ID', doc_class: Mindee::V1::Product::InternationalId::InternationalIdV2, @@ -121,12 +67,6 @@ sync: true, async: false, }, - 'nutrition-facts-label' => { - description: 'Nutrition Facts Label', - doc_class: Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1, - sync: false, - async: true, - }, 'passport' => { description: 'Passport', doc_class: Mindee::V1::Product::Passport::PassportV1, @@ -145,22 +85,4 @@ sync: false, async: true, }, - 'us-bank-check' => { - description: 'Bank Check', - doc_class: Mindee::V1::Product::US::BankCheck::BankCheckV1, - sync: true, - async: false, - }, - 'us-healthcare-card' => { - description: 'Healthcare Card', - doc_class: Mindee::V1::Product::US::HealthcareCard::HealthcareCardV1, - sync: false, - async: true, - }, - 'us-us-mail' => { - description: 'US Mail', - doc_class: Mindee::V1::Product::US::UsMail::UsMailV3, - sync: false, - async: true, - }, }.freeze diff --git a/docs/code_samples/bank_check_v1.txt b/docs/code_samples/bank_check_v1.txt deleted file mode 100644 index c2448b08..00000000 --- a/docs/code_samples/bank_check_v1.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::US::BankCheck::BankCheckV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/bill_of_lading_v1_async.txt b/docs/code_samples/bill_of_lading_v1_async.txt deleted file mode 100644 index 1eef474c..00000000 --- a/docs/code_samples/bill_of_lading_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::BillOfLading::BillOfLadingV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/business_card_v1_async.txt b/docs/code_samples/business_card_v1_async.txt deleted file mode 100644 index f525dbae..00000000 --- a/docs/code_samples/business_card_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::BusinessCard::BusinessCardV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/carte_grise_v1.txt b/docs/code_samples/carte_grise_v1.txt deleted file mode 100644 index 0eb8dc53..00000000 --- a/docs/code_samples/carte_grise_v1.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::FR::CarteGrise::CarteGriseV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/delivery_notes_v1_async.txt b/docs/code_samples/delivery_notes_v1_async.txt deleted file mode 100644 index 64137cf8..00000000 --- a/docs/code_samples/delivery_notes_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::DeliveryNote::DeliveryNoteV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/driver_license_v1_async.txt b/docs/code_samples/driver_license_v1_async.txt deleted file mode 100644 index c4ab94e8..00000000 --- a/docs/code_samples/driver_license_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::DriverLicense::DriverLicenseV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/energy_bill_fra_v1_async.txt b/docs/code_samples/energy_bill_fra_v1_async.txt deleted file mode 100644 index 0e170a68..00000000 --- a/docs/code_samples/energy_bill_fra_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::FR::EnergyBill::EnergyBillV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/french_healthcard_v1_async.txt b/docs/code_samples/french_healthcard_v1_async.txt deleted file mode 100644 index 0be5668a..00000000 --- a/docs/code_samples/french_healthcard_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::FR::HealthCard::HealthCardV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/ind_passport_v1_async.txt b/docs/code_samples/ind_passport_v1_async.txt deleted file mode 100644 index 5ce6154d..00000000 --- a/docs/code_samples/ind_passport_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::IND::IndianPassport::IndianPassportV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/nutrition_facts_v1_async.txt b/docs/code_samples/nutrition_facts_v1_async.txt deleted file mode 100644 index 996d6cb8..00000000 --- a/docs/code_samples/nutrition_facts_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/payslip_fra_v3_async.txt b/docs/code_samples/payslip_fra_v3_async.txt deleted file mode 100644 index 32034963..00000000 --- a/docs/code_samples/payslip_fra_v3_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::FR::Payslip::PayslipV3 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/us_healthcare_cards_v1_async.txt b/docs/code_samples/us_healthcare_cards_v1_async.txt deleted file mode 100644 index f1322456..00000000 --- a/docs/code_samples/us_healthcare_cards_v1_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::US::HealthcareCard::HealthcareCardV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/us_mail_v3_async.txt b/docs/code_samples/us_mail_v3_async.txt deleted file mode 100644 index 69074a0b..00000000 --- a/docs/code_samples/us_mail_v3_async.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::US::UsMail::UsMailV3 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/lib/mindee/v1/product.rb b/lib/mindee/v1/product.rb index 61cce8af..1758b29c 100644 --- a/lib/mindee/v1/product.rb +++ b/lib/mindee/v1/product.rb @@ -1,31 +1,18 @@ # frozen_string_literal: true require_relative 'product/barcode_reader/barcode_reader_v1' -require_relative 'product/bill_of_lading/bill_of_lading_v1' -require_relative 'product/business_card/business_card_v1' require_relative 'product/cropper/cropper_v1' -require_relative 'product/delivery_note/delivery_note_v1' -require_relative 'product/driver_license/driver_license_v1' require_relative 'product/financial_document/financial_document_v1' require_relative 'product/fr/bank_account_details/bank_account_details_v1' require_relative 'product/fr/bank_account_details/bank_account_details_v2' require_relative 'product/fr/bank_statement/bank_statement_v2' -require_relative 'product/fr/carte_grise/carte_grise_v1' -require_relative 'product/fr/energy_bill/energy_bill_v1' -require_relative 'product/fr/health_card/health_card_v1' require_relative 'product/fr/id_card/id_card_v1' require_relative 'product/fr/id_card/id_card_v2' -require_relative 'product/fr/payslip/payslip_v3' -require_relative 'product/ind/indian_passport/indian_passport_v1' require_relative 'product/international_id/international_id_v2' require_relative 'product/invoice/invoice_v4' require_relative 'product/invoice_splitter/invoice_splitter_v1' require_relative 'product/multi_receipts_detector/multi_receipts_detector_v1' -require_relative 'product/nutrition_facts_label/nutrition_facts_label_v1' require_relative 'product/passport/passport_v1' require_relative 'product/receipt/receipt_v5' require_relative 'product/resume/resume_v1' require_relative 'product/universal/universal' -require_relative 'product/us/bank_check/bank_check_v1' -require_relative 'product/us/healthcare_card/healthcare_card_v1' -require_relative 'product/us/us_mail/us_mail_v3' diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1.rb deleted file mode 100644 index ca5bfa7f..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'bill_of_lading_v1_document' -require_relative 'bill_of_lading_v1_page' - -module Mindee - module V1 - module Product - # Bill of Lading module. - module BillOfLading - # Bill of Lading API version 1 inference prediction. - class BillOfLadingV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'bill_of_lading' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = BillOfLadingV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(BillOfLadingV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier.rb deleted file mode 100644 index 53170905..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module BillOfLading - # The shipping company responsible for transporting the goods. - class BillOfLadingV1Carrier < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The name of the carrier. - # @return [String] - attr_reader :name - # The professional number of the carrier. - # @return [String] - attr_reader :professional_number - # The Standard Carrier Alpha Code (SCAC) of the carrier. - # @return [String] - attr_reader :scac - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @name = prediction['name'] - @professional_number = prediction['professional_number'] - @scac = prediction['scac'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:name] = format_for_display(@name) - printable[:professional_number] = format_for_display(@professional_number) - printable[:scac] = format_for_display(@scac) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Name: #{printable[:name]}" - out_str << "\n :Professional Number: #{printable[:professional_number]}" - out_str << "\n :SCAC: #{printable[:scac]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb deleted file mode 100644 index d09a0732..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module BillOfLading - # The goods being shipped. - class BillOfLadingV1CarrierItem < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # A description of the item. - # @return [String] - attr_reader :description - # The gross weight of the item. - # @return [Float] - attr_reader :gross_weight - # The measurement of the item. - # @return [Float] - attr_reader :measurement - # The unit of measurement for the measurement. - # @return [String] - attr_reader :measurement_unit - # The quantity of the item being shipped. - # @return [Float] - attr_reader :quantity - # The unit of measurement for weights. - # @return [String] - attr_reader :weight_unit - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @description = prediction['description'] - @gross_weight = prediction['gross_weight'] - @measurement = prediction['measurement'] - @measurement_unit = prediction['measurement_unit'] - @quantity = prediction['quantity'] - @weight_unit = prediction['weight_unit'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:description] = format_for_display(@description) - printable[:gross_weight] = - @gross_weight.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@gross_weight) - printable[:measurement] = - @measurement.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@measurement) - printable[:measurement_unit] = format_for_display(@measurement_unit) - printable[:quantity] = - @quantity.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@quantity) - printable[:weight_unit] = format_for_display(@weight_unit) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:description] = format_for_display(@description, 36) - printable[:gross_weight] = - @gross_weight.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@gross_weight) - printable[:measurement] = - @measurement.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@measurement) - printable[:measurement_unit] = format_for_display(@measurement_unit, nil) - printable[:quantity] = - @quantity.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@quantity) - printable[:weight_unit] = format_for_display(@weight_unit, nil) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 37s', printable[:description]) - out_str << format('| %- 13s', printable[:gross_weight]) - out_str << format('| %- 12s', printable[:measurement]) - out_str << format('| %- 17s', printable[:measurement_unit]) - out_str << format('| %- 9s', printable[:quantity]) - out_str << format('| %- 12s', printable[:weight_unit]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Description: #{printable[:description]}" - out_str << "\n :Gross Weight: #{printable[:gross_weight]}" - out_str << "\n :Measurement: #{printable[:measurement]}" - out_str << "\n :Measurement Unit: #{printable[:measurement_unit]}" - out_str << "\n :Quantity: #{printable[:quantity]}" - out_str << "\n :Weight Unit: #{printable[:weight_unit]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb deleted file mode 100644 index 9bb74df0..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -require_relative 'bill_of_lading_v1_shipper' -require_relative 'bill_of_lading_v1_consignee' -require_relative 'bill_of_lading_v1_notify_party' -require_relative 'bill_of_lading_v1_carrier' -require_relative 'bill_of_lading_v1_carrier_item' - -module Mindee - module V1 - module Product - module BillOfLading - # The goods being shipped. - class BillOfLadingV1CarrierItems < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - BillOfLading::BillOfLadingV1CarrierItem.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 38}" - out_str << "+#{char * 14}" - out_str << "+#{char * 13}" - out_str << "+#{char * 18}" - out_str << "+#{char * 10}" - out_str << "+#{char * 13}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Description ' - out_str << ' | Gross Weight' - out_str << ' | Measurement' - out_str << ' | Measurement Unit' - out_str << ' | Quantity' - out_str << ' | Weight Unit' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_consignee.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_consignee.rb deleted file mode 100644 index 32ce3f3c..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_consignee.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module BillOfLading - # The party to whom the goods are being shipped. - class BillOfLadingV1Consignee < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The address of the consignee. - # @return [String] - attr_reader :address - # The email of the shipper. - # @return [String] - attr_reader :email - # The name of the consignee. - # @return [String] - attr_reader :name - # The phone number of the consignee. - # @return [String] - attr_reader :phone - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = prediction['address'] - @email = prediction['email'] - @name = prediction['name'] - @phone = prediction['phone'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:address] = format_for_display(@address) - printable[:email] = format_for_display(@email) - printable[:name] = format_for_display(@name) - printable[:phone] = format_for_display(@phone) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Address: #{printable[:address]}" - out_str << "\n :Email: #{printable[:email]}" - out_str << "\n :Name: #{printable[:name]}" - out_str << "\n :Phone: #{printable[:phone]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_document.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_document.rb deleted file mode 100644 index 2dd5d95b..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_document.rb +++ /dev/null @@ -1,165 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'bill_of_lading_v1_shipper' -require_relative 'bill_of_lading_v1_consignee' -require_relative 'bill_of_lading_v1_notify_party' -require_relative 'bill_of_lading_v1_carrier' -require_relative 'bill_of_lading_v1_carrier_items' - -module Mindee - module V1 - module Product - module BillOfLading - # Bill of Lading API version 1.1 document data. - class BillOfLadingV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # A unique identifier assigned to a Bill of Lading document. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :bill_of_lading_number - # The shipping company responsible for transporting the goods. - # @return [Mindee::V1::Product::BillOfLading::BillOfLadingV1Carrier] - attr_reader :carrier - # The goods being shipped. - # @return [Mindee::V1::Product::BillOfLading::BillOfLadingV1CarrierItems] - attr_reader :carrier_items - # The party to whom the goods are being shipped. - # @return [Mindee::V1::Product::BillOfLading::BillOfLadingV1Consignee] - attr_reader :consignee - # The date when the bill of lading is issued. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :date_of_issue - # The date when the vessel departs from the port of loading. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :departure_date - # The party to be notified of the arrival of the goods. - # @return [Mindee::V1::Product::BillOfLading::BillOfLadingV1NotifyParty] - attr_reader :notify_party - # The place where the goods are to be delivered. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :place_of_delivery - # The port where the goods are unloaded from the vessel. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :port_of_discharge - # The port where the goods are loaded onto the vessel. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :port_of_loading - # The party responsible for shipping the goods. - # @return [Mindee::V1::Product::BillOfLading::BillOfLadingV1Shipper] - attr_reader :shipper - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @bill_of_lading_number = Parsing::Standard::StringField.new( - prediction['bill_of_lading_number'], - page_id - ) - @carrier = Product::BillOfLading::BillOfLadingV1Carrier.new( - prediction['carrier'], - page_id - ) - @carrier_items = Product::BillOfLading::BillOfLadingV1CarrierItems.new(prediction['carrier_items'], page_id) - @consignee = Product::BillOfLading::BillOfLadingV1Consignee.new( - prediction['consignee'], - page_id - ) - @date_of_issue = Parsing::Standard::DateField.new( - prediction['date_of_issue'], - page_id - ) - @departure_date = Parsing::Standard::DateField.new( - prediction['departure_date'], - page_id - ) - @notify_party = Product::BillOfLading::BillOfLadingV1NotifyParty.new( - prediction['notify_party'], - page_id - ) - @place_of_delivery = Parsing::Standard::StringField.new( - prediction['place_of_delivery'], - page_id - ) - @port_of_discharge = Parsing::Standard::StringField.new( - prediction['port_of_discharge'], - page_id - ) - @port_of_loading = Parsing::Standard::StringField.new( - prediction['port_of_loading'], - page_id - ) - @shipper = Product::BillOfLading::BillOfLadingV1Shipper.new( - prediction['shipper'], - page_id - ) - end - - # @return [String] - def to_s - shipper = @shipper.to_s - consignee = @consignee.to_s - notify_party = @notify_party.to_s - carrier = @carrier.to_s - carrier_items = carrier_items_to_s - out_str = String.new - out_str << "\n:Bill of Lading Number: #{@bill_of_lading_number}".rstrip - out_str << "\n:Shipper:" - out_str << shipper - out_str << "\n:Consignee:" - out_str << consignee - out_str << "\n:Notify Party:" - out_str << notify_party - out_str << "\n:Carrier:" - out_str << carrier - out_str << "\n:Items:" - out_str << carrier_items - out_str << "\n:Port of Loading: #{@port_of_loading}".rstrip - out_str << "\n:Port of Discharge: #{@port_of_discharge}".rstrip - out_str << "\n:Place of Delivery: #{@place_of_delivery}".rstrip - out_str << "\n:Date of issue: #{@date_of_issue}".rstrip - out_str << "\n:Departure Date: #{@departure_date}".rstrip - out_str[1..].to_s - end - - private - - # @param char [String] - # @return [String] - def carrier_items_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 38}" - out_str << "+#{char * 14}" - out_str << "+#{char * 13}" - out_str << "+#{char * 18}" - out_str << "+#{char * 10}" - out_str << "+#{char * 13}" - out_str << '+' - out_str - end - - # @return [String] - def carrier_items_to_s - return '' if @carrier_items.empty? - - line_items = @carrier_items.map(&:to_table_line).join("\n#{carrier_items_separator('-')}\n ") - out_str = String.new - out_str << "\n#{carrier_items_separator('-')}" - out_str << "\n |" - out_str << ' Description |' - out_str << ' Gross Weight |' - out_str << ' Measurement |' - out_str << ' Measurement Unit |' - out_str << ' Quantity |' - out_str << ' Weight Unit |' - out_str << "\n#{carrier_items_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{carrier_items_separator('-')}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_notify_party.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_notify_party.rb deleted file mode 100644 index 62048eae..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_notify_party.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module BillOfLading - # The party to be notified of the arrival of the goods. - class BillOfLadingV1NotifyParty < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The address of the notify party. - # @return [String] - attr_reader :address - # The email of the shipper. - # @return [String] - attr_reader :email - # The name of the notify party. - # @return [String] - attr_reader :name - # The phone number of the notify party. - # @return [String] - attr_reader :phone - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = prediction['address'] - @email = prediction['email'] - @name = prediction['name'] - @phone = prediction['phone'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:address] = format_for_display(@address) - printable[:email] = format_for_display(@email) - printable[:name] = format_for_display(@name) - printable[:phone] = format_for_display(@phone) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Address: #{printable[:address]}" - out_str << "\n :Email: #{printable[:email]}" - out_str << "\n :Name: #{printable[:name]}" - out_str << "\n :Phone: #{printable[:phone]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_page.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_page.rb deleted file mode 100644 index ccba782d..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_page.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'bill_of_lading_v1_document' - -module Mindee - module V1 - module Product - module BillOfLading - # Bill of Lading API version 1.1 page data. - class BillOfLadingV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - BillOfLadingV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Bill of Lading V1 page prediction. - class BillOfLadingV1PagePrediction < BillOfLadingV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_shipper.rb b/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_shipper.rb deleted file mode 100644 index b03eb1c2..00000000 --- a/lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_shipper.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module BillOfLading - # The party responsible for shipping the goods. - class BillOfLadingV1Shipper < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The address of the shipper. - # @return [String] - attr_reader :address - # The email of the shipper. - # @return [String] - attr_reader :email - # The name of the shipper. - # @return [String] - attr_reader :name - # The phone number of the shipper. - # @return [String] - attr_reader :phone - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = prediction['address'] - @email = prediction['email'] - @name = prediction['name'] - @phone = prediction['phone'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:address] = format_for_display(@address) - printable[:email] = format_for_display(@email) - printable[:name] = format_for_display(@name) - printable[:phone] = format_for_display(@phone) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Address: #{printable[:address]}" - out_str << "\n :Email: #{printable[:email]}" - out_str << "\n :Name: #{printable[:name]}" - out_str << "\n :Phone: #{printable[:phone]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/business_card/business_card_v1.rb b/lib/mindee/v1/product/business_card/business_card_v1.rb deleted file mode 100644 index e8c72e0f..00000000 --- a/lib/mindee/v1/product/business_card/business_card_v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'business_card_v1_document' -require_relative 'business_card_v1_page' - -module Mindee - module V1 - module Product - # Business Card module. - module BusinessCard - # Business Card API version 1 inference prediction. - class BusinessCardV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'business_card' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = BusinessCardV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(BusinessCardV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/business_card/business_card_v1_document.rb b/lib/mindee/v1/product/business_card/business_card_v1_document.rb deleted file mode 100644 index 8c13f19e..00000000 --- a/lib/mindee/v1/product/business_card/business_card_v1_document.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module BusinessCard - # Business Card API version 1.0 document data. - class BusinessCardV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The address of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :address - # The company the person works for. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :company - # The email address of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :email - # The Fax number of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :fax_number - # The given name of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :firstname - # The job title of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :job_title - # The lastname of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :lastname - # The mobile number of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mobile_number - # The phone number of the person. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :phone_number - # The social media profiles of the person or company. - # @return [Array] - attr_reader :social_media - # The website of the person or company. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :website - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = Parsing::Standard::StringField.new( - prediction['address'], - page_id - ) - @company = Parsing::Standard::StringField.new( - prediction['company'], - page_id - ) - @email = Parsing::Standard::StringField.new(prediction['email'], page_id) - @fax_number = Parsing::Standard::StringField.new( - prediction['fax_number'], - page_id - ) - @firstname = Parsing::Standard::StringField.new( - prediction['firstname'], - page_id - ) - @job_title = Parsing::Standard::StringField.new( - prediction['job_title'], - page_id - ) - @lastname = Parsing::Standard::StringField.new( - prediction['lastname'], - page_id - ) - @mobile_number = Parsing::Standard::StringField.new( - prediction['mobile_number'], - page_id - ) - @phone_number = Parsing::Standard::StringField.new( - prediction['phone_number'], - page_id - ) - @social_media = [] # : Array[Parsing::Standard::StringField] - prediction['social_media'].each do |item| - @social_media.push(Parsing::Standard::StringField.new(item, page_id)) - end - @website = Parsing::Standard::StringField.new( - prediction['website'], - page_id - ) - end - - # @return [String] - def to_s - social_media = @social_media.join("\n #{' ' * 14}") - out_str = String.new - out_str << "\n:Firstname: #{@firstname}".rstrip - out_str << "\n:Lastname: #{@lastname}".rstrip - out_str << "\n:Job Title: #{@job_title}".rstrip - out_str << "\n:Company: #{@company}".rstrip - out_str << "\n:Email: #{@email}".rstrip - out_str << "\n:Phone Number: #{@phone_number}".rstrip - out_str << "\n:Mobile Number: #{@mobile_number}".rstrip - out_str << "\n:Fax Number: #{@fax_number}".rstrip - out_str << "\n:Address: #{@address}".rstrip - out_str << "\n:Website: #{@website}".rstrip - out_str << "\n:Social Media: #{social_media}".rstrip - out_str[1..].to_s - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/business_card/business_card_v1_page.rb b/lib/mindee/v1/product/business_card/business_card_v1_page.rb deleted file mode 100644 index 2568b66d..00000000 --- a/lib/mindee/v1/product/business_card/business_card_v1_page.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'business_card_v1_document' - -module Mindee - module V1 - module Product - module BusinessCard - # Business Card API version 1.0 page data. - class BusinessCardV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - BusinessCardV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Business Card V1 page prediction. - class BusinessCardV1PagePrediction < BusinessCardV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/delivery_note/delivery_note_v1.rb b/lib/mindee/v1/product/delivery_note/delivery_note_v1.rb deleted file mode 100644 index 52195218..00000000 --- a/lib/mindee/v1/product/delivery_note/delivery_note_v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'delivery_note_v1_document' -require_relative 'delivery_note_v1_page' - -module Mindee - module V1 - module Product - # Delivery note module. - module DeliveryNote - # Delivery note API version 1 inference prediction. - class DeliveryNoteV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'delivery_notes' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = DeliveryNoteV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(DeliveryNoteV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/delivery_note/delivery_note_v1_document.rb b/lib/mindee/v1/product/delivery_note/delivery_note_v1_document.rb deleted file mode 100644 index 489bcf1e..00000000 --- a/lib/mindee/v1/product/delivery_note/delivery_note_v1_document.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module DeliveryNote - # Delivery note API version 1.2 document data. - class DeliveryNoteV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The address of the customer receiving the goods. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :customer_address - # The name of the customer receiving the goods. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :customer_name - # The date on which the delivery is scheduled to arrive. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :delivery_date - # A unique identifier for the delivery note. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :delivery_number - # The address of the supplier providing the goods. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :supplier_address - # The name of the supplier providing the goods. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :supplier_name - # The total monetary value of the goods being delivered. - # @return [Mindee::V1::Parsing::Standard::AmountField] - attr_reader :total_amount - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @customer_address = Parsing::Standard::StringField.new( - prediction['customer_address'], - page_id - ) - @customer_name = Parsing::Standard::StringField.new( - prediction['customer_name'], - page_id - ) - @delivery_date = Parsing::Standard::DateField.new( - prediction['delivery_date'], - page_id - ) - @delivery_number = Parsing::Standard::StringField.new( - prediction['delivery_number'], - page_id - ) - @supplier_address = Parsing::Standard::StringField.new( - prediction['supplier_address'], - page_id - ) - @supplier_name = Parsing::Standard::StringField.new( - prediction['supplier_name'], - page_id - ) - @total_amount = Parsing::Standard::AmountField.new( - prediction['total_amount'], - page_id - ) - end - - # @return [String] - def to_s - out_str = String.new - out_str << "\n:Delivery Date: #{@delivery_date}".rstrip - out_str << "\n:Delivery Number: #{@delivery_number}".rstrip - out_str << "\n:Supplier Name: #{@supplier_name}".rstrip - out_str << "\n:Supplier Address: #{@supplier_address}".rstrip - out_str << "\n:Customer Name: #{@customer_name}".rstrip - out_str << "\n:Customer Address: #{@customer_address}".rstrip - out_str << "\n:Total Amount: #{@total_amount}".rstrip - out_str[1..].to_s - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/delivery_note/delivery_note_v1_page.rb b/lib/mindee/v1/product/delivery_note/delivery_note_v1_page.rb deleted file mode 100644 index 2498c585..00000000 --- a/lib/mindee/v1/product/delivery_note/delivery_note_v1_page.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'delivery_note_v1_document' - -module Mindee - module V1 - module Product - module DeliveryNote - # Delivery note API version 1.2 page data. - class DeliveryNoteV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - DeliveryNoteV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Delivery note V1 page prediction. - class DeliveryNoteV1PagePrediction < DeliveryNoteV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/driver_license/driver_license_v1.rb b/lib/mindee/v1/product/driver_license/driver_license_v1.rb deleted file mode 100644 index c0f67c98..00000000 --- a/lib/mindee/v1/product/driver_license/driver_license_v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'driver_license_v1_document' -require_relative 'driver_license_v1_page' - -module Mindee - module V1 - module Product - # Driver License module. - module DriverLicense - # Driver License API version 1 inference prediction. - class DriverLicenseV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'driver_license' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = DriverLicenseV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(DriverLicenseV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/driver_license/driver_license_v1_document.rb b/lib/mindee/v1/product/driver_license/driver_license_v1_document.rb deleted file mode 100644 index 50c895a7..00000000 --- a/lib/mindee/v1/product/driver_license/driver_license_v1_document.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module DriverLicense - # Driver License API version 1.0 document data. - class DriverLicenseV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The category or class of the driver license. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :category - # The alpha-3 ISO 3166 code of the country where the driver license was issued. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :country_code - # The date of birth of the driver license holder. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :date_of_birth - # The DD number of the driver license. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :dd_number - # The expiry date of the driver license. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :expiry_date - # The first name of the driver license holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :first_name - # The unique identifier of the driver license. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :id - # The date when the driver license was issued. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :issued_date - # The authority that issued the driver license. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :issuing_authority - # The last name of the driver license holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :last_name - # The Machine Readable Zone (MRZ) of the driver license. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mrz - # The place of birth of the driver license holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :place_of_birth - # Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :state - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @category = Parsing::Standard::StringField.new( - prediction['category'], - page_id - ) - @country_code = Parsing::Standard::StringField.new( - prediction['country_code'], - page_id - ) - @date_of_birth = Parsing::Standard::DateField.new( - prediction['date_of_birth'], - page_id - ) - @dd_number = Parsing::Standard::StringField.new( - prediction['dd_number'], - page_id - ) - @expiry_date = Parsing::Standard::DateField.new( - prediction['expiry_date'], - page_id - ) - @first_name = Parsing::Standard::StringField.new( - prediction['first_name'], - page_id - ) - @id = Parsing::Standard::StringField.new(prediction['id'], page_id) - @issued_date = Parsing::Standard::DateField.new( - prediction['issued_date'], - page_id - ) - @issuing_authority = Parsing::Standard::StringField.new( - prediction['issuing_authority'], - page_id - ) - @last_name = Parsing::Standard::StringField.new( - prediction['last_name'], - page_id - ) - @mrz = Parsing::Standard::StringField.new(prediction['mrz'], page_id) - @place_of_birth = Parsing::Standard::StringField.new( - prediction['place_of_birth'], - page_id - ) - @state = Parsing::Standard::StringField.new(prediction['state'], page_id) - end - - # @return [String] - def to_s - out_str = String.new - out_str << "\n:Country Code: #{@country_code}".rstrip - out_str << "\n:State: #{@state}".rstrip - out_str << "\n:ID: #{@id}".rstrip - out_str << "\n:Category: #{@category}".rstrip - out_str << "\n:Last Name: #{@last_name}".rstrip - out_str << "\n:First Name: #{@first_name}".rstrip - out_str << "\n:Date of Birth: #{@date_of_birth}".rstrip - out_str << "\n:Place of Birth: #{@place_of_birth}".rstrip - out_str << "\n:Expiry Date: #{@expiry_date}".rstrip - out_str << "\n:Issued Date: #{@issued_date}".rstrip - out_str << "\n:Issuing Authority: #{@issuing_authority}".rstrip - out_str << "\n:MRZ: #{@mrz}".rstrip - out_str << "\n:DD Number: #{@dd_number}".rstrip - out_str[1..].to_s - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/driver_license/driver_license_v1_page.rb b/lib/mindee/v1/product/driver_license/driver_license_v1_page.rb deleted file mode 100644 index 25b76bcb..00000000 --- a/lib/mindee/v1/product/driver_license/driver_license_v1_page.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'driver_license_v1_document' - -module Mindee - module V1 - module Product - module DriverLicense - # Driver License API version 1.0 page data. - class DriverLicenseV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - DriverLicenseV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Driver License V1 page prediction. - class DriverLicenseV1PagePrediction < DriverLicenseV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1.rb b/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1.rb deleted file mode 100644 index 5c74be40..00000000 --- a/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'carte_grise_v1_document' -require_relative 'carte_grise_v1_page' - -module Mindee - module V1 - module Product - module FR - # Carte Grise module. - module CarteGrise - # Carte Grise API version 1 inference prediction. - class CarteGriseV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'carte_grise' - @endpoint_version = '1' - @has_async = false - @has_sync = true - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = CarteGriseV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(CarteGriseV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1_document.rb b/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1_document.rb deleted file mode 100644 index 33e07a39..00000000 --- a/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1_document.rb +++ /dev/null @@ -1,244 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module CarteGrise - # Carte Grise API version 1.1 document data. - class CarteGriseV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The vehicle's license plate number. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :a - # The vehicle's first release date. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :b - # The vehicle owner's full name including maiden name. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :c1 - # The vehicle owner's address. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :c3 - # Number of owners of the license certificate. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :c41 - # Mentions about the ownership of the vehicle. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :c4a - # The vehicle's brand. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :d1 - # The vehicle's commercial name. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :d3 - # The Vehicle Identification Number (VIN). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :e - # The vehicle's maximum admissible weight. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :f1 - # The vehicle's maximum admissible weight within the license's state. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :f2 - # The vehicle's maximum authorized weight with coupling. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :f3 - # The document's formula number. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :formula_number - # The vehicle's weight with coupling if tractor different than category M1. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :g - # The vehicle's national empty weight. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :g1 - # The car registration date of the given certificate. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :i - # The vehicle's category. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :j - # The vehicle's national type. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :j1 - # The vehicle's body type (CE). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :j2 - # The vehicle's body type (National designation). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :j3 - # Machine Readable Zone, first line. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mrz1 - # Machine Readable Zone, second line. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mrz2 - # The vehicle's owner first name. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :owner_first_name - # The vehicle's owner surname. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :owner_surname - # The vehicle engine's displacement (cm3). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :p1 - # The vehicle's maximum net power (kW). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :p2 - # The vehicle's fuel type or energy source. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :p3 - # The vehicle's administrative power (fiscal horsepower). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :p6 - # The vehicle's power to weight ratio. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :q - # The vehicle's number of seats. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :s1 - # The vehicle's number of standing rooms (person). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :s2 - # The vehicle's sound level (dB). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :u1 - # The vehicle engine's rotation speed (RPM). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :u2 - # The vehicle's CO2 emission (g/km). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :v7 - # Next technical control date. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :x1 - # Amount of the regional proportional tax of the registration (in euros). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :y1 - # Amount of the additional parafiscal tax of the registration (in euros). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :y2 - # Amount of the additional CO2 tax of the registration (in euros). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :y3 - # Amount of the fee for managing the registration (in euros). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :y4 - # Amount of the fee for delivery of the registration certificate in euros. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :y5 - # Total amount of registration fee to be paid in euros. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :y6 - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @a = Parsing::Standard::StringField.new(prediction['a'], page_id) - @b = Parsing::Standard::DateField.new(prediction['b'], page_id) - @c1 = Parsing::Standard::StringField.new(prediction['c1'], page_id) - @c3 = Parsing::Standard::StringField.new(prediction['c3'], page_id) - @c41 = Parsing::Standard::StringField.new(prediction['c41'], page_id) - @c4a = Parsing::Standard::StringField.new(prediction['c4a'], page_id) - @d1 = Parsing::Standard::StringField.new(prediction['d1'], page_id) - @d3 = Parsing::Standard::StringField.new(prediction['d3'], page_id) - @e = Parsing::Standard::StringField.new(prediction['e'], page_id) - @f1 = Parsing::Standard::StringField.new(prediction['f1'], page_id) - @f2 = Parsing::Standard::StringField.new(prediction['f2'], page_id) - @f3 = Parsing::Standard::StringField.new(prediction['f3'], page_id) - @formula_number = Parsing::Standard::StringField.new( - prediction['formula_number'], - page_id - ) - @g = Parsing::Standard::StringField.new(prediction['g'], page_id) - @g1 = Parsing::Standard::StringField.new(prediction['g1'], page_id) - @i = Parsing::Standard::DateField.new(prediction['i'], page_id) - @j = Parsing::Standard::StringField.new(prediction['j'], page_id) - @j1 = Parsing::Standard::StringField.new(prediction['j1'], page_id) - @j2 = Parsing::Standard::StringField.new(prediction['j2'], page_id) - @j3 = Parsing::Standard::StringField.new(prediction['j3'], page_id) - @mrz1 = Parsing::Standard::StringField.new(prediction['mrz1'], page_id) - @mrz2 = Parsing::Standard::StringField.new(prediction['mrz2'], page_id) - @owner_first_name = Parsing::Standard::StringField.new( - prediction['owner_first_name'], - page_id - ) - @owner_surname = Parsing::Standard::StringField.new( - prediction['owner_surname'], - page_id - ) - @p1 = Parsing::Standard::StringField.new(prediction['p1'], page_id) - @p2 = Parsing::Standard::StringField.new(prediction['p2'], page_id) - @p3 = Parsing::Standard::StringField.new(prediction['p3'], page_id) - @p6 = Parsing::Standard::StringField.new(prediction['p6'], page_id) - @q = Parsing::Standard::StringField.new(prediction['q'], page_id) - @s1 = Parsing::Standard::StringField.new(prediction['s1'], page_id) - @s2 = Parsing::Standard::StringField.new(prediction['s2'], page_id) - @u1 = Parsing::Standard::StringField.new(prediction['u1'], page_id) - @u2 = Parsing::Standard::StringField.new(prediction['u2'], page_id) - @v7 = Parsing::Standard::StringField.new(prediction['v7'], page_id) - @x1 = Parsing::Standard::StringField.new(prediction['x1'], page_id) - @y1 = Parsing::Standard::StringField.new(prediction['y1'], page_id) - @y2 = Parsing::Standard::StringField.new(prediction['y2'], page_id) - @y3 = Parsing::Standard::StringField.new(prediction['y3'], page_id) - @y4 = Parsing::Standard::StringField.new(prediction['y4'], page_id) - @y5 = Parsing::Standard::StringField.new(prediction['y5'], page_id) - @y6 = Parsing::Standard::StringField.new(prediction['y6'], page_id) - end - - # @return [String] - def to_s - out_str = String.new - out_str << "\n:a: #{@a}".rstrip - out_str << "\n:b: #{@b}".rstrip - out_str << "\n:c1: #{@c1}".rstrip - out_str << "\n:c3: #{@c3}".rstrip - out_str << "\n:c41: #{@c41}".rstrip - out_str << "\n:c4a: #{@c4a}".rstrip - out_str << "\n:d1: #{@d1}".rstrip - out_str << "\n:d3: #{@d3}".rstrip - out_str << "\n:e: #{@e}".rstrip - out_str << "\n:f1: #{@f1}".rstrip - out_str << "\n:f2: #{@f2}".rstrip - out_str << "\n:f3: #{@f3}".rstrip - out_str << "\n:g: #{@g}".rstrip - out_str << "\n:g1: #{@g1}".rstrip - out_str << "\n:i: #{@i}".rstrip - out_str << "\n:j: #{@j}".rstrip - out_str << "\n:j1: #{@j1}".rstrip - out_str << "\n:j2: #{@j2}".rstrip - out_str << "\n:j3: #{@j3}".rstrip - out_str << "\n:p1: #{@p1}".rstrip - out_str << "\n:p2: #{@p2}".rstrip - out_str << "\n:p3: #{@p3}".rstrip - out_str << "\n:p6: #{@p6}".rstrip - out_str << "\n:q: #{@q}".rstrip - out_str << "\n:s1: #{@s1}".rstrip - out_str << "\n:s2: #{@s2}".rstrip - out_str << "\n:u1: #{@u1}".rstrip - out_str << "\n:u2: #{@u2}".rstrip - out_str << "\n:v7: #{@v7}".rstrip - out_str << "\n:x1: #{@x1}".rstrip - out_str << "\n:y1: #{@y1}".rstrip - out_str << "\n:y2: #{@y2}".rstrip - out_str << "\n:y3: #{@y3}".rstrip - out_str << "\n:y4: #{@y4}".rstrip - out_str << "\n:y5: #{@y5}".rstrip - out_str << "\n:y6: #{@y6}".rstrip - out_str << "\n:Formula Number: #{@formula_number}".rstrip - out_str << "\n:Owner's First Name: #{@owner_first_name}".rstrip - out_str << "\n:Owner's Surname: #{@owner_surname}".rstrip - out_str << "\n:MRZ Line 1: #{@mrz1}".rstrip - out_str << "\n:MRZ Line 2: #{@mrz2}".rstrip - out_str[1..].to_s - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1_page.rb b/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1_page.rb deleted file mode 100644 index 047c909a..00000000 --- a/lib/mindee/v1/product/fr/carte_grise/carte_grise_v1_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'carte_grise_v1_document' - -module Mindee - module V1 - module Product - module FR - module CarteGrise - # Carte Grise API version 1.1 page data. - class CarteGriseV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - CarteGriseV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Carte Grise V1 page prediction. - class CarteGriseV1PagePrediction < CarteGriseV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1.rb deleted file mode 100644 index a8335d17..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'energy_bill_v1_document' -require_relative 'energy_bill_v1_page' - -module Mindee - module V1 - module Product - module FR - # Energy Bill module. - module EnergyBill - # Energy Bill API version 1 inference prediction. - class EnergyBillV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'energy_bill_fra' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = EnergyBillV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(EnergyBillV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_document.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_document.rb deleted file mode 100644 index ecb29f25..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_document.rb +++ /dev/null @@ -1,268 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'energy_bill_v1_energy_supplier' -require_relative 'energy_bill_v1_energy_consumer' -require_relative 'energy_bill_v1_subscriptions' -require_relative 'energy_bill_v1_energy_usages' -require_relative 'energy_bill_v1_taxes_and_contributions' -require_relative 'energy_bill_v1_meter_detail' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # Energy Bill API version 1.2 document data. - class EnergyBillV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The unique identifier associated with a specific contract. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :contract_id - # The unique identifier assigned to each electricity or gas consumption point. It specifies the exact - # location where the energy is delivered. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :delivery_point - # The date by which the payment for the energy invoice is due. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :due_date - # The entity that consumes the energy. - # @return [Mindee::V1::Product::FR::EnergyBill::EnergyBillV1EnergyConsumer] - attr_reader :energy_consumer - # The company that supplies the energy. - # @return [Mindee::V1::Product::FR::EnergyBill::EnergyBillV1EnergySupplier] - attr_reader :energy_supplier - # Details of energy consumption. - # @return [Mindee::V1::Product::FR::EnergyBill::EnergyBillV1EnergyUsages] - attr_reader :energy_usage - # The date when the energy invoice was issued. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :invoice_date - # The unique identifier of the energy invoice. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :invoice_number - # Information about the energy meter. - # @return [Mindee::V1::Product::FR::EnergyBill::EnergyBillV1MeterDetail] - attr_reader :meter_details - # The subscription details fee for the energy service. - # @return [Mindee::V1::Product::FR::EnergyBill::EnergyBillV1Subscriptions] - attr_reader :subscription - # Details of Taxes and Contributions. - # @return [Mindee::V1::Product::FR::EnergyBill::EnergyBillV1TaxesAndContributions] - attr_reader :taxes_and_contributions - # The total amount to be paid for the energy invoice. - # @return [Mindee::V1::Parsing::Standard::AmountField] - attr_reader :total_amount - # The total amount to be paid for the energy invoice before taxes. - # @return [Mindee::V1::Parsing::Standard::AmountField] - attr_reader :total_before_taxes - # Total of taxes applied to the invoice. - # @return [Mindee::V1::Parsing::Standard::AmountField] - attr_reader :total_taxes - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @contract_id = Parsing::Standard::StringField.new( - prediction['contract_id'], - page_id - ) - @delivery_point = Parsing::Standard::StringField.new( - prediction['delivery_point'], - page_id - ) - @due_date = Parsing::Standard::DateField.new( - prediction['due_date'], - page_id - ) - @energy_consumer = Product::FR::EnergyBill::EnergyBillV1EnergyConsumer.new( - prediction['energy_consumer'], - page_id - ) - @energy_supplier = Product::FR::EnergyBill::EnergyBillV1EnergySupplier.new( - prediction['energy_supplier'], - page_id - ) - @energy_usage = Product::FR::EnergyBill::EnergyBillV1EnergyUsages.new(prediction['energy_usage'], page_id) - @invoice_date = Parsing::Standard::DateField.new( - prediction['invoice_date'], - page_id - ) - @invoice_number = Parsing::Standard::StringField.new( - prediction['invoice_number'], - page_id - ) - @meter_details = Product::FR::EnergyBill::EnergyBillV1MeterDetail.new( - prediction['meter_details'], - page_id - ) - @subscription = Product::FR::EnergyBill::EnergyBillV1Subscriptions.new(prediction['subscription'], - page_id) - @taxes_and_contributions = Product::FR::EnergyBill::EnergyBillV1TaxesAndContributions.new( - prediction['taxes_and_contributions'], page_id - ) - @total_amount = Parsing::Standard::AmountField.new( - prediction['total_amount'], - page_id - ) - @total_before_taxes = Parsing::Standard::AmountField.new( - prediction['total_before_taxes'], - page_id - ) - @total_taxes = Parsing::Standard::AmountField.new( - prediction['total_taxes'], - page_id - ) - end - - # @return [String] - def to_s - energy_supplier = @energy_supplier.to_s - energy_consumer = @energy_consumer.to_s - subscription = subscription_to_s - energy_usage = energy_usage_to_s - taxes_and_contributions = taxes_and_contributions_to_s - meter_details = @meter_details.to_s - out_str = String.new - out_str << "\n:Invoice Number: #{@invoice_number}".rstrip - out_str << "\n:Contract ID: #{@contract_id}".rstrip - out_str << "\n:Delivery Point: #{@delivery_point}".rstrip - out_str << "\n:Invoice Date: #{@invoice_date}".rstrip - out_str << "\n:Due Date: #{@due_date}".rstrip - out_str << "\n:Total Before Taxes: #{@total_before_taxes}".rstrip - out_str << "\n:Total Taxes: #{@total_taxes}".rstrip - out_str << "\n:Total Amount: #{@total_amount}".rstrip - out_str << "\n:Energy Supplier:" - out_str << energy_supplier - out_str << "\n:Energy Consumer:" - out_str << energy_consumer - out_str << "\n:Subscription:" - out_str << subscription - out_str << "\n:Energy Usage:" - out_str << energy_usage - out_str << "\n:Taxes and Contributions:" - out_str << taxes_and_contributions - out_str << "\n:Meter Details:" - out_str << meter_details - out_str[1..].to_s - end - - private - - # @param char [String] - # @return [String] - def subscription_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 38}" - out_str << "+#{char * 12}" - out_str << "+#{char * 12}" - out_str << "+#{char * 10}" - out_str << "+#{char * 11}" - out_str << "+#{char * 12}" - out_str << '+' - out_str - end - - # @return [String] - def subscription_to_s - return '' if @subscription.empty? - - line_items = @subscription.map(&:to_table_line).join("\n#{subscription_separator('-')}\n ") - out_str = String.new - out_str << "\n#{subscription_separator('-')}" - out_str << "\n |" - out_str << ' Description |' - out_str << ' End Date |' - out_str << ' Start Date |' - out_str << ' Tax Rate |' - out_str << ' Total |' - out_str << ' Unit Price |' - out_str << "\n#{subscription_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{subscription_separator('-')}" - out_str - end - - # @param char [String] - # @return [String] - def energy_usage_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 13}" - out_str << "+#{char * 38}" - out_str << "+#{char * 12}" - out_str << "+#{char * 12}" - out_str << "+#{char * 10}" - out_str << "+#{char * 11}" - out_str << "+#{char * 17}" - out_str << "+#{char * 12}" - out_str << '+' - out_str - end - - # @return [String] - def energy_usage_to_s - return '' if @energy_usage.empty? - - line_items = @energy_usage.map(&:to_table_line).join("\n#{energy_usage_separator('-')}\n ") - out_str = String.new - out_str << "\n#{energy_usage_separator('-')}" - out_str << "\n |" - out_str << ' Consumption |' - out_str << ' Description |' - out_str << ' End Date |' - out_str << ' Start Date |' - out_str << ' Tax Rate |' - out_str << ' Total |' - out_str << ' Unit of Measure |' - out_str << ' Unit Price |' - out_str << "\n#{energy_usage_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{energy_usage_separator('-')}" - out_str - end - - # @param char [String] - # @return [String] - def taxes_and_contributions_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 38}" - out_str << "+#{char * 12}" - out_str << "+#{char * 12}" - out_str << "+#{char * 10}" - out_str << "+#{char * 11}" - out_str << "+#{char * 12}" - out_str << '+' - out_str - end - - # @return [String] - def taxes_and_contributions_to_s - return '' if @taxes_and_contributions.empty? - - line_items = @taxes_and_contributions.map(&:to_table_line).join( - "\n#{taxes_and_contributions_separator('-')}\n " - ) - out_str = String.new - out_str << "\n#{taxes_and_contributions_separator('-')}" - out_str << "\n |" - out_str << ' Description |' - out_str << ' End Date |' - out_str << ' Start Date |' - out_str << ' Tax Rate |' - out_str << ' Total |' - out_str << ' Unit Price |' - out_str << "\n#{taxes_and_contributions_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{taxes_and_contributions_separator('-')}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb deleted file mode 100644 index 914db82a..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # The entity that consumes the energy. - class EnergyBillV1EnergyConsumer < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The address of the energy consumer. - # @return [String] - attr_reader :address - # The name of the energy consumer. - # @return [String] - attr_reader :name - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = prediction['address'] - @name = prediction['name'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:address] = format_for_display(@address) - printable[:name] = format_for_display(@name) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Address: #{printable[:address]}" - out_str << "\n :Name: #{printable[:name]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb deleted file mode 100644 index bd463d14..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # The company that supplies the energy. - class EnergyBillV1EnergySupplier < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The address of the energy supplier. - # @return [String] - attr_reader :address - # The name of the energy supplier. - # @return [String] - attr_reader :name - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = prediction['address'] - @name = prediction['name'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:address] = format_for_display(@address) - printable[:name] = format_for_display(@name) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Address: #{printable[:address]}" - out_str << "\n :Name: #{printable[:name]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usage.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usage.rb deleted file mode 100644 index 9eb9a9bd..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # Details of energy consumption. - class EnergyBillV1EnergyUsage < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The price per unit of energy consumed. - # @return [Float] - attr_reader :consumption - # Description or details of the energy usage. - # @return [String] - attr_reader :description - # The end date of the energy usage. - # @return [String] - attr_reader :end_date - # The start date of the energy usage. - # @return [String] - attr_reader :start_date - # The rate of tax applied to the total cost. - # @return [Float] - attr_reader :tax_rate - # The total cost of energy consumed. - # @return [Float] - attr_reader :total - # The unit of measurement for energy consumption. - # @return [String] - attr_reader :unit - # The price per unit of energy consumed. - # @return [Float] - attr_reader :unit_price - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @consumption = prediction['consumption'] - @description = prediction['description'] - @end_date = prediction['end_date'] - @start_date = prediction['start_date'] - @tax_rate = prediction['tax_rate'] - @total = prediction['total'] - @unit = prediction['unit'] - @unit_price = prediction['unit_price'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:consumption] = - @consumption.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@consumption) - printable[:description] = format_for_display(@description) - printable[:end_date] = format_for_display(@end_date) - printable[:start_date] = format_for_display(@start_date) - printable[:tax_rate] = - @tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@tax_rate) - printable[:total] = - @total.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@total) - printable[:unit] = format_for_display(@unit) - printable[:unit_price] = - @unit_price.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@unit_price) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:consumption] = - @consumption.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@consumption) - printable[:description] = format_for_display(@description, 36) - printable[:end_date] = format_for_display(@end_date, 10) - printable[:start_date] = format_for_display(@start_date, nil) - printable[:tax_rate] = - @tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@tax_rate) - printable[:total] = - @total.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@total) - printable[:unit] = format_for_display(@unit, nil) - printable[:unit_price] = - @unit_price.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@unit_price) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 12s', printable[:consumption]) - out_str << format('| %- 37s', printable[:description]) - out_str << format('| %- 11s', printable[:end_date]) - out_str << format('| %- 11s', printable[:start_date]) - out_str << format('| %- 9s', printable[:tax_rate]) - out_str << format('| %- 10s', printable[:total]) - out_str << format('| %- 16s', printable[:unit]) - out_str << format('| %- 11s', printable[:unit_price]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Consumption: #{printable[:consumption]}" - out_str << "\n :Description: #{printable[:description]}" - out_str << "\n :End Date: #{printable[:end_date]}" - out_str << "\n :Start Date: #{printable[:start_date]}" - out_str << "\n :Tax Rate: #{printable[:tax_rate]}" - out_str << "\n :Total: #{printable[:total]}" - out_str << "\n :Unit of Measure: #{printable[:unit]}" - out_str << "\n :Unit Price: #{printable[:unit_price]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usages.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usages.rb deleted file mode 100644 index 094fd888..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require_relative 'energy_bill_v1_energy_supplier' -require_relative 'energy_bill_v1_energy_consumer' -require_relative 'energy_bill_v1_subscription' -require_relative 'energy_bill_v1_energy_usage' -require_relative 'energy_bill_v1_taxes_and_contribution' -require_relative 'energy_bill_v1_meter_detail' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # Details of energy consumption. - class EnergyBillV1EnergyUsages < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - EnergyBill::EnergyBillV1EnergyUsage.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 13}" - out_str << "+#{char * 38}" - out_str << "+#{char * 12}" - out_str << "+#{char * 12}" - out_str << "+#{char * 10}" - out_str << "+#{char * 11}" - out_str << "+#{char * 17}" - out_str << "+#{char * 12}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Consumption' - out_str << ' | Description ' - out_str << ' | End Date ' - out_str << ' | Start Date' - out_str << ' | Tax Rate' - out_str << ' | Total ' - out_str << ' | Unit of Measure' - out_str << ' | Unit Price' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_meter_detail.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_meter_detail.rb deleted file mode 100644 index 657927cd..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # Information about the energy meter. - class EnergyBillV1MeterDetail < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The unique identifier of the energy meter. - # @return [String] - attr_reader :meter_number - # The type of energy meter. - # @return [String] - attr_reader :meter_type - # The unit of power for energy consumption. - # @return [String] - attr_reader :unit - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @meter_number = prediction['meter_number'] - @meter_type = prediction['meter_type'] - @unit = prediction['unit'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:meter_number] = format_for_display(@meter_number) - printable[:meter_type] = format_for_display(@meter_type) - printable[:unit] = format_for_display(@unit) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Meter Number: #{printable[:meter_number]}" - out_str << "\n :Meter Type: #{printable[:meter_type]}" - out_str << "\n :Unit of Power: #{printable[:unit]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_page.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_page.rb deleted file mode 100644 index 75732178..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'energy_bill_v1_document' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # Energy Bill API version 1.2 page data. - class EnergyBillV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - EnergyBillV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Energy Bill V1 page prediction. - class EnergyBillV1PagePrediction < EnergyBillV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscription.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscription.rb deleted file mode 100644 index 4417d8f5..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscription.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # The subscription details fee for the energy service. - class EnergyBillV1Subscription < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # Description or details of the subscription. - # @return [String] - attr_reader :description - # The end date of the subscription. - # @return [String] - attr_reader :end_date - # The start date of the subscription. - # @return [String] - attr_reader :start_date - # The rate of tax applied to the total cost. - # @return [Float] - attr_reader :tax_rate - # The total cost of subscription. - # @return [Float] - attr_reader :total - # The price per unit of subscription. - # @return [Float] - attr_reader :unit_price - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @description = prediction['description'] - @end_date = prediction['end_date'] - @start_date = prediction['start_date'] - @tax_rate = prediction['tax_rate'] - @total = prediction['total'] - @unit_price = prediction['unit_price'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:description] = format_for_display(@description) - printable[:end_date] = format_for_display(@end_date) - printable[:start_date] = format_for_display(@start_date) - printable[:tax_rate] = - @tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@tax_rate) - printable[:total] = - @total.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@total) - printable[:unit_price] = - @unit_price.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@unit_price) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:description] = format_for_display(@description, 36) - printable[:end_date] = format_for_display(@end_date, 10) - printable[:start_date] = format_for_display(@start_date, nil) - printable[:tax_rate] = - @tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@tax_rate) - printable[:total] = - @total.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@total) - printable[:unit_price] = - @unit_price.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@unit_price) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 37s', printable[:description]) - out_str << format('| %- 11s', printable[:end_date]) - out_str << format('| %- 11s', printable[:start_date]) - out_str << format('| %- 9s', printable[:tax_rate]) - out_str << format('| %- 10s', printable[:total]) - out_str << format('| %- 11s', printable[:unit_price]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Description: #{printable[:description]}" - out_str << "\n :End Date: #{printable[:end_date]}" - out_str << "\n :Start Date: #{printable[:start_date]}" - out_str << "\n :Tax Rate: #{printable[:tax_rate]}" - out_str << "\n :Total: #{printable[:total]}" - out_str << "\n :Unit Price: #{printable[:unit_price]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscriptions.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscriptions.rb deleted file mode 100644 index 6633909b..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscriptions.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -require_relative 'energy_bill_v1_energy_supplier' -require_relative 'energy_bill_v1_energy_consumer' -require_relative 'energy_bill_v1_subscription' -require_relative 'energy_bill_v1_energy_usage' -require_relative 'energy_bill_v1_taxes_and_contribution' -require_relative 'energy_bill_v1_meter_detail' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # The subscription details fee for the energy service. - class EnergyBillV1Subscriptions < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - EnergyBill::EnergyBillV1Subscription.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 38}" - out_str << "+#{char * 12}" - out_str << "+#{char * 12}" - out_str << "+#{char * 10}" - out_str << "+#{char * 11}" - out_str << "+#{char * 12}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Description ' - out_str << ' | End Date ' - out_str << ' | Start Date' - out_str << ' | Tax Rate' - out_str << ' | Total ' - out_str << ' | Unit Price' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb deleted file mode 100644 index 5488a578..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # Details of Taxes and Contributions. - class EnergyBillV1TaxesAndContribution < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # Description or details of the Taxes and Contributions. - # @return [String] - attr_reader :description - # The end date of the Taxes and Contributions. - # @return [String] - attr_reader :end_date - # The start date of the Taxes and Contributions. - # @return [String] - attr_reader :start_date - # The rate of tax applied to the total cost. - # @return [Float] - attr_reader :tax_rate - # The total cost of Taxes and Contributions. - # @return [Float] - attr_reader :total - # The price per unit of Taxes and Contributions. - # @return [Float] - attr_reader :unit_price - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @description = prediction['description'] - @end_date = prediction['end_date'] - @start_date = prediction['start_date'] - @tax_rate = prediction['tax_rate'] - @total = prediction['total'] - @unit_price = prediction['unit_price'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:description] = format_for_display(@description) - printable[:end_date] = format_for_display(@end_date) - printable[:start_date] = format_for_display(@start_date) - printable[:tax_rate] = - @tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@tax_rate) - printable[:total] = - @total.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@total) - printable[:unit_price] = - @unit_price.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@unit_price) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:description] = format_for_display(@description, 36) - printable[:end_date] = format_for_display(@end_date, 10) - printable[:start_date] = format_for_display(@start_date, nil) - printable[:tax_rate] = - @tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@tax_rate) - printable[:total] = - @total.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@total) - printable[:unit_price] = - @unit_price.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@unit_price) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 37s', printable[:description]) - out_str << format('| %- 11s', printable[:end_date]) - out_str << format('| %- 11s', printable[:start_date]) - out_str << format('| %- 9s', printable[:tax_rate]) - out_str << format('| %- 10s', printable[:total]) - out_str << format('| %- 11s', printable[:unit_price]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Description: #{printable[:description]}" - out_str << "\n :End Date: #{printable[:end_date]}" - out_str << "\n :Start Date: #{printable[:start_date]}" - out_str << "\n :Tax Rate: #{printable[:tax_rate]}" - out_str << "\n :Total: #{printable[:total]}" - out_str << "\n :Unit Price: #{printable[:unit_price]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb b/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb deleted file mode 100644 index 48cbf0ec..00000000 --- a/lib/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -require_relative 'energy_bill_v1_energy_supplier' -require_relative 'energy_bill_v1_energy_consumer' -require_relative 'energy_bill_v1_subscription' -require_relative 'energy_bill_v1_energy_usage' -require_relative 'energy_bill_v1_taxes_and_contribution' -require_relative 'energy_bill_v1_meter_detail' - -module Mindee - module V1 - module Product - module FR - module EnergyBill - # Details of Taxes and Contributions. - class EnergyBillV1TaxesAndContributions < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - EnergyBill::EnergyBillV1TaxesAndContribution.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 38}" - out_str << "+#{char * 12}" - out_str << "+#{char * 12}" - out_str << "+#{char * 10}" - out_str << "+#{char * 11}" - out_str << "+#{char * 12}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Description ' - out_str << ' | End Date ' - out_str << ' | Start Date' - out_str << ' | Tax Rate' - out_str << ' | Total ' - out_str << ' | Unit Price' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/health_card/health_card_v1.rb b/lib/mindee/v1/product/fr/health_card/health_card_v1.rb deleted file mode 100644 index ed5a9286..00000000 --- a/lib/mindee/v1/product/fr/health_card/health_card_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'health_card_v1_document' -require_relative 'health_card_v1_page' - -module Mindee - module V1 - module Product - module FR - # Health Card module. - module HealthCard - # Health Card API version 1 inference prediction. - class HealthCardV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'french_healthcard' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = HealthCardV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(HealthCardV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/health_card/health_card_v1_document.rb b/lib/mindee/v1/product/fr/health_card/health_card_v1_document.rb deleted file mode 100644 index 4ecadafd..00000000 --- a/lib/mindee/v1/product/fr/health_card/health_card_v1_document.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module HealthCard - # Health Card API version 1.0 document data. - class HealthCardV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The given names of the card holder. - # @return [Array] - attr_reader :given_names - # The date when the carte vitale document was issued. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :issuance_date - # The social security number of the card holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :social_security - # The surname of the card holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :surname - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @given_names = [] # : Array[Parsing::Standard::StringField] - prediction['given_names'].each do |item| - @given_names.push(Parsing::Standard::StringField.new(item, page_id)) - end - @issuance_date = Parsing::Standard::DateField.new( - prediction['issuance_date'], - page_id - ) - @social_security = Parsing::Standard::StringField.new( - prediction['social_security'], - page_id - ) - @surname = Parsing::Standard::StringField.new( - prediction['surname'], - page_id - ) - end - - # @return [String] - def to_s - given_names = @given_names.join("\n #{' ' * 15}") - out_str = String.new - out_str << "\n:Given Name(s): #{given_names}".rstrip - out_str << "\n:Surname: #{@surname}".rstrip - out_str << "\n:Social Security Number: #{@social_security}".rstrip - out_str << "\n:Issuance Date: #{@issuance_date}".rstrip - out_str[1..].to_s - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/health_card/health_card_v1_page.rb b/lib/mindee/v1/product/fr/health_card/health_card_v1_page.rb deleted file mode 100644 index 08df9fab..00000000 --- a/lib/mindee/v1/product/fr/health_card/health_card_v1_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'health_card_v1_document' - -module Mindee - module V1 - module Product - module FR - module HealthCard - # Health Card API version 1.0 page data. - class HealthCardV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - HealthCardV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Health Card V1 page prediction. - class HealthCardV1PagePrediction < HealthCardV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3.rb deleted file mode 100644 index 6dc428cb..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'payslip_v3_document' -require_relative 'payslip_v3_page' - -module Mindee - module V1 - module Product - module FR - # Payslip module. - module Payslip - # Payslip API version 3 inference prediction. - class PayslipV3 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'payslip_fra' - @endpoint_version = '3' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = PayslipV3Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(PayslipV3Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_bank_account_detail.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_bank_account_detail.rb deleted file mode 100644 index c78f588f..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_bank_account_detail.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Information about the employee's bank account. - class PayslipV3BankAccountDetail < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The name of the bank. - # @return [String] - attr_reader :bank_name - # The IBAN of the bank account. - # @return [String] - attr_reader :iban - # The SWIFT code of the bank. - # @return [String] - attr_reader :swift - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @bank_name = prediction['bank_name'] - @iban = prediction['iban'] - @swift = prediction['swift'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:bank_name] = format_for_display(@bank_name) - printable[:iban] = format_for_display(@iban) - printable[:swift] = format_for_display(@swift) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Bank Name: #{printable[:bank_name]}" - out_str << "\n :IBAN: #{printable[:iban]}" - out_str << "\n :SWIFT: #{printable[:swift]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_document.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_document.rb deleted file mode 100644 index 838acde8..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_document.rb +++ /dev/null @@ -1,180 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'payslip_v3_pay_period' -require_relative 'payslip_v3_employee' -require_relative 'payslip_v3_employer' -require_relative 'payslip_v3_bank_account_detail' -require_relative 'payslip_v3_employment' -require_relative 'payslip_v3_salary_details' -require_relative 'payslip_v3_pay_detail' -require_relative 'payslip_v3_paid_time_offs' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Payslip API version 3.0 document data. - class PayslipV3Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # Information about the employee's bank account. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3BankAccountDetail] - attr_reader :bank_account_details - # Information about the employee. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3Employee] - attr_reader :employee - # Information about the employer. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3Employer] - attr_reader :employer - # Information about the employment. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3Employment] - attr_reader :employment - # Information about paid time off. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3PaidTimeOffs] - attr_reader :paid_time_off - # Detailed information about the pay. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3PayDetail] - attr_reader :pay_detail - # Information about the pay period. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3PayPeriod] - attr_reader :pay_period - # Detailed information about the earnings. - # @return [Mindee::V1::Product::FR::Payslip::PayslipV3SalaryDetails] - attr_reader :salary_details - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @bank_account_details = Product::FR::Payslip::PayslipV3BankAccountDetail.new( - prediction['bank_account_details'], - page_id - ) - @employee = Product::FR::Payslip::PayslipV3Employee.new( - prediction['employee'], - page_id - ) - @employer = Product::FR::Payslip::PayslipV3Employer.new( - prediction['employer'], - page_id - ) - @employment = Product::FR::Payslip::PayslipV3Employment.new( - prediction['employment'], - page_id - ) - @paid_time_off = Product::FR::Payslip::PayslipV3PaidTimeOffs.new(prediction['paid_time_off'], page_id) - @pay_detail = Product::FR::Payslip::PayslipV3PayDetail.new( - prediction['pay_detail'], - page_id - ) - @pay_period = Product::FR::Payslip::PayslipV3PayPeriod.new( - prediction['pay_period'], - page_id - ) - @salary_details = Product::FR::Payslip::PayslipV3SalaryDetails.new(prediction['salary_details'], page_id) - end - - # @return [String] - def to_s - pay_period = @pay_period.to_s - employee = @employee.to_s - employer = @employer.to_s - bank_account_details = @bank_account_details.to_s - employment = @employment.to_s - salary_details = salary_details_to_s - pay_detail = @pay_detail.to_s - paid_time_off = paid_time_off_to_s - out_str = String.new - out_str << "\n:Pay Period:" - out_str << pay_period - out_str << "\n:Employee:" - out_str << employee - out_str << "\n:Employer:" - out_str << employer - out_str << "\n:Bank Account Details:" - out_str << bank_account_details - out_str << "\n:Employment:" - out_str << employment - out_str << "\n:Salary Details:" - out_str << salary_details - out_str << "\n:Pay Detail:" - out_str << pay_detail - out_str << "\n:Paid Time Off:" - out_str << paid_time_off - out_str[1..].to_s - end - - private - - # @param char [String] - # @return [String] - def salary_details_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 14}" - out_str << "+#{char * 11}" - out_str << "+#{char * 38}" - out_str << "+#{char * 8}" - out_str << "+#{char * 11}" - out_str << '+' - out_str - end - - # @return [String] - def salary_details_to_s - return '' if @salary_details.empty? - - line_items = @salary_details.map(&:to_table_line).join("\n#{salary_details_separator('-')}\n ") - out_str = String.new - out_str << "\n#{salary_details_separator('-')}" - out_str << "\n |" - out_str << ' Amount |' - out_str << ' Base |' - out_str << ' Description |' - out_str << ' Number |' - out_str << ' Rate |' - out_str << "\n#{salary_details_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{salary_details_separator('-')}" - out_str - end - - # @param char [String] - # @return [String] - def paid_time_off_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 11}" - out_str << "+#{char * 8}" - out_str << "+#{char * 13}" - out_str << "+#{char * 11}" - out_str << "+#{char * 11}" - out_str << '+' - out_str - end - - # @return [String] - def paid_time_off_to_s - return '' if @paid_time_off.empty? - - line_items = @paid_time_off.map(&:to_table_line).join("\n#{paid_time_off_separator('-')}\n ") - out_str = String.new - out_str << "\n#{paid_time_off_separator('-')}" - out_str << "\n |" - out_str << ' Accrued |' - out_str << ' Period |' - out_str << ' Type |' - out_str << ' Remaining |' - out_str << ' Used |' - out_str << "\n#{paid_time_off_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{paid_time_off_separator('-')}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_employee.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_employee.rb deleted file mode 100644 index 8f4b4619..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_employee.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Information about the employee. - class PayslipV3Employee < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The address of the employee. - # @return [String] - attr_reader :address - # The date of birth of the employee. - # @return [String] - attr_reader :date_of_birth - # The first name of the employee. - # @return [String] - attr_reader :first_name - # The last name of the employee. - # @return [String] - attr_reader :last_name - # The phone number of the employee. - # @return [String] - attr_reader :phone_number - # The registration number of the employee. - # @return [String] - attr_reader :registration_number - # The social security number of the employee. - # @return [String] - attr_reader :social_security_number - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = prediction['address'] - @date_of_birth = prediction['date_of_birth'] - @first_name = prediction['first_name'] - @last_name = prediction['last_name'] - @phone_number = prediction['phone_number'] - @registration_number = prediction['registration_number'] - @social_security_number = prediction['social_security_number'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:address] = format_for_display(@address) - printable[:date_of_birth] = format_for_display(@date_of_birth) - printable[:first_name] = format_for_display(@first_name) - printable[:last_name] = format_for_display(@last_name) - printable[:phone_number] = format_for_display(@phone_number) - printable[:registration_number] = format_for_display(@registration_number) - printable[:social_security_number] = format_for_display(@social_security_number) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Address: #{printable[:address]}" - out_str << "\n :Date of Birth: #{printable[:date_of_birth]}" - out_str << "\n :First Name: #{printable[:first_name]}" - out_str << "\n :Last Name: #{printable[:last_name]}" - out_str << "\n :Phone Number: #{printable[:phone_number]}" - out_str << "\n :Registration Number: #{printable[:registration_number]}" - out_str << "\n :Social Security Number: #{printable[:social_security_number]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_employer.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_employer.rb deleted file mode 100644 index 96fe6e2d..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_employer.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Information about the employer. - class PayslipV3Employer < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The address of the employer. - # @return [String] - attr_reader :address - # The company ID of the employer. - # @return [String] - attr_reader :company_id - # The site of the company. - # @return [String] - attr_reader :company_site - # The NAF code of the employer. - # @return [String] - attr_reader :naf_code - # The name of the employer. - # @return [String] - attr_reader :name - # The phone number of the employer. - # @return [String] - attr_reader :phone_number - # The URSSAF number of the employer. - # @return [String] - attr_reader :urssaf_number - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address = prediction['address'] - @company_id = prediction['company_id'] - @company_site = prediction['company_site'] - @naf_code = prediction['naf_code'] - @name = prediction['name'] - @phone_number = prediction['phone_number'] - @urssaf_number = prediction['urssaf_number'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:address] = format_for_display(@address) - printable[:company_id] = format_for_display(@company_id) - printable[:company_site] = format_for_display(@company_site) - printable[:naf_code] = format_for_display(@naf_code) - printable[:name] = format_for_display(@name) - printable[:phone_number] = format_for_display(@phone_number) - printable[:urssaf_number] = format_for_display(@urssaf_number) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Address: #{printable[:address]}" - out_str << "\n :Company ID: #{printable[:company_id]}" - out_str << "\n :Company Site: #{printable[:company_site]}" - out_str << "\n :NAF Code: #{printable[:naf_code]}" - out_str << "\n :Name: #{printable[:name]}" - out_str << "\n :Phone Number: #{printable[:phone_number]}" - out_str << "\n :URSSAF Number: #{printable[:urssaf_number]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_employment.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_employment.rb deleted file mode 100644 index 3f1d5a43..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_employment.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Information about the employment. - class PayslipV3Employment < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The category of the employment. - # @return [String] - attr_reader :category - # The coefficient of the employment. - # @return [String] - attr_reader :coefficient - # The collective agreement of the employment. - # @return [String] - attr_reader :collective_agreement - # The job title of the employee. - # @return [String] - attr_reader :job_title - # The position level of the employment. - # @return [String] - attr_reader :position_level - # The seniority date of the employment. - # @return [String] - attr_reader :seniority_date - # The start date of the employment. - # @return [String] - attr_reader :start_date - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @category = prediction['category'] - @coefficient = prediction['coefficient'] - @collective_agreement = prediction['collective_agreement'] - @job_title = prediction['job_title'] - @position_level = prediction['position_level'] - @seniority_date = prediction['seniority_date'] - @start_date = prediction['start_date'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:category] = format_for_display(@category) - printable[:coefficient] = format_for_display(@coefficient) - printable[:collective_agreement] = format_for_display(@collective_agreement) - printable[:job_title] = format_for_display(@job_title) - printable[:position_level] = format_for_display(@position_level) - printable[:seniority_date] = format_for_display(@seniority_date) - printable[:start_date] = format_for_display(@start_date) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Category: #{printable[:category]}" - out_str << "\n :Coefficient: #{printable[:coefficient]}" - out_str << "\n :Collective Agreement: #{printable[:collective_agreement]}" - out_str << "\n :Job Title: #{printable[:job_title]}" - out_str << "\n :Position Level: #{printable[:position_level]}" - out_str << "\n :Seniority Date: #{printable[:seniority_date]}" - out_str << "\n :Start Date: #{printable[:start_date]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_page.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_page.rb deleted file mode 100644 index 79c0050f..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'payslip_v3_document' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Payslip API version 3.0 page data. - class PayslipV3Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - PayslipV3PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Payslip V3 page prediction. - class PayslipV3PagePrediction < PayslipV3Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_paid_time_off.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_paid_time_off.rb deleted file mode 100644 index 4ac2cbb0..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_paid_time_off.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Information about paid time off. - class PayslipV3PaidTimeOff < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The amount of paid time off accrued in the period. - # @return [Float] - attr_reader :accrued - # The paid time off period. - # @return [String] - attr_reader :period - # The type of paid time off. - # @return [String] - attr_reader :pto_type - # The remaining amount of paid time off at the end of the period. - # @return [Float] - attr_reader :remaining - # The amount of paid time off used in the period. - # @return [Float] - attr_reader :used - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @accrued = prediction['accrued'] - @period = prediction['period'] - @pto_type = prediction['pto_type'] - @remaining = prediction['remaining'] - @used = prediction['used'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:accrued] = - @accrued.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@accrued) - printable[:period] = format_for_display(@period) - printable[:pto_type] = format_for_display(@pto_type) - printable[:remaining] = - @remaining.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@remaining) - printable[:used] = - @used.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@used) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:accrued] = - @accrued.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@accrued) - printable[:period] = format_for_display(@period, 6) - printable[:pto_type] = format_for_display(@pto_type, 11) - printable[:remaining] = - @remaining.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@remaining) - printable[:used] = - @used.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@used) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 10s', printable[:accrued]) - out_str << format('| %- 7s', printable[:period]) - out_str << format('| %- 12s', printable[:pto_type]) - out_str << format('| %- 10s', printable[:remaining]) - out_str << format('| %- 10s', printable[:used]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Accrued: #{printable[:accrued]}" - out_str << "\n :Period: #{printable[:period]}" - out_str << "\n :Type: #{printable[:pto_type]}" - out_str << "\n :Remaining: #{printable[:remaining]}" - out_str << "\n :Used: #{printable[:used]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_paid_time_offs.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_paid_time_offs.rb deleted file mode 100644 index 8ba849e5..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_paid_time_offs.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -require_relative 'payslip_v3_pay_period' -require_relative 'payslip_v3_employee' -require_relative 'payslip_v3_employer' -require_relative 'payslip_v3_bank_account_detail' -require_relative 'payslip_v3_employment' -require_relative 'payslip_v3_salary_detail' -require_relative 'payslip_v3_pay_detail' -require_relative 'payslip_v3_paid_time_off' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Information about paid time off. - class PayslipV3PaidTimeOffs < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - Payslip::PayslipV3PaidTimeOff.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 11}" - out_str << "+#{char * 8}" - out_str << "+#{char * 13}" - out_str << "+#{char * 11}" - out_str << "+#{char * 11}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Accrued ' - out_str << ' | Period' - out_str << ' | Type ' - out_str << ' | Remaining' - out_str << ' | Used ' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_pay_detail.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_pay_detail.rb deleted file mode 100644 index f119a0a8..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_pay_detail.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Detailed information about the pay. - class PayslipV3PayDetail < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The gross salary of the employee. - # @return [Float] - attr_reader :gross_salary - # The year-to-date gross salary of the employee. - # @return [Float] - attr_reader :gross_salary_ytd - # The income tax rate of the employee. - # @return [Float] - attr_reader :income_tax_rate - # The income tax withheld from the employee's pay. - # @return [Float] - attr_reader :income_tax_withheld - # The net paid amount of the employee. - # @return [Float] - attr_reader :net_paid - # The net paid amount before tax of the employee. - # @return [Float] - attr_reader :net_paid_before_tax - # The net taxable amount of the employee. - # @return [Float] - attr_reader :net_taxable - # The year-to-date net taxable amount of the employee. - # @return [Float] - attr_reader :net_taxable_ytd - # The total cost to the employer. - # @return [Float] - attr_reader :total_cost_employer - # The total taxes and deductions of the employee. - # @return [Float] - attr_reader :total_taxes_and_deductions - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @gross_salary = prediction['gross_salary'] - @gross_salary_ytd = prediction['gross_salary_ytd'] - @income_tax_rate = prediction['income_tax_rate'] - @income_tax_withheld = prediction['income_tax_withheld'] - @net_paid = prediction['net_paid'] - @net_paid_before_tax = prediction['net_paid_before_tax'] - @net_taxable = prediction['net_taxable'] - @net_taxable_ytd = prediction['net_taxable_ytd'] - @total_cost_employer = prediction['total_cost_employer'] - @total_taxes_and_deductions = prediction['total_taxes_and_deductions'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:gross_salary] = - @gross_salary.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@gross_salary) - printable[:gross_salary_ytd] = - @gross_salary_ytd.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@gross_salary_ytd) - printable[:income_tax_rate] = - @income_tax_rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@income_tax_rate) - printable[:income_tax_withheld] = - if @income_tax_withheld.nil? - '' - else - Parsing::Standard::BaseField.float_to_string(@income_tax_withheld) - end - printable[:net_paid] = - @net_paid.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@net_paid) - printable[:net_paid_before_tax] = - if @net_paid_before_tax.nil? - '' - else - Parsing::Standard::BaseField.float_to_string(@net_paid_before_tax) - end - printable[:net_taxable] = - @net_taxable.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@net_taxable) - printable[:net_taxable_ytd] = - @net_taxable_ytd.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@net_taxable_ytd) - printable[:total_cost_employer] = - if @total_cost_employer.nil? - '' - else - Parsing::Standard::BaseField.float_to_string(@total_cost_employer) - end - printable[:total_taxes_and_deductions] = - if @total_taxes_and_deductions.nil? - '' - else - Parsing::Standard::BaseField.float_to_string(@total_taxes_and_deductions) - end - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Gross Salary: #{printable[:gross_salary]}" - out_str << "\n :Gross Salary YTD: #{printable[:gross_salary_ytd]}" - out_str << "\n :Income Tax Rate: #{printable[:income_tax_rate]}" - out_str << "\n :Income Tax Withheld: #{printable[:income_tax_withheld]}" - out_str << "\n :Net Paid: #{printable[:net_paid]}" - out_str << "\n :Net Paid Before Tax: #{printable[:net_paid_before_tax]}" - out_str << "\n :Net Taxable: #{printable[:net_taxable]}" - out_str << "\n :Net Taxable YTD: #{printable[:net_taxable_ytd]}" - out_str << "\n :Total Cost Employer: #{printable[:total_cost_employer]}" - out_str << "\n :Total Taxes and Deductions: #{printable[:total_taxes_and_deductions]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_pay_period.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_pay_period.rb deleted file mode 100644 index ac52ec7a..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_pay_period.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Information about the pay period. - class PayslipV3PayPeriod < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The end date of the pay period. - # @return [String] - attr_reader :end_date - # The month of the pay period. - # @return [String] - attr_reader :month - # The date of payment for the pay period. - # @return [String] - attr_reader :payment_date - # The start date of the pay period. - # @return [String] - attr_reader :start_date - # The year of the pay period. - # @return [String] - attr_reader :year - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @end_date = prediction['end_date'] - @month = prediction['month'] - @payment_date = prediction['payment_date'] - @start_date = prediction['start_date'] - @year = prediction['year'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:end_date] = format_for_display(@end_date) - printable[:month] = format_for_display(@month) - printable[:payment_date] = format_for_display(@payment_date) - printable[:start_date] = format_for_display(@start_date) - printable[:year] = format_for_display(@year) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :End Date: #{printable[:end_date]}" - out_str << "\n :Month: #{printable[:month]}" - out_str << "\n :Payment Date: #{printable[:payment_date]}" - out_str << "\n :Start Date: #{printable[:start_date]}" - out_str << "\n :Year: #{printable[:year]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_salary_detail.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_salary_detail.rb deleted file mode 100644 index 072d0b45..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_salary_detail.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Detailed information about the earnings. - class PayslipV3SalaryDetail < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The amount of the earning. - # @return [Float] - attr_reader :amount - # The base rate value of the earning. - # @return [Float] - attr_reader :base - # The description of the earnings. - # @return [String] - attr_reader :description - # The number of units in the earning. - # @return [Float] - attr_reader :number - # The rate of the earning. - # @return [Float] - attr_reader :rate - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @amount = prediction['amount'] - @base = prediction['base'] - @description = prediction['description'] - @number = prediction['number'] - @rate = prediction['rate'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:amount] = - @amount.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@amount) - printable[:base] = - @base.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@base) - printable[:description] = format_for_display(@description) - printable[:number] = - @number.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@number) - printable[:rate] = - @rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@rate) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:amount] = - @amount.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@amount) - printable[:base] = - @base.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@base) - printable[:description] = format_for_display(@description, 36) - printable[:number] = - @number.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@number) - printable[:rate] = - @rate.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@rate) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 13s', printable[:amount]) - out_str << format('| %- 10s', printable[:base]) - out_str << format('| %- 37s', printable[:description]) - out_str << format('| %- 7s', printable[:number]) - out_str << format('| %- 10s', printable[:rate]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Amount: #{printable[:amount]}" - out_str << "\n :Base: #{printable[:base]}" - out_str << "\n :Description: #{printable[:description]}" - out_str << "\n :Number: #{printable[:number]}" - out_str << "\n :Rate: #{printable[:rate]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/payslip/payslip_v3_salary_details.rb b/lib/mindee/v1/product/fr/payslip/payslip_v3_salary_details.rb deleted file mode 100644 index 20069160..00000000 --- a/lib/mindee/v1/product/fr/payslip/payslip_v3_salary_details.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -require_relative 'payslip_v3_pay_period' -require_relative 'payslip_v3_employee' -require_relative 'payslip_v3_employer' -require_relative 'payslip_v3_bank_account_detail' -require_relative 'payslip_v3_employment' -require_relative 'payslip_v3_salary_detail' -require_relative 'payslip_v3_pay_detail' -require_relative 'payslip_v3_paid_time_off' - -module Mindee - module V1 - module Product - module FR - module Payslip - # Detailed information about the earnings. - class PayslipV3SalaryDetails < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - Payslip::PayslipV3SalaryDetail.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 14}" - out_str << "+#{char * 11}" - out_str << "+#{char * 38}" - out_str << "+#{char * 8}" - out_str << "+#{char * 11}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Amount ' - out_str << ' | Base ' - out_str << ' | Description ' - out_str << ' | Number' - out_str << ' | Rate ' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1.rb b/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1.rb deleted file mode 100644 index bdfb08ee..00000000 --- a/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'indian_passport_v1_document' -require_relative 'indian_passport_v1_page' - -module Mindee - module V1 - module Product - module IND - # Passport - India module. - module IndianPassport - # Passport - India API version 1 inference prediction. - class IndianPassportV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'ind_passport' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = IndianPassportV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(IndianPassportV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1_document.rb b/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1_document.rb deleted file mode 100644 index 2bb51033..00000000 --- a/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1_document.rb +++ /dev/null @@ -1,208 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module IND - module IndianPassport - # Passport - India API version 1.2 document data. - class IndianPassportV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The first line of the address of the passport holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :address1 - # The second line of the address of the passport holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :address2 - # The third line of the address of the passport holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :address3 - # The birth date of the passport holder, ISO format: YYYY-MM-DD. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :birth_date - # The birth place of the passport holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :birth_place - # ISO 3166-1 alpha-3 country code (3 letters format). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :country - # The date when the passport will expire, ISO format: YYYY-MM-DD. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :expiry_date - # The file number of the passport document. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :file_number - # The gender of the passport holder. - # @return [Mindee::V1::Parsing::Standard::ClassificationField] - attr_reader :gender - # The given names of the passport holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :given_names - # The identification number of the passport document. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :id_number - # The date when the passport was issued, ISO format: YYYY-MM-DD. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :issuance_date - # The place where the passport was issued. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :issuance_place - # The name of the legal guardian of the passport holder (if applicable). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :legal_guardian - # The first line of the machine-readable zone (MRZ) of the passport document. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mrz1 - # The second line of the machine-readable zone (MRZ) of the passport document. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mrz2 - # The name of the mother of the passport holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :name_of_mother - # The name of the spouse of the passport holder (if applicable). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :name_of_spouse - # The date of issue of the old passport (if applicable), ISO format: YYYY-MM-DD. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :old_passport_date_of_issue - # The number of the old passport (if applicable). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :old_passport_number - # The place of issue of the old passport (if applicable). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :old_passport_place_of_issue - # The page number of the passport document. - # @return [Mindee::V1::Parsing::Standard::ClassificationField] - attr_reader :page_number - # The surname of the passport holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :surname - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @address1 = Parsing::Standard::StringField.new( - prediction['address1'], - page_id - ) - @address2 = Parsing::Standard::StringField.new( - prediction['address2'], - page_id - ) - @address3 = Parsing::Standard::StringField.new( - prediction['address3'], - page_id - ) - @birth_date = Parsing::Standard::DateField.new( - prediction['birth_date'], - page_id - ) - @birth_place = Parsing::Standard::StringField.new( - prediction['birth_place'], - page_id - ) - @country = Parsing::Standard::StringField.new( - prediction['country'], - page_id - ) - @expiry_date = Parsing::Standard::DateField.new( - prediction['expiry_date'], - page_id - ) - @file_number = Parsing::Standard::StringField.new( - prediction['file_number'], - page_id - ) - @gender = Parsing::Standard::ClassificationField.new( - prediction['gender'], - page_id - ) - @given_names = Parsing::Standard::StringField.new( - prediction['given_names'], - page_id - ) - @id_number = Parsing::Standard::StringField.new( - prediction['id_number'], - page_id - ) - @issuance_date = Parsing::Standard::DateField.new( - prediction['issuance_date'], - page_id - ) - @issuance_place = Parsing::Standard::StringField.new( - prediction['issuance_place'], - page_id - ) - @legal_guardian = Parsing::Standard::StringField.new( - prediction['legal_guardian'], - page_id - ) - @mrz1 = Parsing::Standard::StringField.new(prediction['mrz1'], page_id) - @mrz2 = Parsing::Standard::StringField.new(prediction['mrz2'], page_id) - @name_of_mother = Parsing::Standard::StringField.new( - prediction['name_of_mother'], - page_id - ) - @name_of_spouse = Parsing::Standard::StringField.new( - prediction['name_of_spouse'], - page_id - ) - @old_passport_date_of_issue = Parsing::Standard::DateField.new( - prediction['old_passport_date_of_issue'], - page_id - ) - @old_passport_number = Parsing::Standard::StringField.new( - prediction['old_passport_number'], - page_id - ) - @old_passport_place_of_issue = Parsing::Standard::StringField.new( - prediction['old_passport_place_of_issue'], - page_id - ) - @page_number = Parsing::Standard::ClassificationField.new( - prediction['page_number'], - page_id - ) - @surname = Parsing::Standard::StringField.new( - prediction['surname'], - page_id - ) - end - - # @return [String] - def to_s - out_str = String.new - out_str << "\n:Page Number: #{@page_number}".rstrip - out_str << "\n:Country: #{@country}".rstrip - out_str << "\n:ID Number: #{@id_number}".rstrip - out_str << "\n:Given Names: #{@given_names}".rstrip - out_str << "\n:Surname: #{@surname}".rstrip - out_str << "\n:Birth Date: #{@birth_date}".rstrip - out_str << "\n:Birth Place: #{@birth_place}".rstrip - out_str << "\n:Issuance Place: #{@issuance_place}".rstrip - out_str << "\n:Gender: #{@gender}".rstrip - out_str << "\n:Issuance Date: #{@issuance_date}".rstrip - out_str << "\n:Expiry Date: #{@expiry_date}".rstrip - out_str << "\n:MRZ Line 1: #{@mrz1}".rstrip - out_str << "\n:MRZ Line 2: #{@mrz2}".rstrip - out_str << "\n:Legal Guardian: #{@legal_guardian}".rstrip - out_str << "\n:Name of Spouse: #{@name_of_spouse}".rstrip - out_str << "\n:Name of Mother: #{@name_of_mother}".rstrip - out_str << "\n:Old Passport Date of Issue: #{@old_passport_date_of_issue}".rstrip - out_str << "\n:Old Passport Number: #{@old_passport_number}".rstrip - out_str << "\n:Old Passport Place of Issue: #{@old_passport_place_of_issue}".rstrip - out_str << "\n:Address Line 1: #{@address1}".rstrip - out_str << "\n:Address Line 2: #{@address2}".rstrip - out_str << "\n:Address Line 3: #{@address3}".rstrip - out_str << "\n:File Number: #{@file_number}".rstrip - out_str[1..].to_s - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1_page.rb b/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1_page.rb deleted file mode 100644 index 2b188732..00000000 --- a/lib/mindee/v1/product/ind/indian_passport/indian_passport_v1_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'indian_passport_v1_document' - -module Mindee - module V1 - module Product - module IND - module IndianPassport - # Passport - India API version 1.2 page data. - class IndianPassportV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - IndianPassportV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Passport - India V1 page prediction. - class IndianPassportV1PagePrediction < IndianPassportV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1.rb deleted file mode 100644 index d3bf329f..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'nutrition_facts_label_v1_document' -require_relative 'nutrition_facts_label_v1_page' - -module Mindee - module V1 - module Product - # Nutrition Facts Label module. - module NutritionFactsLabel - # Nutrition Facts Label API version 1 inference prediction. - class NutritionFactsLabelV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'nutrition_facts' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = NutritionFactsLabelV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(NutritionFactsLabelV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb deleted file mode 100644 index e71d8045..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of added sugars in the product. - class NutritionFactsLabelV1AddedSugar < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of added sugars to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of added sugars per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of added sugars per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb deleted file mode 100644 index 4853cbb7..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of calories in the product. - class NutritionFactsLabelV1Calorie < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of calories to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of calories per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of calories per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb deleted file mode 100644 index 2e0ba58e..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of cholesterol in the product. - class NutritionFactsLabelV1Cholesterol < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of cholesterol to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of cholesterol per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of cholesterol per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb deleted file mode 100644 index ed34e56d..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of dietary fiber in the product. - class NutritionFactsLabelV1DietaryFiber < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of dietary fiber to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of dietary fiber per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of dietary fiber per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb deleted file mode 100644 index 8433a8a1..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb +++ /dev/null @@ -1,213 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'nutrition_facts_label_v1_serving_size' -require_relative 'nutrition_facts_label_v1_calorie' -require_relative 'nutrition_facts_label_v1_total_fat' -require_relative 'nutrition_facts_label_v1_saturated_fat' -require_relative 'nutrition_facts_label_v1_trans_fat' -require_relative 'nutrition_facts_label_v1_cholesterol' -require_relative 'nutrition_facts_label_v1_total_carbohydrate' -require_relative 'nutrition_facts_label_v1_dietary_fiber' -require_relative 'nutrition_facts_label_v1_total_sugar' -require_relative 'nutrition_facts_label_v1_added_sugar' -require_relative 'nutrition_facts_label_v1_protein' -require_relative 'nutrition_facts_label_v1_sodium' -require_relative 'nutrition_facts_label_v1_nutrients' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # Nutrition Facts Label API version 1.0 document data. - class NutritionFactsLabelV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The amount of added sugars in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1AddedSugar] - attr_reader :added_sugars - # The amount of calories in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1Calorie] - attr_reader :calories - # The amount of cholesterol in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1Cholesterol] - attr_reader :cholesterol - # The amount of dietary fiber in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1DietaryFiber] - attr_reader :dietary_fiber - # The amount of nutrients in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1Nutrients] - attr_reader :nutrients - # The amount of protein in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1Protein] - attr_reader :protein - # The amount of saturated fat in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1SaturatedFat] - attr_reader :saturated_fat - # The number of servings in each box of the product. - # @return [Mindee::V1::Parsing::Standard::AmountField] - attr_reader :serving_per_box - # The size of a single serving of the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1ServingSize] - attr_reader :serving_size - # The amount of sodium in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1Sodium] - attr_reader :sodium - # The total amount of carbohydrates in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1TotalCarbohydrate] - attr_reader :total_carbohydrate - # The total amount of fat in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1TotalFat] - attr_reader :total_fat - # The total amount of sugars in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1TotalSugar] - attr_reader :total_sugars - # The amount of trans fat in the product. - # @return [Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1TransFat] - attr_reader :trans_fat - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @added_sugars = Product::NutritionFactsLabel::NutritionFactsLabelV1AddedSugar.new( - prediction['added_sugars'], - page_id - ) - @calories = Product::NutritionFactsLabel::NutritionFactsLabelV1Calorie.new( - prediction['calories'], - page_id - ) - @cholesterol = Product::NutritionFactsLabel::NutritionFactsLabelV1Cholesterol.new( - prediction['cholesterol'], - page_id - ) - @dietary_fiber = Product::NutritionFactsLabel::NutritionFactsLabelV1DietaryFiber.new( - prediction['dietary_fiber'], - page_id - ) - @nutrients = Product::NutritionFactsLabel::NutritionFactsLabelV1Nutrients.new( - prediction['nutrients'], page_id - ) - @protein = Product::NutritionFactsLabel::NutritionFactsLabelV1Protein.new( - prediction['protein'], - page_id - ) - @saturated_fat = Product::NutritionFactsLabel::NutritionFactsLabelV1SaturatedFat.new( - prediction['saturated_fat'], - page_id - ) - @serving_per_box = Parsing::Standard::AmountField.new( - prediction['serving_per_box'], - page_id - ) - @serving_size = Product::NutritionFactsLabel::NutritionFactsLabelV1ServingSize.new( - prediction['serving_size'], - page_id - ) - @sodium = Product::NutritionFactsLabel::NutritionFactsLabelV1Sodium.new( - prediction['sodium'], - page_id - ) - @total_carbohydrate = Product::NutritionFactsLabel::NutritionFactsLabelV1TotalCarbohydrate.new( - prediction['total_carbohydrate'], - page_id - ) - @total_fat = Product::NutritionFactsLabel::NutritionFactsLabelV1TotalFat.new( - prediction['total_fat'], - page_id - ) - @total_sugars = Product::NutritionFactsLabel::NutritionFactsLabelV1TotalSugar.new( - prediction['total_sugars'], - page_id - ) - @trans_fat = Product::NutritionFactsLabel::NutritionFactsLabelV1TransFat.new( - prediction['trans_fat'], - page_id - ) - end - - # @return [String] - def to_s - serving_size = @serving_size.to_s - calories = @calories.to_s - total_fat = @total_fat.to_s - saturated_fat = @saturated_fat.to_s - trans_fat = @trans_fat.to_s - cholesterol = @cholesterol.to_s - total_carbohydrate = @total_carbohydrate.to_s - dietary_fiber = @dietary_fiber.to_s - total_sugars = @total_sugars.to_s - added_sugars = @added_sugars.to_s - protein = @protein.to_s - sodium = @sodium.to_s - nutrients = nutrients_to_s - out_str = String.new - out_str << "\n:Serving per Box: #{@serving_per_box}".rstrip - out_str << "\n:Serving Size:" - out_str << serving_size - out_str << "\n:Calories:" - out_str << calories - out_str << "\n:Total Fat:" - out_str << total_fat - out_str << "\n:Saturated Fat:" - out_str << saturated_fat - out_str << "\n:Trans Fat:" - out_str << trans_fat - out_str << "\n:Cholesterol:" - out_str << cholesterol - out_str << "\n:Total Carbohydrate:" - out_str << total_carbohydrate - out_str << "\n:Dietary Fiber:" - out_str << dietary_fiber - out_str << "\n:Total Sugars:" - out_str << total_sugars - out_str << "\n:Added Sugars:" - out_str << added_sugars - out_str << "\n:Protein:" - out_str << protein - out_str << "\n:sodium:" - out_str << sodium - out_str << "\n:nutrients:" - out_str << nutrients - out_str[1..].to_s - end - - private - - # @param char [String] - # @return [String] - def nutrients_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 13}" - out_str << "+#{char * 22}" - out_str << "+#{char * 10}" - out_str << "+#{char * 13}" - out_str << "+#{char * 6}" - out_str << '+' - out_str - end - - # @return [String] - def nutrients_to_s - return '' if @nutrients.empty? - - line_items = @nutrients.map(&:to_table_line).join("\n#{nutrients_separator('-')}\n ") - out_str = String.new - out_str << "\n#{nutrients_separator('-')}" - out_str << "\n |" - out_str << ' Daily Value |' - out_str << ' Name |' - out_str << ' Per 100g |' - out_str << ' Per Serving |' - out_str << ' Unit |' - out_str << "\n#{nutrients_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{nutrients_separator('-')}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb deleted file mode 100644 index fa63a961..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb +++ /dev/null @@ -1,95 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of nutrients in the product. - class NutritionFactsLabelV1Nutrient < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of nutrients to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The name of nutrients of the product. - # @return [String] - attr_reader :name - # The amount of nutrients per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of nutrients per serving of the product. - # @return [Float] - attr_reader :per_serving - # The unit of measurement for the amount of nutrients. - # @return [String] - attr_reader :unit - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @name = prediction['name'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @unit = prediction['unit'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:name] = format_for_display(@name) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable[:unit] = format_for_display(@unit) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:name] = format_for_display(@name, 20) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable[:unit] = format_for_display(@unit, nil) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 12s', printable[:daily_value]) - out_str << format('| %- 21s', printable[:name]) - out_str << format('| %- 9s', printable[:per_100g]) - out_str << format('| %- 12s', printable[:per_serving]) - out_str << format('| %- 5s', printable[:unit]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Name: #{printable[:name]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str << "\n :Unit: #{printable[:unit]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb deleted file mode 100644 index 9c3e7b6a..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true - -require_relative 'nutrition_facts_label_v1_serving_size' -require_relative 'nutrition_facts_label_v1_calorie' -require_relative 'nutrition_facts_label_v1_total_fat' -require_relative 'nutrition_facts_label_v1_saturated_fat' -require_relative 'nutrition_facts_label_v1_trans_fat' -require_relative 'nutrition_facts_label_v1_cholesterol' -require_relative 'nutrition_facts_label_v1_total_carbohydrate' -require_relative 'nutrition_facts_label_v1_dietary_fiber' -require_relative 'nutrition_facts_label_v1_total_sugar' -require_relative 'nutrition_facts_label_v1_added_sugar' -require_relative 'nutrition_facts_label_v1_protein' -require_relative 'nutrition_facts_label_v1_sodium' -require_relative 'nutrition_facts_label_v1_nutrient' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of nutrients in the product. - class NutritionFactsLabelV1Nutrients < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - NutritionFactsLabel::NutritionFactsLabelV1Nutrient.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 13}" - out_str << "+#{char * 22}" - out_str << "+#{char * 10}" - out_str << "+#{char * 13}" - out_str << "+#{char * 6}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Daily Value' - out_str << ' | Name ' - out_str << ' | Per 100g' - out_str << ' | Per Serving' - out_str << ' | Unit' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb deleted file mode 100644 index 0278eff7..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'nutrition_facts_label_v1_document' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # Nutrition Facts Label API version 1.0 page data. - class NutritionFactsLabelV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - NutritionFactsLabelV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Nutrition Facts Label V1 page prediction. - class NutritionFactsLabelV1PagePrediction < NutritionFactsLabelV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb deleted file mode 100644 index 45e02b75..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of protein in the product. - class NutritionFactsLabelV1Protein < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of protein to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of protein per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of protein per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb deleted file mode 100644 index c4c544cf..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of saturated fat in the product. - class NutritionFactsLabelV1SaturatedFat < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of saturated fat to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of saturated fat per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of saturated fat per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb deleted file mode 100644 index 1a9184df..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The size of a single serving of the product. - class NutritionFactsLabelV1ServingSize < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The amount of a single serving. - # @return [Float] - attr_reader :amount - # The unit for the amount of a single serving. - # @return [String] - attr_reader :unit - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @amount = prediction['amount'] - @unit = prediction['unit'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:amount] = - @amount.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@amount) - printable[:unit] = format_for_display(@unit) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Amount: #{printable[:amount]}" - out_str << "\n :Unit: #{printable[:unit]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb deleted file mode 100644 index 72ecd632..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of sodium in the product. - class NutritionFactsLabelV1Sodium < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of sodium to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of sodium per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of sodium per serving of the product. - # @return [Float] - attr_reader :per_serving - # The unit of measurement for the amount of sodium. - # @return [String] - attr_reader :unit - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @unit = prediction['unit'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable[:unit] = format_for_display(@unit) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str << "\n :Unit: #{printable[:unit]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb deleted file mode 100644 index 3df46ed6..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The total amount of carbohydrates in the product. - class NutritionFactsLabelV1TotalCarbohydrate < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of total carbohydrates to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of total carbohydrates per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of total carbohydrates per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb deleted file mode 100644 index 53e71534..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The total amount of fat in the product. - class NutritionFactsLabelV1TotalFat < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of total fat to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of total fat per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of total fat per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb deleted file mode 100644 index cc2f09e8..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The total amount of sugars in the product. - class NutritionFactsLabelV1TotalSugar < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of total sugars to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of total sugars per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of total sugars per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb b/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb deleted file mode 100644 index 79cf5685..00000000 --- a/lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module NutritionFactsLabel - # The amount of trans fat in the product. - class NutritionFactsLabelV1TransFat < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # DVs are the recommended amounts of trans fat to consume or not to exceed each day. - # @return [Float] - attr_reader :daily_value - # The amount of trans fat per 100g of the product. - # @return [Float] - attr_reader :per_100g - # The amount of trans fat per serving of the product. - # @return [Float] - attr_reader :per_serving - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @daily_value = prediction['daily_value'] - @per_100g = prediction['per_100g'] - @per_serving = prediction['per_serving'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:daily_value] = - @daily_value.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@daily_value) - printable[:per_100g] = - @per_100g.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_100g) - printable[:per_serving] = - @per_serving.nil? ? '' : Parsing::Standard::BaseField.float_to_string(@per_serving) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Daily Value: #{printable[:daily_value]}" - out_str << "\n :Per 100g: #{printable[:per_100g]}" - out_str << "\n :Per Serving: #{printable[:per_serving]}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/bank_check/bank_check_v1.rb b/lib/mindee/v1/product/us/bank_check/bank_check_v1.rb deleted file mode 100644 index 5206efa7..00000000 --- a/lib/mindee/v1/product/us/bank_check/bank_check_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'bank_check_v1_document' -require_relative 'bank_check_v1_page' - -module Mindee - module V1 - module Product - module US - # Bank Check module. - module BankCheck - # Bank Check API version 1 inference prediction. - class BankCheckV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'bank_check' - @endpoint_version = '1' - @has_async = false - @has_sync = true - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = BankCheckV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(BankCheckV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/bank_check/bank_check_v1_document.rb b/lib/mindee/v1/product/us/bank_check/bank_check_v1_document.rb deleted file mode 100644 index 19b101ec..00000000 --- a/lib/mindee/v1/product/us/bank_check/bank_check_v1_document.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module US - module BankCheck - # Bank Check API version 1.1 document data. - class BankCheckV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The check payer's account number. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :account_number - # The amount of the check. - # @return [Mindee::V1::Parsing::Standard::AmountField] - attr_reader :amount - # The issuer's check number. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :check_number - # The date the check was issued. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :date - # List of the check's payees (recipients). - # @return [Array] - attr_reader :payees - # The check issuer's routing number. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :routing_number - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @account_number = Parsing::Standard::StringField.new( - prediction['account_number'], - page_id - ) - @amount = Parsing::Standard::AmountField.new( - prediction['amount'], - page_id - ) - @check_number = Parsing::Standard::StringField.new( - prediction['check_number'], - page_id - ) - @date = Parsing::Standard::DateField.new(prediction['date'], page_id) - @payees = [] # : Array[Parsing::Standard::StringField] - prediction['payees'].each do |item| - @payees.push(Parsing::Standard::StringField.new(item, page_id)) - end - @routing_number = Parsing::Standard::StringField.new( - prediction['routing_number'], - page_id - ) - end - - # @return [String] - def to_s - payees = @payees.join("\n #{' ' * 8}") - out_str = String.new - out_str << "\n:Check Issue Date: #{@date}".rstrip - out_str << "\n:Amount: #{@amount}".rstrip - out_str << "\n:Payees: #{payees}".rstrip - out_str << "\n:Routing Number: #{@routing_number}".rstrip - out_str << "\n:Account Number: #{@account_number}".rstrip - out_str << "\n:Check Number: #{@check_number}".rstrip - out_str[1..].to_s - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/bank_check/bank_check_v1_page.rb b/lib/mindee/v1/product/us/bank_check/bank_check_v1_page.rb deleted file mode 100644 index e6b80f37..00000000 --- a/lib/mindee/v1/product/us/bank_check/bank_check_v1_page.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'bank_check_v1_document' - -module Mindee - module V1 - module Product - module US - module BankCheck - # Bank Check API version 1.1 page data. - class BankCheckV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - BankCheckV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Bank Check V1 page prediction. - class BankCheckV1PagePrediction < BankCheckV1Document - include Mindee::V1::Parsing::Standard - - # The position of the check on the document. - # @return [Mindee::V1::Parsing::Standard::PositionField] - attr_reader :check_position - # List of signature positions - # @return [Array] - attr_reader :signatures_positions - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - @check_position = Parsing::Standard::PositionField.new( - prediction['check_position'], - page_id - ) - @signatures_positions = [] - prediction['signatures_positions'].each do |item| - @signatures_positions.push(Parsing::Standard::PositionField.new(item, page_id)) - end - super - end - - # @return [String] - def to_s - signatures_positions = @signatures_positions.join("\n #{' ' * 21}") - out_str = String.new - out_str << "\n:Check Position: #{@check_position}".rstrip - out_str << "\n:Signature Positions: #{signatures_positions}".rstrip - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1.rb b/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1.rb deleted file mode 100644 index 12fb988c..00000000 --- a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'healthcare_card_v1_document' -require_relative 'healthcare_card_v1_page' - -module Mindee - module V1 - module Product - module US - # Healthcare Card module. - module HealthcareCard - # Healthcare Card API version 1 inference prediction. - class HealthcareCardV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'us_healthcare_cards' - @endpoint_version = '1' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = HealthcareCardV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(HealthcareCardV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copay.rb b/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copay.rb deleted file mode 100644 index a0446c65..00000000 --- a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copay.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module US - module HealthcareCard - # Copayments for covered services. - class HealthcareCardV1Copay < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The price of the service. - # @return [Float] - attr_reader :service_fees - # The name of the service. - # @return [String] - attr_reader :service_name - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @service_fees = prediction['service_fees'] - @service_name = prediction['service_name'] - @page_id = page_id - end - - # @return [Hash] - def 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) - printable - end - - # @return [Hash] - 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, 20) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 13s', printable[:service_fees]) - out_str << format('| %- 21s', printable[:service_name]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :Service Fees: #{printable[:service_fees]}" - out_str << "\n :Service Name: #{printable[:service_name]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copays.rb b/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copays.rb deleted file mode 100644 index 5ee2a27c..00000000 --- a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copays.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -require_relative 'healthcare_card_v1_copay' - -module Mindee - module V1 - module Product - module US - module HealthcareCard - # Copayments for covered services. - class HealthcareCardV1Copays < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - HealthcareCard::HealthcareCardV1Copay.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 14}" - out_str << "+#{char * 22}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | Service Fees' - out_str << ' | Service Name ' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_document.rb b/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_document.rb deleted file mode 100644 index 530739d3..00000000 --- a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_document.rb +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'healthcare_card_v1_copays' - -module Mindee - module V1 - module Product - module US - module HealthcareCard - # Healthcare Card API version 1.3 document data. - class HealthcareCardV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # The name of the company that provides the healthcare plan. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :company_name - # Copayments for covered services. - # @return [Mindee::V1::Product::US::HealthcareCard::HealthcareCardV1Copays] - attr_reader :copays - # The list of dependents covered by the healthcare plan. - # @return [Array] - attr_reader :dependents - # The date when the member enrolled in the healthcare plan. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :enrollment_date - # The group number associated with the healthcare plan. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :group_number - # The organization that issued the healthcare plan. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :issuer80840 - # The unique identifier for the member in the healthcare system. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :member_id - # The name of the member covered by the healthcare plan. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :member_name - # The unique identifier for the payer in the healthcare system. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :payer_id - # The name of the healthcare plan. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :plan_name - # The BIN number for prescription drug coverage. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :rx_bin - # The group number for prescription drug coverage. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :rx_grp - # The ID number for prescription drug coverage. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :rx_id - # The PCN number for prescription drug coverage. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :rx_pcn - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @company_name = Parsing::Standard::StringField.new( - prediction['company_name'], - page_id - ) - @copays = Product::US::HealthcareCard::HealthcareCardV1Copays.new(prediction['copays'], page_id) - @dependents = [] # : Array[Parsing::Standard::StringField] - prediction['dependents'].each do |item| - @dependents.push(Parsing::Standard::StringField.new(item, page_id)) - end - @enrollment_date = Parsing::Standard::DateField.new( - prediction['enrollment_date'], - page_id - ) - @group_number = Parsing::Standard::StringField.new( - prediction['group_number'], - page_id - ) - @issuer80840 = Parsing::Standard::StringField.new( - prediction['issuer_80840'], - page_id - ) - @member_id = Parsing::Standard::StringField.new( - prediction['member_id'], - page_id - ) - @member_name = Parsing::Standard::StringField.new( - prediction['member_name'], - page_id - ) - @payer_id = Parsing::Standard::StringField.new( - prediction['payer_id'], - page_id - ) - @plan_name = Parsing::Standard::StringField.new( - prediction['plan_name'], - page_id - ) - @rx_bin = Parsing::Standard::StringField.new( - prediction['rx_bin'], - page_id - ) - @rx_grp = Parsing::Standard::StringField.new( - 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 - ) - end - - # @return [String] - def to_s - dependents = @dependents.join("\n #{' ' * 12}") - copays = copays_to_s - out_str = String.new - out_str << "\n:Company Name: #{@company_name}".rstrip - out_str << "\n:Plan Name: #{@plan_name}".rstrip - out_str << "\n:Member Name: #{@member_name}".rstrip - out_str << "\n:Member ID: #{@member_id}".rstrip - out_str << "\n:Issuer 80840: #{@issuer80840}".rstrip - out_str << "\n:Dependents: #{dependents}".rstrip - 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:" - out_str << copays - out_str << "\n:Enrollment Date: #{@enrollment_date}".rstrip - out_str[1..].to_s - end - - private - - # @param char [String] - # @return [String] - def copays_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 14}" - out_str << "+#{char * 22}" - out_str << '+' - out_str - end - - # @return [String] - def copays_to_s - return '' if @copays.empty? - - line_items = @copays.map(&:to_table_line).join("\n#{copays_separator('-')}\n ") - out_str = String.new - out_str << "\n#{copays_separator('-')}" - out_str << "\n |" - out_str << ' Service Fees |' - out_str << ' Service Name |' - out_str << "\n#{copays_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{copays_separator('-')}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_page.rb b/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_page.rb deleted file mode 100644 index 06ff55a7..00000000 --- a/lib/mindee/v1/product/us/healthcare_card/healthcare_card_v1_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'healthcare_card_v1_document' - -module Mindee - module V1 - module Product - module US - module HealthcareCard - # Healthcare Card API version 1.3 page data. - class HealthcareCardV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - HealthcareCardV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Healthcare Card V1 page prediction. - class HealthcareCardV1PagePrediction < HealthcareCardV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/us_mail/us_mail_v3.rb b/lib/mindee/v1/product/us/us_mail/us_mail_v3.rb deleted file mode 100644 index 34de79be..00000000 --- a/lib/mindee/v1/product/us/us_mail/us_mail_v3.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'us_mail_v3_document' -require_relative 'us_mail_v3_page' - -module Mindee - module V1 - module Product - module US - # US Mail module. - module UsMail - # US Mail API version 3 inference prediction. - class UsMailV3 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'us_mail' - @endpoint_version = '3' - @has_async = true - @has_sync = false - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = UsMailV3Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(UsMailV3Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/us_mail/us_mail_v3_document.rb b/lib/mindee/v1/product/us/us_mail/us_mail_v3_document.rb deleted file mode 100644 index 73cea4e1..00000000 --- a/lib/mindee/v1/product/us/us_mail/us_mail_v3_document.rb +++ /dev/null @@ -1,117 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'us_mail_v3_sender_address' -require_relative 'us_mail_v3_recipient_addresses' - -module Mindee - module V1 - module Product - module US - module UsMail - # US Mail API version 3.0 document data. - class UsMailV3Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - # Whether the mailing is marked as return to sender. - # @return [Mindee::V1::Parsing::Standard::BooleanField] - attr_reader :is_return_to_sender - # The addresses of the recipients. - # @return [Mindee::V1::Product::US::UsMail::UsMailV3RecipientAddresses] - attr_reader :recipient_addresses - # The names of the recipients. - # @return [Array] - attr_reader :recipient_names - # The address of the sender. - # @return [Mindee::V1::Product::US::UsMail::UsMailV3SenderAddress] - attr_reader :sender_address - # The name of the sender. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :sender_name - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @is_return_to_sender = Parsing::Standard::BooleanField.new( - prediction['is_return_to_sender'], - page_id - ) - @recipient_addresses = Product::US::UsMail::UsMailV3RecipientAddresses.new( - prediction['recipient_addresses'], page_id - ) - @recipient_names = [] # : Array[Parsing::Standard::StringField] - prediction['recipient_names'].each do |item| - @recipient_names.push(Parsing::Standard::StringField.new(item, page_id)) - end - @sender_address = Product::US::UsMail::UsMailV3SenderAddress.new( - prediction['sender_address'], - page_id - ) - @sender_name = Parsing::Standard::StringField.new( - prediction['sender_name'], - page_id - ) - end - - # @return [String] - def to_s - sender_address = @sender_address.to_s - recipient_names = @recipient_names.join("\n #{' ' * 17}") - recipient_addresses = recipient_addresses_to_s - out_str = String.new - out_str << "\n:Sender Name: #{@sender_name}".rstrip - out_str << "\n:Sender Address:" - out_str << sender_address - out_str << "\n:Recipient Names: #{recipient_names}".rstrip - out_str << "\n:Recipient Addresses:" - out_str << recipient_addresses - out_str << "\n:Return to Sender: #{@is_return_to_sender}".rstrip - out_str[1..].to_s - end - - private - - # @param char [String] - # @return [String] - def recipient_addresses_separator(char) - out_str = String.new - out_str << ' ' - out_str << "+#{char * 17}" - out_str << "+#{char * 37}" - out_str << "+#{char * 19}" - out_str << "+#{char * 13}" - out_str << "+#{char * 24}" - out_str << "+#{char * 7}" - out_str << "+#{char * 27}" - out_str << "+#{char * 17}" - out_str << '+' - out_str - end - - # @return [String] - def recipient_addresses_to_s - return '' if @recipient_addresses.empty? - - line_items = @recipient_addresses.map(&:to_table_line).join("\n#{recipient_addresses_separator('-')}\n ") - out_str = String.new - out_str << "\n#{recipient_addresses_separator('-')}" - out_str << "\n |" - out_str << ' City |' - out_str << ' Complete Address |' - out_str << ' Is Address Change |' - out_str << ' Postal Code |' - out_str << ' Private Mailbox Number |' - out_str << ' State |' - out_str << ' Street |' - out_str << ' Unit |' - out_str << "\n#{recipient_addresses_separator('=')}" - out_str << "\n #{line_items}" - out_str << "\n#{recipient_addresses_separator('-')}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/us_mail/us_mail_v3_page.rb b/lib/mindee/v1/product/us/us_mail/us_mail_v3_page.rb deleted file mode 100644 index 2da00b44..00000000 --- a/lib/mindee/v1/product/us/us_mail/us_mail_v3_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'us_mail_v3_document' - -module Mindee - module V1 - module Product - module US - module UsMail - # US Mail API version 3.0 page data. - class UsMailV3Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - UsMailV3PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # US Mail V3 page prediction. - class UsMailV3PagePrediction < UsMailV3Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/us_mail/us_mail_v3_recipient_address.rb b/lib/mindee/v1/product/us/us_mail/us_mail_v3_recipient_address.rb deleted file mode 100644 index 5b8fbc4f..00000000 --- a/lib/mindee/v1/product/us/us_mail/us_mail_v3_recipient_address.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module US - module UsMail - # The addresses of the recipients. - class UsMailV3RecipientAddress < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The city of the recipient's address. - # @return [String] - attr_reader :city - # The complete address of the recipient. - # @return [String] - attr_reader :complete - # Indicates if the recipient's address is a change of address. - # @return [bool] - attr_reader :is_address_change - # The postal code of the recipient's address. - # @return [String] - attr_reader :postal_code - # The private mailbox number of the recipient's address. - # @return [String] - attr_reader :private_mailbox_number - # Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. - # @return [String] - attr_reader :state - # The street of the recipient's address. - # @return [String] - attr_reader :street - # The unit number of the recipient's address. - # @return [String] - attr_reader :unit - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @city = prediction['city'] - @complete = prediction['complete'] - @is_address_change = prediction['is_address_change'] - @postal_code = prediction['postal_code'] - @private_mailbox_number = prediction['private_mailbox_number'] - @state = prediction['state'] - @street = prediction['street'] - @unit = prediction['unit'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:city] = format_for_display(@city) - printable[:complete] = format_for_display(@complete) - printable[:is_address_change] = format_for_display(@is_address_change) - printable[:postal_code] = format_for_display(@postal_code) - printable[:private_mailbox_number] = format_for_display(@private_mailbox_number) - printable[:state] = format_for_display(@state) - printable[:street] = format_for_display(@street) - printable[:unit] = format_for_display(@unit) - printable - end - - # @return [Hash] - def table_printable_values - printable = {} - printable[:city] = format_for_display(@city, 15) - printable[:complete] = format_for_display(@complete, 35) - printable[:is_address_change] = format_for_display(@is_address_change, nil) - printable[:postal_code] = format_for_display(@postal_code, nil) - printable[:private_mailbox_number] = format_for_display(@private_mailbox_number, nil) - printable[:state] = format_for_display(@state, nil) - printable[:street] = format_for_display(@street, 25) - printable[:unit] = format_for_display(@unit, 15) - printable - end - - # @return [String] - def to_table_line - printable = table_printable_values - out_str = String.new - out_str << format('| %- 16s', printable[:city]) - out_str << format('| %- 36s', printable[:complete]) - out_str << format('| %- 18s', printable[:is_address_change]) - out_str << format('| %- 12s', printable[:postal_code]) - out_str << format('| %- 23s', printable[:private_mailbox_number]) - out_str << format('| %- 6s', printable[:state]) - out_str << format('| %- 26s', printable[:street]) - out_str << format('| %- 16s', printable[:unit]) - out_str << '|' - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :City: #{printable[:city]}" - out_str << "\n :Complete Address: #{printable[:complete]}" - out_str << "\n :Is Address Change: #{printable[:is_address_change]}" - out_str << "\n :Postal Code: #{printable[:postal_code]}" - out_str << "\n :Private Mailbox Number: #{printable[:private_mailbox_number]}" - out_str << "\n :State: #{printable[:state]}" - out_str << "\n :Street: #{printable[:street]}" - out_str << "\n :Unit: #{printable[:unit]}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/us_mail/us_mail_v3_recipient_addresses.rb b/lib/mindee/v1/product/us/us_mail/us_mail_v3_recipient_addresses.rb deleted file mode 100644 index a16203be..00000000 --- a/lib/mindee/v1/product/us/us_mail/us_mail_v3_recipient_addresses.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -require_relative 'us_mail_v3_sender_address' -require_relative 'us_mail_v3_recipient_address' - -module Mindee - module V1 - module Product - module US - module UsMail - # The addresses of the recipients. - class UsMailV3RecipientAddresses < Array - # Entries. - # @return [Array] - attr_reader :entries - - # @param prediction [Array] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - entries = prediction.map do |entry| - UsMail::UsMailV3RecipientAddress.new(entry, page_id) - end - super(entries) - end - - # Creates a line of rST table-compliant string separators. - # @param char [String] Character to use as a separator. - # @return [String] - def self.line_items_separator(char) - out_str = String.new - out_str << "+#{char * 17}" - out_str << "+#{char * 37}" - out_str << "+#{char * 19}" - out_str << "+#{char * 13}" - out_str << "+#{char * 24}" - out_str << "+#{char * 7}" - out_str << "+#{char * 27}" - out_str << "+#{char * 17}" - out_str - end - - # @return [String] - def to_s - return '' if empty? - - lines = map do |entry| - "\n #{entry.to_table_line}\n#{self.class.line_items_separator('-')}" - end.join - out_str = String.new - out_str << "\n#{self.class.line_items_separator('-')}\n " - out_str << ' | City ' - out_str << ' | Complete Address ' - out_str << ' | Is Address Change' - out_str << ' | Postal Code' - out_str << ' | Private Mailbox Number' - out_str << ' | State' - out_str << ' | Street ' - out_str << ' | Unit ' - out_str << " |\n#{self.class.line_items_separator('=')}" - out_str + lines - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/us/us_mail/us_mail_v3_sender_address.rb b/lib/mindee/v1/product/us/us_mail/us_mail_v3_sender_address.rb deleted file mode 100644 index 0d94bca1..00000000 --- a/lib/mindee/v1/product/us/us_mail/us_mail_v3_sender_address.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module US - module UsMail - # The address of the sender. - class UsMailV3SenderAddress < Mindee::V1::Parsing::Standard::FeatureField - include Mindee::V1::Parsing::Standard - # The city of the sender's address. - # @return [String] - attr_reader :city - # The complete address of the sender. - # @return [String] - attr_reader :complete - # The postal code of the sender's address. - # @return [String] - attr_reader :postal_code - # Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. - # @return [String] - attr_reader :state - # The street of the sender's address. - # @return [String] - attr_reader :street - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @city = prediction['city'] - @complete = prediction['complete'] - @postal_code = prediction['postal_code'] - @state = prediction['state'] - @street = prediction['street'] - @page_id = page_id - end - - # @return [Hash] - def printable_values - printable = {} - printable[:city] = format_for_display(@city) - printable[:complete] = format_for_display(@complete) - printable[:postal_code] = format_for_display(@postal_code) - printable[:state] = format_for_display(@state) - printable[:street] = format_for_display(@street) - printable - end - - # @return [String] - def to_s - printable = printable_values - out_str = String.new - out_str << "\n :City: #{printable[:city]}" - out_str << "\n :Complete Address: #{printable[:complete]}" - out_str << "\n :Postal Code: #{printable[:postal_code]}" - out_str << "\n :State: #{printable[:state]}" - out_str << "\n :Street: #{printable[:street]}" - out_str - end - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1.rbs deleted file mode 100644 index 953dc6e8..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1.rbs +++ /dev/null @@ -1,13 +0,0 @@ -# lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1.rb - -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier.rbs deleted file mode 100644 index d9933b43..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1Carrier < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def name: -> String - - def professional_number: -> String - - def scac: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_item.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_item.rbs deleted file mode 100644 index 474e57d3..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_item.rbs +++ /dev/null @@ -1,31 +0,0 @@ -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1CarrierItem < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def description: -> String - - def gross_weight: -> Float - - def measurement: -> Float - - def measurement_unit: -> String - - def quantity: -> Float - - def weight_unit: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs deleted file mode 100644 index 7df78e48..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1CarrierItems < Array[BillOfLadingV1CarrierItem] - def initialize: (Array[untyped], Integer?) -> void - def self.line_items_separator: (String) -> String - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_consignee.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_consignee.rbs deleted file mode 100644 index c85b4e02..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_consignee.rbs +++ /dev/null @@ -1,17 +0,0 @@ -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1Consignee < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def address: -> String - def email: -> String - def name: -> String - def phone: -> String - def printable_values: -> Hash[String | Symbol, untyped] - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_document.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_document.rbs deleted file mode 100644 index 3f132946..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_document.rbs +++ /dev/null @@ -1,27 +0,0 @@ -# lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_document.rb - -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def bill_of_lading_number: -> (Parsing::Standard::StringField) - def carrier: -> (Product::BillOfLading::BillOfLadingV1Carrier) - def carrier_items: -> (Product::BillOfLading::BillOfLadingV1CarrierItems) - def consignee: -> (Product::BillOfLading::BillOfLadingV1Consignee) - def date_of_issue: -> (Parsing::Standard::DateField) - def departure_date: -> (Parsing::Standard::DateField) - def notify_party: -> (Product::BillOfLading::BillOfLadingV1NotifyParty) - def place_of_delivery: -> (Parsing::Standard::StringField) - def port_of_discharge: -> (Parsing::Standard::StringField) - def port_of_loading: -> (Parsing::Standard::StringField) - def shipper: -> (Product::BillOfLading::BillOfLadingV1Shipper) - def carrier_items_separator: (String) -> String - def carrier_items_to_s: -> String - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_notify_party.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_notify_party.rbs deleted file mode 100644 index 69b47630..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_notify_party.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1NotifyParty < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def address: -> String - - def email: -> String - - def name: -> String - - def phone: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_page.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_page.rbs deleted file mode 100644 index d7845359..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_page.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# lib/mindee/v1/product/bill_of_lading/bill_of_lading_v1_page.rb - -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class BillOfLadingV1PagePrediction < BillOfLadingV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_shipper.rbs b/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_shipper.rbs deleted file mode 100644 index 854b185e..00000000 --- a/sig/mindee/v1/product/bill_of_lading/bill_of_lading_v1_shipper.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module Mindee - module V1 - module Product - module BillOfLading - class BillOfLadingV1Shipper < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def address: -> String - - def email: -> String - - def name: -> String - - def phone: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/business_card/business_card_v1.rbs b/sig/mindee/v1/product/business_card/business_card_v1.rbs deleted file mode 100644 index a5bcc9cc..00000000 --- a/sig/mindee/v1/product/business_card/business_card_v1.rbs +++ /dev/null @@ -1,13 +0,0 @@ -# lib/mindee/v1/product/business_card/business_card_v1.rb - -module Mindee - module V1 - module Product - module BusinessCard - class BusinessCardV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end -end diff --git a/sig/mindee/v1/product/business_card/business_card_v1_document.rbs b/sig/mindee/v1/product/business_card/business_card_v1_document.rbs deleted file mode 100644 index e7429dd1..00000000 --- a/sig/mindee/v1/product/business_card/business_card_v1_document.rbs +++ /dev/null @@ -1,25 +0,0 @@ -# lib/mindee/v1/product/business_card/business_card_v1_document.rb - -module Mindee - module V1 - module Product - module BusinessCard - class BusinessCardV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def address: -> (Parsing::Standard::StringField) - def company: -> (Parsing::Standard::StringField) - def email: -> (Parsing::Standard::StringField) - def fax_number: -> (Parsing::Standard::StringField) - def firstname: -> (Parsing::Standard::StringField) - def job_title: -> (Parsing::Standard::StringField) - def lastname: -> (Parsing::Standard::StringField) - def mobile_number: -> (Parsing::Standard::StringField) - def phone_number: -> (Parsing::Standard::StringField) - def social_media: -> (Array[Parsing::Standard::StringField]) - def website: -> (Parsing::Standard::StringField) - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/business_card/business_card_v1_page.rbs b/sig/mindee/v1/product/business_card/business_card_v1_page.rbs deleted file mode 100644 index 01ce79fe..00000000 --- a/sig/mindee/v1/product/business_card/business_card_v1_page.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# lib/mindee/v1/product/business_card/business_card_v1_page.rb - -module Mindee - module V1 - module Product - module BusinessCard - class BusinessCardV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class BusinessCardV1PagePrediction < BusinessCardV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/delivery_note/delivery_note_v1.rbs b/sig/mindee/v1/product/delivery_note/delivery_note_v1.rbs deleted file mode 100644 index 502e86a7..00000000 --- a/sig/mindee/v1/product/delivery_note/delivery_note_v1.rbs +++ /dev/null @@ -1,13 +0,0 @@ -# lib/mindee/v1/product/delivery_note/delivery_note_v1.rb - -module Mindee - module V1 - module Product - module DeliveryNote - class DeliveryNoteV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end -end diff --git a/sig/mindee/v1/product/delivery_note/delivery_note_v1_document.rbs b/sig/mindee/v1/product/delivery_note/delivery_note_v1_document.rbs deleted file mode 100644 index 1280f80e..00000000 --- a/sig/mindee/v1/product/delivery_note/delivery_note_v1_document.rbs +++ /dev/null @@ -1,21 +0,0 @@ -# lib/mindee/v1/product/delivery_note/delivery_note_v1_document.rb - -module Mindee - module V1 - module Product - module DeliveryNote - class DeliveryNoteV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def customer_address: -> (Parsing::Standard::StringField) - def customer_name: -> (Parsing::Standard::StringField) - def delivery_date: -> (Parsing::Standard::DateField) - def delivery_number: -> (Parsing::Standard::StringField) - def supplier_address: -> (Parsing::Standard::StringField) - def supplier_name: -> (Parsing::Standard::StringField) - def total_amount: -> (Parsing::Standard::AmountField) - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/delivery_note/delivery_note_v1_page.rbs b/sig/mindee/v1/product/delivery_note/delivery_note_v1_page.rbs deleted file mode 100644 index 094b3673..00000000 --- a/sig/mindee/v1/product/delivery_note/delivery_note_v1_page.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# lib/mindee/v1/product/delivery_note/delivery_note_v1_page.rb - -module Mindee - module V1 - module Product - module DeliveryNote - class DeliveryNoteV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class DeliveryNoteV1PagePrediction < DeliveryNoteV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/driver_license/driver_license_v1.rbs b/sig/mindee/v1/product/driver_license/driver_license_v1.rbs deleted file mode 100644 index 2883e2db..00000000 --- a/sig/mindee/v1/product/driver_license/driver_license_v1.rbs +++ /dev/null @@ -1,13 +0,0 @@ -# lib/mindee/v1/product/driver_license/driver_license_v1.rb - -module Mindee - module V1 - module Product - module DriverLicense - class DriverLicenseV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end -end diff --git a/sig/mindee/v1/product/driver_license/driver_license_v1_document.rbs b/sig/mindee/v1/product/driver_license/driver_license_v1_document.rbs deleted file mode 100644 index 64d94f14..00000000 --- a/sig/mindee/v1/product/driver_license/driver_license_v1_document.rbs +++ /dev/null @@ -1,27 +0,0 @@ -# lib/mindee/v1/product/driver_license/driver_license_v1_document.rb - -module Mindee - module V1 - module Product - module DriverLicense - class DriverLicenseV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def category: -> (Parsing::Standard::StringField) - def country_code: -> (Parsing::Standard::StringField) - def date_of_birth: -> (Parsing::Standard::DateField) - def dd_number: -> (Parsing::Standard::StringField) - def expiry_date: -> (Parsing::Standard::DateField) - def first_name: -> (Parsing::Standard::StringField) - def id: -> (Parsing::Standard::StringField) - def issued_date: -> (Parsing::Standard::DateField) - def issuing_authority: -> (Parsing::Standard::StringField) - def last_name: -> (Parsing::Standard::StringField) - def mrz: -> (Parsing::Standard::StringField) - def place_of_birth: -> (Parsing::Standard::StringField) - def state: -> (Parsing::Standard::StringField) - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/driver_license/driver_license_v1_page.rbs b/sig/mindee/v1/product/driver_license/driver_license_v1_page.rbs deleted file mode 100644 index 4a59a912..00000000 --- a/sig/mindee/v1/product/driver_license/driver_license_v1_page.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# lib/mindee/v1/product/driver_license/driver_license_v1_page.rb - -module Mindee - module V1 - module Product - module DriverLicense - class DriverLicenseV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class DriverLicenseV1PagePrediction < DriverLicenseV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1.rbs b/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1.rbs deleted file mode 100644 index ff42d7c3..00000000 --- a/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/carte_grise/carte_grise_v1.rb - -module Mindee - module V1 - module Product - module FR - module CarteGrise - class CarteGriseV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1_document.rbs b/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1_document.rbs deleted file mode 100644 index 86bbb400..00000000 --- a/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1_document.rbs +++ /dev/null @@ -1,57 +0,0 @@ -# lib/mindee/v1/product/carte_grise/carte_grise_v1_document.rb - -module Mindee - module V1 - module Product - module FR - module CarteGrise - class CarteGriseV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def a: -> (Parsing::Standard::StringField) - def b: -> (Parsing::Standard::DateField) - def c1: -> (Parsing::Standard::StringField) - def c3: -> (Parsing::Standard::StringField) - def c41: -> (Parsing::Standard::StringField) - def c4a: -> (Parsing::Standard::StringField) - def d1: -> (Parsing::Standard::StringField) - def d3: -> (Parsing::Standard::StringField) - def e: -> (Parsing::Standard::StringField) - def f1: -> (Parsing::Standard::StringField) - def f2: -> (Parsing::Standard::StringField) - def f3: -> (Parsing::Standard::StringField) - def formula_number: -> (Parsing::Standard::StringField) - def g: -> (Parsing::Standard::StringField) - def g1: -> (Parsing::Standard::StringField) - def i: -> (Parsing::Standard::DateField) - def j: -> (Parsing::Standard::StringField) - def j1: -> (Parsing::Standard::StringField) - def j2: -> (Parsing::Standard::StringField) - def j3: -> (Parsing::Standard::StringField) - def mrz1: -> (Parsing::Standard::StringField) - def mrz2: -> (Parsing::Standard::StringField) - def owner_first_name: -> (Parsing::Standard::StringField) - def owner_surname: -> (Parsing::Standard::StringField) - def p1: -> (Parsing::Standard::StringField) - def p2: -> (Parsing::Standard::StringField) - def p3: -> (Parsing::Standard::StringField) - def p6: -> (Parsing::Standard::StringField) - def q: -> (Parsing::Standard::StringField) - def s1: -> (Parsing::Standard::StringField) - def s2: -> (Parsing::Standard::StringField) - def u1: -> (Parsing::Standard::StringField) - def u2: -> (Parsing::Standard::StringField) - def v7: -> (Parsing::Standard::StringField) - def x1: -> (Parsing::Standard::StringField) - def y1: -> (Parsing::Standard::StringField) - def y2: -> (Parsing::Standard::StringField) - def y3: -> (Parsing::Standard::StringField) - def y4: -> (Parsing::Standard::StringField) - def y5: -> (Parsing::Standard::StringField) - def y6: -> (Parsing::Standard::StringField) - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1_page.rbs b/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1_page.rbs deleted file mode 100644 index 3fcf68a1..00000000 --- a/sig/mindee/v1/product/fr/carte_grise/carte_grise_v1_page.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# lib/mindee/v1/product/carte_grise/carte_grise_v1_page.rb - -module Mindee - module V1 - module Product - module FR - module CarteGrise - class CarteGriseV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class CarteGriseV1PagePrediction < CarteGriseV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1.rbs deleted file mode 100644 index 9a233a6d..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/energy_bill/energy_bill_v1.rb - -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_document.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_document.rbs deleted file mode 100644 index 89554fc0..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_document.rbs +++ /dev/null @@ -1,36 +0,0 @@ -# lib/mindee/v1/product/energy_bill/energy_bill_v1_document.rb - -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def contract_id: -> (Parsing::Standard::StringField) - def delivery_point: -> (Parsing::Standard::StringField) - def due_date: -> (Parsing::Standard::DateField) - def energy_consumer: -> (Product::FR::EnergyBill::EnergyBillV1EnergyConsumer) - def energy_supplier: -> (Product::FR::EnergyBill::EnergyBillV1EnergySupplier) - def energy_usage: -> (Product::FR::EnergyBill::EnergyBillV1EnergyUsages) - def invoice_date: -> (Parsing::Standard::DateField) - def invoice_number: -> (Parsing::Standard::StringField) - def meter_details: -> (Product::FR::EnergyBill::EnergyBillV1MeterDetail) - def subscription: -> (Product::FR::EnergyBill::EnergyBillV1Subscriptions) - def taxes_and_contributions: -> (Product::FR::EnergyBill::EnergyBillV1TaxesAndContributions) - def total_amount: -> (Parsing::Standard::AmountField) - def total_before_taxes: -> (Parsing::Standard::AmountField) - def total_taxes: -> (Parsing::Standard::AmountField) - def subscription_separator: (String) -> String - def subscription_to_s: -> String - def energy_usage_separator: (String) -> String - def energy_usage_to_s: -> String - def taxes_and_contributions_separator: (String) -> String - def taxes_and_contributions_to_s: -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_consumer.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_consumer.rbs deleted file mode 100644 index 8c1cafd4..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_consumer.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1EnergyConsumer < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def address: -> String - - def name: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_supplier.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_supplier.rbs deleted file mode 100644 index 8452b928..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_supplier.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1EnergySupplier < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def address: -> String - - def name: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs deleted file mode 100644 index 8cc4ac16..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +++ /dev/null @@ -1,37 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1EnergyUsage < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def consumption: -> Float - - def description: -> String - - def end_date: -> String - - def start_date: -> String - - def tax_rate: -> Float - - def total: -> Float - - def unit: -> String - - def unit_price: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs deleted file mode 100644 index fdae744b..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1EnergyUsages < Array[EnergyBillV1EnergyUsage] - def initialize: (Array[untyped], Integer?) -> void - def self.line_items_separator: (String) -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_meter_detail.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_meter_detail.rbs deleted file mode 100644 index 4b2c5dbe..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_meter_detail.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1MeterDetail < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def meter_number: -> String - - def meter_type: -> String - - def unit: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_page.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_page.rbs deleted file mode 100644 index 7cf6eacd..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_page.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# lib/mindee/v1/product/energy_bill/energy_bill_v1_page.rb - -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class EnergyBillV1PagePrediction < EnergyBillV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscription.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscription.rbs deleted file mode 100644 index 7c8662d3..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscription.rbs +++ /dev/null @@ -1,33 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1Subscription < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def description: -> String - - def end_date: -> String - - def start_date: -> String - - def tax_rate: -> Float - - def total: -> Float - - def unit_price: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs deleted file mode 100644 index 9a4da502..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1Subscriptions < Array[EnergyBillV1Subscription] - def initialize: (Array[untyped], Integer?) -> void - def self.line_items_separator: (String) -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rbs deleted file mode 100644 index 0824f96b..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1TaxesAndContribution < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def description: -> String - def end_date: -> String - def start_date: -> String - def tax_rate: -> Float - def total: -> Float - def unit_price: -> Float - def printable_values: -> Hash[String | Symbol, untyped] - def table_printable_values: -> Hash[String | Symbol, untyped] - def to_table_line: -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs b/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs deleted file mode 100644 index 1392e049..00000000 --- a/sig/mindee/v1/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module FR - module EnergyBill - class EnergyBillV1TaxesAndContributions < Array[EnergyBillV1TaxesAndContribution] - def initialize: (Array[untyped], Integer?) -> void - def self.line_items_separator: (String) -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/health_card/health_card_v1.rbs b/sig/mindee/v1/product/fr/health_card/health_card_v1.rbs deleted file mode 100644 index 121822c9..00000000 --- a/sig/mindee/v1/product/fr/health_card/health_card_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/health_card/health_card_v1.rb - -module Mindee - module V1 - module Product - module FR - module HealthCard - class HealthCardV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/health_card/health_card_v1_document.rbs b/sig/mindee/v1/product/fr/health_card/health_card_v1_document.rbs deleted file mode 100644 index c1c90bb8..00000000 --- a/sig/mindee/v1/product/fr/health_card/health_card_v1_document.rbs +++ /dev/null @@ -1,20 +0,0 @@ -# lib/mindee/v1/product/health_card/health_card_v1_document.rb - -module Mindee - module V1 - module Product - module FR - module HealthCard - class HealthCardV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def given_names: -> (Array[Parsing::Standard::StringField]) - def issuance_date: -> (Parsing::Standard::DateField) - def social_security: -> (Parsing::Standard::StringField) - def surname: -> (Parsing::Standard::StringField) - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/health_card/health_card_v1_page.rbs b/sig/mindee/v1/product/fr/health_card/health_card_v1_page.rbs deleted file mode 100644 index 5c7b0fcd..00000000 --- a/sig/mindee/v1/product/fr/health_card/health_card_v1_page.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# lib/mindee/v1/product/health_card/health_card_v1_page.rb - -module Mindee - module V1 - module Product - module FR - module HealthCard - class HealthCardV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class HealthCardV1PagePrediction < HealthCardV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3.rbs deleted file mode 100644 index e1f4847b..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/payslip/payslip_v3.rb - -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_bank_account_detail.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_bank_account_detail.rbs deleted file mode 100644 index 0a6c7ba2..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_bank_account_detail.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3BankAccountDetail < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def bank_name: -> String - - def iban: -> String - - def swift: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_document.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_document.rbs deleted file mode 100644 index c5303a63..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_document.rbs +++ /dev/null @@ -1,28 +0,0 @@ -# lib/mindee/v1/product/payslip/payslip_v3_document.rb - -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def bank_account_details: -> (Product::FR::Payslip::PayslipV3BankAccountDetail) - def employee: -> (Product::FR::Payslip::PayslipV3Employee) - def employer: -> (Product::FR::Payslip::PayslipV3Employer) - def employment: -> (Product::FR::Payslip::PayslipV3Employment) - def paid_time_off: -> (Product::FR::Payslip::PayslipV3PaidTimeOffs) - def pay_detail: -> (Product::FR::Payslip::PayslipV3PayDetail) - def pay_period: -> (Product::FR::Payslip::PayslipV3PayPeriod) - def salary_details: -> (Product::FR::Payslip::PayslipV3SalaryDetails) - def salary_details_separator: (String) -> String - def salary_details_to_s: -> String - def paid_time_off_separator: (String) -> String - def paid_time_off_to_s: -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_employee.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_employee.rbs deleted file mode 100644 index f0d0ae36..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_employee.rbs +++ /dev/null @@ -1,31 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3Employee < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def address: -> String - - def date_of_birth: -> String - - def first_name: -> String - - def last_name: -> String - - def phone_number: -> String - - def registration_number: -> String - - def social_security_number: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_employer.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_employer.rbs deleted file mode 100644 index 4f96352b..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_employer.rbs +++ /dev/null @@ -1,31 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3Employer < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def address: -> String - - def company_id: -> String - - def company_site: -> String - - def naf_code: -> String - - def name: -> String - - def phone_number: -> String - - def urssaf_number: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_employment.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_employment.rbs deleted file mode 100644 index f22591b5..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_employment.rbs +++ /dev/null @@ -1,31 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3Employment < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def category: -> String - - def coefficient: -> String - - def collective_agreement: -> String - - def job_title: -> String - - def position_level: -> String - - def seniority_date: -> String - - def start_date: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_page.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_page.rbs deleted file mode 100644 index 7d4b3016..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_page.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# lib/mindee/v1/product/payslip/payslip_v3_page.rb - -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class PayslipV3PagePrediction < PayslipV3Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_paid_time_off.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_paid_time_off.rbs deleted file mode 100644 index 4aa4bca1..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_paid_time_off.rbs +++ /dev/null @@ -1,31 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3PaidTimeOff < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def accrued: -> Float - - def period: -> String - - def pto_type: -> String - - def remaining: -> Float - - def used: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_paid_time_offs.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_paid_time_offs.rbs deleted file mode 100644 index 914b8aac..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_paid_time_offs.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3PaidTimeOffs < Array[PayslipV3PaidTimeOff] - def initialize: (Array[untyped], Integer?) -> void - def self.line_items_separator: (String) -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_pay_detail.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_pay_detail.rbs deleted file mode 100644 index 184fa066..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_pay_detail.rbs +++ /dev/null @@ -1,37 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3PayDetail < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def gross_salary: -> Float - - def gross_salary_ytd: -> Float - - def income_tax_rate: -> Float - - def income_tax_withheld: -> Float - - def net_paid: -> Float - - def net_paid_before_tax: -> Float - - def net_taxable: -> Float - - def net_taxable_ytd: -> Float - - def total_cost_employer: -> Float - - def total_taxes_and_deductions: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_pay_period.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_pay_period.rbs deleted file mode 100644 index fcf1c7b4..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_pay_period.rbs +++ /dev/null @@ -1,27 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3PayPeriod < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def end_date: -> String - - def month: -> String - - def payment_date: -> String - - def start_date: -> String - - def year: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_salary_detail.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_salary_detail.rbs deleted file mode 100644 index d209a055..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_salary_detail.rbs +++ /dev/null @@ -1,31 +0,0 @@ -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3SalaryDetail < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def amount: -> Float - - def base: -> Float - - def description: -> String - - def number: -> Float - - def rate: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/payslip/payslip_v3_salary_details.rbs b/sig/mindee/v1/product/fr/payslip/payslip_v3_salary_details.rbs deleted file mode 100644 index b4b20f69..00000000 --- a/sig/mindee/v1/product/fr/payslip/payslip_v3_salary_details.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module FR - module Payslip - class PayslipV3SalaryDetails < Array[PayslipV3SalaryDetail] - def initialize: (Array[untyped], Integer?) -> void - def self.line_items_separator: (String) -> String - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1.rbs b/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1.rbs deleted file mode 100644 index e4488685..00000000 --- a/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/indian_passport/indian_passport_v1.rb - -module Mindee - module V1 - module Product - module IND - module IndianPassport - class IndianPassportV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1_document.rbs b/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1_document.rbs deleted file mode 100644 index 24cad137..00000000 --- a/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1_document.rbs +++ /dev/null @@ -1,39 +0,0 @@ -# lib/mindee/v1/product/indian_passport/indian_passport_v1_document.rb - -module Mindee - module V1 - module Product - module IND - module IndianPassport - class IndianPassportV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def address1: -> (Parsing::Standard::StringField) - def address2: -> (Parsing::Standard::StringField) - def address3: -> (Parsing::Standard::StringField) - def birth_date: -> (Parsing::Standard::DateField) - def birth_place: -> (Parsing::Standard::StringField) - def country: -> (Parsing::Standard::StringField) - def expiry_date: -> (Parsing::Standard::DateField) - def file_number: -> (Parsing::Standard::StringField) - def gender: -> (Parsing::Standard::ClassificationField) - def given_names: -> (Parsing::Standard::StringField) - def id_number: -> (Parsing::Standard::StringField) - def issuance_date: -> (Parsing::Standard::DateField) - def issuance_place: -> (Parsing::Standard::StringField) - def legal_guardian: -> (Parsing::Standard::StringField) - def mrz1: -> (Parsing::Standard::StringField) - def mrz2: -> (Parsing::Standard::StringField) - def name_of_mother: -> (Parsing::Standard::StringField) - def name_of_spouse: -> (Parsing::Standard::StringField) - def old_passport_date_of_issue: -> (Parsing::Standard::DateField) - def old_passport_number: -> (Parsing::Standard::StringField) - def old_passport_place_of_issue: -> (Parsing::Standard::StringField) - def page_number: -> (Parsing::Standard::ClassificationField) - def surname: -> (Parsing::Standard::StringField) - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1_page.rbs b/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1_page.rbs deleted file mode 100644 index 3e567e3a..00000000 --- a/sig/mindee/v1/product/ind/indian_passport/indian_passport_v1_page.rbs +++ /dev/null @@ -1,21 +0,0 @@ -# lib/mindee/v1/product/indian_passport/indian_passport_v1_page.rb - -module Mindee - module V1 - module Product - module IND - module IndianPassport - class IndianPassportV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - - class IndianPassportV1PagePrediction < IndianPassportV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1.rbs deleted file mode 100644 index c545c4d1..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1.rbs +++ /dev/null @@ -1,13 +0,0 @@ -# lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1.rb - -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rbs deleted file mode 100644 index 6687bc97..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1AddedSugar < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rbs deleted file mode 100644 index 7e1de094..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Calorie < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rbs deleted file mode 100644 index 72ee3cc1..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Cholesterol < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rbs deleted file mode 100644 index 11d4fc83..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1DietaryFiber < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_document.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_document.rbs deleted file mode 100644 index 3eab4825..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_document.rbs +++ /dev/null @@ -1,30 +0,0 @@ -# lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb - -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def added_sugars: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1AddedSugar) - def calories: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1Calorie) - def cholesterol: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1Cholesterol) - def dietary_fiber: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1DietaryFiber) - def nutrients: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1Nutrients) - def protein: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1Protein) - def saturated_fat: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1SaturatedFat) - def serving_per_box: -> (Parsing::Standard::AmountField) - def serving_size: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1ServingSize) - def sodium: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1Sodium) - def total_carbohydrate: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1TotalCarbohydrate) - def total_fat: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1TotalFat) - def total_sugars: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1TotalSugar) - def trans_fat: -> (Product::NutritionFactsLabel::NutritionFactsLabelV1TransFat) - def nutrients_separator: (String) -> String - def nutrients_to_s: -> String - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rbs deleted file mode 100644 index 092596aa..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rbs +++ /dev/null @@ -1,29 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Nutrient < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def name: -> String - - def per_100g: -> Float - - def per_serving: -> Float - - def unit: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs deleted file mode 100644 index 79f02ffd..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Nutrients < Array[NutritionFactsLabelV1Nutrient] - def initialize: (Array[untyped], Integer?) -> void - def self.line_items_separator: (String) -> String - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_page.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_page.rbs deleted file mode 100644 index 441ca40f..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_page.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# lib/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb - -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class NutritionFactsLabelV1PagePrediction < NutritionFactsLabelV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rbs deleted file mode 100644 index 3d9ec267..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Protein < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rbs deleted file mode 100644 index 1e109652..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1SaturatedFat < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rbs deleted file mode 100644 index 4ceae289..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rbs +++ /dev/null @@ -1,19 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1ServingSize < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def amount: -> Float - - def unit: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rbs deleted file mode 100644 index 977aaca4..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1Sodium < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def unit: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rbs deleted file mode 100644 index 7aad53ad..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rbs +++ /dev/null @@ -1,22 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1TotalCarbohydrate < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end - diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rbs deleted file mode 100644 index 929c7d93..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1TotalFat < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rbs deleted file mode 100644 index 7ce8a35d..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1TotalSugar < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rbs b/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rbs deleted file mode 100644 index 80e62ad6..00000000 --- a/sig/mindee/v1/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Mindee - module V1 - module Product - module NutritionFactsLabel - class NutritionFactsLabelV1TransFat < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def daily_value: -> Float - - def per_100g: -> Float - - def per_serving: -> Float - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/bank_check/bank_check_v1.rbs b/sig/mindee/v1/product/us/bank_check/bank_check_v1.rbs deleted file mode 100644 index 3603c8b5..00000000 --- a/sig/mindee/v1/product/us/bank_check/bank_check_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/bank_check/bank_check_v1.rb - -module Mindee - module V1 - module Product - module US - module BankCheck - class BankCheckV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/bank_check/bank_check_v1_document.rbs b/sig/mindee/v1/product/us/bank_check/bank_check_v1_document.rbs deleted file mode 100644 index 1b469360..00000000 --- a/sig/mindee/v1/product/us/bank_check/bank_check_v1_document.rbs +++ /dev/null @@ -1,29 +0,0 @@ -# lib/mindee/v1/product/bank_check/bank_check_v1_document.rb - -module Mindee - module V1 - module Product - module US - module BankCheck - class BankCheckV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def account_number: -> (Parsing::Standard::StringField) - - def amount: -> (Parsing::Standard::AmountField) - - def check_number: -> (Parsing::Standard::StringField) - - def date: -> (Parsing::Standard::DateField) - - def payees: -> (Array[Parsing::Standard::StringField]) - - def routing_number: -> (Parsing::Standard::StringField) - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/bank_check/bank_check_v1_page.rbs b/sig/mindee/v1/product/us/bank_check/bank_check_v1_page.rbs deleted file mode 100644 index 75af00c4..00000000 --- a/sig/mindee/v1/product/us/bank_check/bank_check_v1_page.rbs +++ /dev/null @@ -1,25 +0,0 @@ -# lib/mindee/v1/product/bank_check/bank_check_v1_page.rb - -module Mindee - module V1 - module Product - module US - module BankCheck - class BankCheckV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - - class BankCheckV1PagePrediction < BankCheckV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def check_position: -> Parsing::Standard::PositionField - - def signatures_positions: -> Array[Parsing::Standard::PositionField] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1.rbs b/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1.rbs deleted file mode 100644 index 226f4975..00000000 --- a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/healthcare_card/healthcare_card_v1.rb - -module Mindee - module V1 - module Product - module US - module HealthcareCard - class HealthcareCardV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copay.rbs b/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copay.rbs deleted file mode 100644 index 95c2e4e8..00000000 --- a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copay.rbs +++ /dev/null @@ -1,25 +0,0 @@ -module Mindee - module V1 - module Product - module US - module HealthcareCard - class HealthcareCardV1Copay < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def service_fees: -> Float - - def service_name: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copays.rbs b/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copays.rbs deleted file mode 100644 index e08b1900..00000000 --- a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_copays.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module US - module HealthcareCard - class HealthcareCardV1Copays < Array[HealthcareCardV1Copay] - def initialize: (Array[untyped], Integer?) -> void - - def self.line_items_separator: (String) -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_document.rbs b/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_document.rbs deleted file mode 100644 index 48b105f8..00000000 --- a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_document.rbs +++ /dev/null @@ -1,49 +0,0 @@ -# lib/mindee/v1/product/healthcare_card/healthcare_card_v1_document.rb - -module Mindee - module V1 - module Product - module US - module HealthcareCard - class HealthcareCardV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def company_name: -> (Parsing::Standard::StringField) - - def copays: -> (Product::US::HealthcareCard::HealthcareCardV1Copays) - - def dependents: -> (Array[Parsing::Standard::StringField]) - - def enrollment_date: -> (Parsing::Standard::DateField) - - def group_number: -> (Parsing::Standard::StringField) - - def issuer80840: -> (Parsing::Standard::StringField) - - def member_id: -> (Parsing::Standard::StringField) - - def member_name: -> (Parsing::Standard::StringField) - - def payer_id: -> (Parsing::Standard::StringField) - - def plan_name: -> (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 - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_page.rbs b/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_page.rbs deleted file mode 100644 index 9d7549d0..00000000 --- a/sig/mindee/v1/product/us/healthcare_card/healthcare_card_v1_page.rbs +++ /dev/null @@ -1,21 +0,0 @@ -# lib/mindee/v1/product/healthcare_card/healthcare_card_v1_page.rb - -module Mindee - module V1 - module Product - module US - module HealthcareCard - class HealthcareCardV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - - class HealthcareCardV1PagePrediction < HealthcareCardV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/us_mail/us_mail_v3.rbs b/sig/mindee/v1/product/us/us_mail/us_mail_v3.rbs deleted file mode 100644 index d59b8991..00000000 --- a/sig/mindee/v1/product/us/us_mail/us_mail_v3.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/us_mail/us_mail_v3.rb - -module Mindee - module V1 - module Product - module US - module UsMail - class UsMailV3 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/us_mail/us_mail_v3_document.rbs b/sig/mindee/v1/product/us/us_mail/us_mail_v3_document.rbs deleted file mode 100644 index fcc89cae..00000000 --- a/sig/mindee/v1/product/us/us_mail/us_mail_v3_document.rbs +++ /dev/null @@ -1,31 +0,0 @@ -# lib/mindee/v1/product/us_mail/us_mail_v3_document.rb - -module Mindee - module V1 - module Product - module US - module UsMail - class UsMailV3Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def is_return_to_sender: -> (Parsing::Standard::BooleanField) - - def recipient_addresses: -> (Product::US::UsMail::UsMailV3RecipientAddresses) - - def recipient_names: -> (Array[Parsing::Standard::StringField]) - - def sender_address: -> (Product::US::UsMail::UsMailV3SenderAddress) - - def sender_name: -> (Parsing::Standard::StringField) - - def recipient_addresses_separator: (String) -> String - - def recipient_addresses_to_s: -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/us_mail/us_mail_v3_page.rbs b/sig/mindee/v1/product/us/us_mail/us_mail_v3_page.rbs deleted file mode 100644 index 75e5b11b..00000000 --- a/sig/mindee/v1/product/us/us_mail/us_mail_v3_page.rbs +++ /dev/null @@ -1,21 +0,0 @@ -# lib/mindee/v1/product/us_mail/us_mail_v3_page.rb - -module Mindee - module V1 - module Product - module US - module UsMail - class UsMailV3Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - - class UsMailV3PagePrediction < UsMailV3Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/us_mail/us_mail_v3_recipient_address.rbs b/sig/mindee/v1/product/us/us_mail/us_mail_v3_recipient_address.rbs deleted file mode 100644 index c1a1b12e..00000000 --- a/sig/mindee/v1/product/us/us_mail/us_mail_v3_recipient_address.rbs +++ /dev/null @@ -1,37 +0,0 @@ -module Mindee - module V1 - module Product - module US - module UsMail - class UsMailV3RecipientAddress < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def city: -> String - - def complete: -> String - - def is_address_change: -> bool - - def postal_code: -> String - - def private_mailbox_number: -> String - - def state: -> String - - def street: -> String - - def unit: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def table_printable_values: -> Hash[String | Symbol, untyped] - - def to_table_line: -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/us_mail/us_mail_v3_recipient_addresses.rbs b/sig/mindee/v1/product/us/us_mail/us_mail_v3_recipient_addresses.rbs deleted file mode 100644 index 129d537c..00000000 --- a/sig/mindee/v1/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -module Mindee - module V1 - module Product - module US - module UsMail - class UsMailV3RecipientAddresses < Array[UsMailV3RecipientAddress] - def initialize: (Array[untyped], Integer?) -> void - - def self.line_items_separator: (String) -> String - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/us_mail/us_mail_v3_sender_address.rbs b/sig/mindee/v1/product/us/us_mail/us_mail_v3_sender_address.rbs deleted file mode 100644 index c85651cb..00000000 --- a/sig/mindee/v1/product/us/us_mail/us_mail_v3_sender_address.rbs +++ /dev/null @@ -1,27 +0,0 @@ -module Mindee - module V1 - module Product - module US - module UsMail - class UsMailV3SenderAddress < Parsing::Standard::FeatureField - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def city: -> String - - def complete: -> String - - def postal_code: -> String - - def state: -> String - - def street: -> String - - def printable_values: -> Hash[String | Symbol, untyped] - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/w9/w9_v1.rbs b/sig/mindee/v1/product/us/w9/w9_v1.rbs deleted file mode 100644 index 9e2d8924..00000000 --- a/sig/mindee/v1/product/us/w9/w9_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/w9/w9_v1.rb - -module Mindee - module V1 - module Product - module US - module W9 - class W9V1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/w9/w9_v1_document.rbs b/sig/mindee/v1/product/us/w9/w9_v1_document.rbs deleted file mode 100644 index 942c9760..00000000 --- a/sig/mindee/v1/product/us/w9/w9_v1_document.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# lib/mindee/v1/product/w9/w9_v1_document.rb - -module Mindee - module V1 - module Product - module US - module W9 - class W9V1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/us/w9/w9_v1_page.rbs b/sig/mindee/v1/product/us/w9/w9_v1_page.rbs deleted file mode 100644 index 8c50923e..00000000 --- a/sig/mindee/v1/product/us/w9/w9_v1_page.rbs +++ /dev/null @@ -1,45 +0,0 @@ -# lib/mindee/v1/product/w9/w9_v1_page.rb - -module Mindee - module V1 - module Product - module US - module W9 - class W9V1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - - class W9V1PagePrediction < W9V1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - - def address: -> Parsing::Standard::StringField - - def business_name: -> Parsing::Standard::StringField - - def city_state_zip: -> Parsing::Standard::StringField - - def ein: -> Parsing::Standard::StringField - - def name: -> Parsing::Standard::StringField - - def signature_date_position: -> Parsing::Standard::PositionField - - def signature_position: -> Parsing::Standard::PositionField - - def ssn: -> Parsing::Standard::StringField - - def tax_classification: -> Parsing::Standard::StringField - - def tax_classification_llc: -> Parsing::Standard::StringField - - def tax_classification_other_details: -> Parsing::Standard::StringField - - def w9_revision_date: -> Parsing::Standard::StringField - - def to_s: -> String - end - end - end - end - end -end diff --git a/spec/v1/product/bill_of_lading_v1_spec.rb b/spec/v1/product/bill_of_lading_v1_spec.rb deleted file mode 100644 index 9b79527d..00000000 --- a/spec/v1/product/bill_of_lading_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../data' - -DIR_BILL_OF_LADING_V1 = File.join(V1_DATA_DIR, 'products', 'bill_of_lading', 'response_v1').freeze - -describe Mindee::V1::Product::BillOfLading::BillOfLadingV1 do - context 'A Bill of Lading V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_BILL_OF_LADING_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::BillOfLading::BillOfLadingV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_BILL_OF_LADING_V1, 'summary_full.rst') - response = load_json(DIR_BILL_OF_LADING_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::BillOfLading::BillOfLadingV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/business_card_v1_spec.rb b/spec/v1/product/business_card_v1_spec.rb deleted file mode 100644 index c774319f..00000000 --- a/spec/v1/product/business_card_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../data' - -DIR_BUSINESS_CARD_V1 = File.join(V1_DATA_DIR, 'products', 'business_card', 'response_v1').freeze - -describe Mindee::V1::Product::BusinessCard::BusinessCardV1 do - context 'A Business Card V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_BUSINESS_CARD_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::BusinessCard::BusinessCardV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_BUSINESS_CARD_V1, 'summary_full.rst') - response = load_json(DIR_BUSINESS_CARD_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::BusinessCard::BusinessCardV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/delivery_note_v1_spec.rb b/spec/v1/product/delivery_note_v1_spec.rb deleted file mode 100644 index 19bf1ad3..00000000 --- a/spec/v1/product/delivery_note_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../data' - -DIR_DELIVERY_NOTE_V1 = File.join(V1_DATA_DIR, 'products', 'delivery_notes', 'response_v1').freeze - -describe Mindee::V1::Product::DeliveryNote::DeliveryNoteV1 do - context 'A Delivery note V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_DELIVERY_NOTE_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::DeliveryNote::DeliveryNoteV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_DELIVERY_NOTE_V1, 'summary_full.rst') - response = load_json(DIR_DELIVERY_NOTE_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::DeliveryNote::DeliveryNoteV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/driver_license_v1_spec.rb b/spec/v1/product/driver_license_v1_spec.rb deleted file mode 100644 index 3c62f387..00000000 --- a/spec/v1/product/driver_license_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../data' - -DIR_DRIVER_LICENSE_V1 = File.join(V1_DATA_DIR, 'products', 'driver_license', 'response_v1').freeze - -describe Mindee::V1::Product::DriverLicense::DriverLicenseV1 do - context 'A Driver License V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_DRIVER_LICENSE_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::DriverLicense::DriverLicenseV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_DRIVER_LICENSE_V1, 'summary_full.rst') - response = load_json(DIR_DRIVER_LICENSE_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::DriverLicense::DriverLicenseV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/fr/carte_grise_v1_spec.rb b/spec/v1/product/fr/carte_grise_v1_spec.rb deleted file mode 100644 index fc232d7a..00000000 --- a/spec/v1/product/fr/carte_grise_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_FR_CARTE_GRISE_V1 = File.join(V1_DATA_DIR, 'products', 'carte_grise', 'response_v1').freeze - -describe Mindee::V1::Product::FR::CarteGrise::CarteGriseV1 do - context 'A Carte Grise V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_FR_CARTE_GRISE_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::CarteGrise::CarteGriseV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_FR_CARTE_GRISE_V1, 'summary_full.rst') - response = load_json(DIR_FR_CARTE_GRISE_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::CarteGrise::CarteGriseV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/fr/energy_bill_v1_spec.rb b/spec/v1/product/fr/energy_bill_v1_spec.rb deleted file mode 100644 index cf8101f1..00000000 --- a/spec/v1/product/fr/energy_bill_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_FR_ENERGY_BILL_V1 = File.join(V1_DATA_DIR, 'products', 'energy_bill_fra', 'response_v1').freeze - -describe Mindee::V1::Product::FR::EnergyBill::EnergyBillV1 do - context 'A Energy Bill V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_FR_ENERGY_BILL_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::EnergyBill::EnergyBillV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_FR_ENERGY_BILL_V1, 'summary_full.rst') - response = load_json(DIR_FR_ENERGY_BILL_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::EnergyBill::EnergyBillV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/fr/health_card_v1_spec.rb b/spec/v1/product/fr/health_card_v1_spec.rb deleted file mode 100644 index bcfb6518..00000000 --- a/spec/v1/product/fr/health_card_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_FR_HEALTH_CARD_V1 = File.join(V1_DATA_DIR, 'products', 'french_healthcard', 'response_v1').freeze - -describe Mindee::V1::Product::FR::HealthCard::HealthCardV1 do - context 'A Health Card V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_FR_HEALTH_CARD_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::HealthCard::HealthCardV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_FR_HEALTH_CARD_V1, 'summary_full.rst') - response = load_json(DIR_FR_HEALTH_CARD_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::HealthCard::HealthCardV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/fr/payslip_v3_spec.rb b/spec/v1/product/fr/payslip_v3_spec.rb deleted file mode 100644 index 87f0e482..00000000 --- a/spec/v1/product/fr/payslip_v3_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_FR_PAYSLIP_V3 = File.join(V1_DATA_DIR, 'products', 'payslip_fra', 'response_v3').freeze - -describe Mindee::V1::Product::FR::Payslip::PayslipV3 do - context 'A Payslip V3' do - it 'should load an empty document prediction' do - response = load_json(DIR_FR_PAYSLIP_V3, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::Payslip::PayslipV3, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_FR_PAYSLIP_V3, 'summary_full.rst') - response = load_json(DIR_FR_PAYSLIP_V3, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::Payslip::PayslipV3, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/ind/indian_passport_v1_spec.rb b/spec/v1/product/ind/indian_passport_v1_spec.rb deleted file mode 100644 index 21c8eae1..00000000 --- a/spec/v1/product/ind/indian_passport_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_IND_INDIAN_PASSPORT_V1 = File.join(V1_DATA_DIR, 'products', 'ind_passport', 'response_v1').freeze - -describe Mindee::V1::Product::IND::IndianPassport::IndianPassportV1 do - context 'A Passport - India V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_IND_INDIAN_PASSPORT_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::IND::IndianPassport::IndianPassportV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_IND_INDIAN_PASSPORT_V1, 'summary_full.rst') - response = load_json(DIR_IND_INDIAN_PASSPORT_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::IND::IndianPassport::IndianPassportV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/nutrition_facts_label_v1_spec.rb b/spec/v1/product/nutrition_facts_label_v1_spec.rb deleted file mode 100644 index af5fbad1..00000000 --- a/spec/v1/product/nutrition_facts_label_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../data' - -DIR_NUTRITION_FACTS_LABEL_V1 = File.join(V1_DATA_DIR, 'products', 'nutrition_facts', 'response_v1').freeze - -describe Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1 do - context 'A Nutrition Facts Label V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_NUTRITION_FACTS_LABEL_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_NUTRITION_FACTS_LABEL_V1, 'summary_full.rst') - response = load_json(DIR_NUTRITION_FACTS_LABEL_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::NutritionFactsLabel::NutritionFactsLabelV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/us/bank_check_v1_spec.rb b/spec/v1/product/us/bank_check_v1_spec.rb deleted file mode 100644 index 6682b903..00000000 --- a/spec/v1/product/us/bank_check_v1_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_US_BANK_CHECK_V1 = File.join(V1_DATA_DIR, 'products', 'bank_check', 'response_v1').freeze - -describe Mindee::V1::Product::US::BankCheck::BankCheckV1 do - context 'A Bank Check V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_US_BANK_CHECK_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::US::BankCheck::BankCheckV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_US_BANK_CHECK_V1, 'summary_full.rst') - response = load_json(DIR_US_BANK_CHECK_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::US::BankCheck::BankCheckV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - it 'should load a complete page 0 prediction' do - to_string = read_file(DIR_US_BANK_CHECK_V1, 'summary_page0.rst') - response = load_json(DIR_US_BANK_CHECK_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::US::BankCheck::BankCheckV1, - response['document'] - ) - page = document.inference.pages[0] - expect(page.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/us/healthcare_card_v1_spec.rb b/spec/v1/product/us/healthcare_card_v1_spec.rb deleted file mode 100644 index f580b5db..00000000 --- a/spec/v1/product/us/healthcare_card_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_US_HEALTHCARE_CARD_V1 = File.join(V1_DATA_DIR, 'products', 'us_healthcare_cards', 'response_v1').freeze - -describe Mindee::V1::Product::US::HealthcareCard::HealthcareCardV1 do - context 'A Healthcare Card V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_US_HEALTHCARE_CARD_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::US::HealthcareCard::HealthcareCardV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_US_HEALTHCARE_CARD_V1, 'summary_full.rst') - response = load_json(DIR_US_HEALTHCARE_CARD_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::US::HealthcareCard::HealthcareCardV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/us/us_mail_v3_spec.rb b/spec/v1/product/us/us_mail_v3_spec.rb deleted file mode 100644 index afe4d000..00000000 --- a/spec/v1/product/us/us_mail_v3_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_US_US_MAIL_V3 = File.join(V1_DATA_DIR, 'products', 'us_mail', 'response_v3').freeze - -describe Mindee::V1::Product::US::UsMail::UsMailV3 do - context 'A US Mail V3' do - it 'should load an empty document prediction' do - response = load_json(DIR_US_US_MAIL_V3, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::US::UsMail::UsMailV3, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_US_US_MAIL_V3, 'summary_full.rst') - response = load_json(DIR_US_US_MAIL_V3, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::US::UsMail::UsMailV3, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end