mindee 3.15.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/bin/mindee.rb +20 -2
  4. data/docs/business_card_v1.md +169 -0
  5. data/docs/code_samples/{international_id_v1_async.txt → business_card_v1_async.txt} +1 -1
  6. data/docs/code_samples/delivery_notes_v1_async.txt +19 -0
  7. data/docs/code_samples/driver_license_v1_async.txt +19 -0
  8. data/docs/code_samples/expense_receipts_v5_async.txt +19 -0
  9. data/docs/code_samples/french_healthcard_v1_async.txt +19 -0
  10. data/docs/code_samples/ind_passport_v1_async.txt +19 -0
  11. data/docs/code_samples/payslip_fra_v3_async.txt +19 -0
  12. data/docs/code_samples/workflow_execution.txt +29 -0
  13. data/docs/delivery_notes_v1.md +143 -0
  14. data/docs/driver_license_v1.md +156 -0
  15. data/docs/energy_bill_fra_v1.md +2 -2
  16. data/docs/expense_receipts_v5.md +27 -2
  17. data/docs/financial_document_v1.md +8 -4
  18. data/docs/{carte_vitale_v1.md → french_healthcard_v1.md} +14 -24
  19. data/docs/ind_passport_v1.md +281 -0
  20. data/docs/invoices_v4.md +12 -8
  21. data/docs/payslip_fra_v3.md +319 -0
  22. data/docs/resume_v1.md +17 -16
  23. data/lib/mindee/client.rb +48 -8
  24. data/lib/mindee/http/workflow_endpoint.rb +90 -0
  25. data/lib/mindee/http.rb +1 -0
  26. data/lib/mindee/parsing/common/api_response.rb +22 -1
  27. data/lib/mindee/parsing/common/execution.rb +73 -0
  28. data/lib/mindee/parsing/common/execution_file.rb +24 -0
  29. data/lib/mindee/parsing/common/execution_priority.rb +30 -0
  30. data/lib/mindee/parsing/common.rb +3 -0
  31. data/lib/mindee/product/{international_id/international_id_v1.rb → business_card/business_card_v1.rb} +9 -9
  32. data/lib/mindee/product/business_card/business_card_v1_document.rb +85 -0
  33. data/lib/mindee/product/{international_id/international_id_v1_page.rb → business_card/business_card_v1_page.rb} +7 -7
  34. data/lib/mindee/product/delivery_note/delivery_note_v1.rb +39 -0
  35. data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +61 -0
  36. data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +32 -0
  37. data/lib/mindee/product/driver_license/driver_license_v1.rb +39 -0
  38. data/lib/mindee/product/driver_license/driver_license_v1_document.rb +91 -0
  39. data/lib/mindee/product/driver_license/driver_license_v1_page.rb +32 -0
  40. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +1 -1
  41. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
  42. data/lib/mindee/product/fr/health_card/health_card_v1.rb +41 -0
  43. data/lib/mindee/product/fr/health_card/health_card_v1_document.rb +52 -0
  44. data/lib/mindee/product/fr/health_card/health_card_v1_page.rb +34 -0
  45. data/lib/mindee/product/fr/payslip/payslip_v3.rb +41 -0
  46. data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +54 -0
  47. data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +166 -0
  48. data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +78 -0
  49. data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +78 -0
  50. data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +78 -0
  51. data/lib/mindee/product/fr/payslip/payslip_v3_page.rb +34 -0
  52. data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +89 -0
  53. data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +100 -0
  54. data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +66 -0
  55. data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +89 -0
  56. data/lib/mindee/product/ind/indian_passport/indian_passport_v1.rb +41 -0
  57. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +143 -0
  58. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_page.rb +34 -0
  59. data/lib/mindee/product/invoice/invoice_v4_document.rb +1 -1
  60. data/lib/mindee/product/invoice/invoice_v4_page.rb +1 -1
  61. data/lib/mindee/product/resume/resume_v1_document.rb +3 -1
  62. data/lib/mindee/product/resume/resume_v1_page.rb +1 -1
  63. data/lib/mindee/product/resume/resume_v1_professional_experience.rb +8 -0
  64. data/lib/mindee/product.rb +13 -8
  65. data/lib/mindee/version.rb +1 -1
  66. metadata +46 -10
  67. data/docs/eu_driver_license_v1.md +0 -227
  68. data/docs/proof_of_address_v1.md +0 -211
  69. data/docs/us_driver_license_v1.md +0 -272
  70. data/lib/mindee/product/international_id/international_id_v1_document.rb +0 -109
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../parsing'
4
+
5
+ module Mindee
6
+ module Product
7
+ module FR
8
+ module Payslip
9
+ # Information about paid time off.
10
+ class PayslipV3PaidTimeOff < Mindee::Parsing::Standard::FeatureField
11
+ include Mindee::Parsing::Standard
12
+ # The amount of paid time off accrued in the period.
13
+ # @return [Float]
14
+ attr_reader :accrued
15
+ # The paid time off period.
16
+ # @return [String]
17
+ attr_reader :period
18
+ # The type of paid time off.
19
+ # @return [String]
20
+ attr_reader :pto_type
21
+ # The remaining amount of paid time off at the end of the period.
22
+ # @return [Float]
23
+ attr_reader :remaining
24
+ # The amount of paid time off used in the period.
25
+ # @return [Float]
26
+ attr_reader :used
27
+
28
+ # @param prediction [Hash]
29
+ # @param page_id [Integer, nil]
30
+ def initialize(prediction, page_id)
31
+ super(prediction, page_id)
32
+ @accrued = prediction['accrued']
33
+ @period = prediction['period']
34
+ @pto_type = prediction['pto_type']
35
+ @remaining = prediction['remaining']
36
+ @used = prediction['used']
37
+ @page_id = page_id
38
+ end
39
+
40
+ # @return [Hash]
41
+ def printable_values
42
+ printable = {}
43
+ printable[:accrued] = @accrued.nil? ? '' : Field.float_to_string(@accrued)
44
+ printable[:period] = format_for_display(@period)
45
+ printable[:pto_type] = format_for_display(@pto_type)
46
+ printable[:remaining] = @remaining.nil? ? '' : Field.float_to_string(@remaining)
47
+ printable[:used] = @used.nil? ? '' : Field.float_to_string(@used)
48
+ printable
49
+ end
50
+
51
+ # @return [Hash]
52
+ def table_printable_values
53
+ printable = {}
54
+ printable[:accrued] = @accrued.nil? ? '' : Field.float_to_string(@accrued)
55
+ printable[:period] = format_for_display(@period, 6)
56
+ printable[:pto_type] = format_for_display(@pto_type, 11)
57
+ printable[:remaining] = @remaining.nil? ? '' : Field.float_to_string(@remaining)
58
+ printable[:used] = @used.nil? ? '' : Field.float_to_string(@used)
59
+ printable
60
+ end
61
+
62
+ # @return [String]
63
+ def to_table_line
64
+ printable = table_printable_values
65
+ out_str = String.new
66
+ out_str << format('| %- 10s', printable[:accrued])
67
+ out_str << format('| %- 7s', printable[:period])
68
+ out_str << format('| %- 12s', printable[:pto_type])
69
+ out_str << format('| %- 10s', printable[:remaining])
70
+ out_str << format('| %- 10s', printable[:used])
71
+ out_str << '|'
72
+ end
73
+
74
+ # @return [String]
75
+ def to_s
76
+ printable = printable_values
77
+ out_str = String.new
78
+ out_str << "\n :Accrued: #{printable[:accrued]}"
79
+ out_str << "\n :Period: #{printable[:period]}"
80
+ out_str << "\n :Type: #{printable[:pto_type]}"
81
+ out_str << "\n :Remaining: #{printable[:remaining]}"
82
+ out_str << "\n :Used: #{printable[:used]}"
83
+ out_str
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../parsing'
4
+
5
+ module Mindee
6
+ module Product
7
+ module FR
8
+ module Payslip
9
+ # Detailed information about the pay.
10
+ class PayslipV3PayDetail < Mindee::Parsing::Standard::FeatureField
11
+ include Mindee::Parsing::Standard
12
+ # The gross salary of the employee.
13
+ # @return [Float]
14
+ attr_reader :gross_salary
15
+ # The year-to-date gross salary of the employee.
16
+ # @return [Float]
17
+ attr_reader :gross_salary_ytd
18
+ # The income tax rate of the employee.
19
+ # @return [Float]
20
+ attr_reader :income_tax_rate
21
+ # The income tax withheld from the employee's pay.
22
+ # @return [Float]
23
+ attr_reader :income_tax_withheld
24
+ # The net paid amount of the employee.
25
+ # @return [Float]
26
+ attr_reader :net_paid
27
+ # The net paid amount before tax of the employee.
28
+ # @return [Float]
29
+ attr_reader :net_paid_before_tax
30
+ # The net taxable amount of the employee.
31
+ # @return [Float]
32
+ attr_reader :net_taxable
33
+ # The year-to-date net taxable amount of the employee.
34
+ # @return [Float]
35
+ attr_reader :net_taxable_ytd
36
+ # The total cost to the employer.
37
+ # @return [Float]
38
+ attr_reader :total_cost_employer
39
+ # The total taxes and deductions of the employee.
40
+ # @return [Float]
41
+ attr_reader :total_taxes_and_deductions
42
+
43
+ # @param prediction [Hash]
44
+ # @param page_id [Integer, nil]
45
+ def initialize(prediction, page_id)
46
+ super(prediction, page_id)
47
+ @gross_salary = prediction['gross_salary']
48
+ @gross_salary_ytd = prediction['gross_salary_ytd']
49
+ @income_tax_rate = prediction['income_tax_rate']
50
+ @income_tax_withheld = prediction['income_tax_withheld']
51
+ @net_paid = prediction['net_paid']
52
+ @net_paid_before_tax = prediction['net_paid_before_tax']
53
+ @net_taxable = prediction['net_taxable']
54
+ @net_taxable_ytd = prediction['net_taxable_ytd']
55
+ @total_cost_employer = prediction['total_cost_employer']
56
+ @total_taxes_and_deductions = prediction['total_taxes_and_deductions']
57
+ @page_id = page_id
58
+ end
59
+
60
+ # @return [Hash]
61
+ def printable_values
62
+ printable = {}
63
+ printable[:gross_salary] = @gross_salary.nil? ? '' : Field.float_to_string(@gross_salary)
64
+ printable[:gross_salary_ytd] = @gross_salary_ytd.nil? ? '' : Field.float_to_string(@gross_salary_ytd)
65
+ printable[:income_tax_rate] = @income_tax_rate.nil? ? '' : Field.float_to_string(@income_tax_rate)
66
+ printable[:income_tax_withheld] =
67
+ @income_tax_withheld.nil? ? '' : Field.float_to_string(@income_tax_withheld)
68
+ printable[:net_paid] = @net_paid.nil? ? '' : Field.float_to_string(@net_paid)
69
+ printable[:net_paid_before_tax] =
70
+ @net_paid_before_tax.nil? ? '' : Field.float_to_string(@net_paid_before_tax)
71
+ printable[:net_taxable] = @net_taxable.nil? ? '' : Field.float_to_string(@net_taxable)
72
+ printable[:net_taxable_ytd] = @net_taxable_ytd.nil? ? '' : Field.float_to_string(@net_taxable_ytd)
73
+ printable[:total_cost_employer] =
74
+ @total_cost_employer.nil? ? '' : Field.float_to_string(@total_cost_employer)
75
+ printable[:total_taxes_and_deductions] =
76
+ @total_taxes_and_deductions.nil? ? '' : Field.float_to_string(@total_taxes_and_deductions)
77
+ printable
78
+ end
79
+
80
+ # @return [String]
81
+ def to_s
82
+ printable = printable_values
83
+ out_str = String.new
84
+ out_str << "\n :Gross Salary: #{printable[:gross_salary]}"
85
+ out_str << "\n :Gross Salary YTD: #{printable[:gross_salary_ytd]}"
86
+ out_str << "\n :Income Tax Rate: #{printable[:income_tax_rate]}"
87
+ out_str << "\n :Income Tax Withheld: #{printable[:income_tax_withheld]}"
88
+ out_str << "\n :Net Paid: #{printable[:net_paid]}"
89
+ out_str << "\n :Net Paid Before Tax: #{printable[:net_paid_before_tax]}"
90
+ out_str << "\n :Net Taxable: #{printable[:net_taxable]}"
91
+ out_str << "\n :Net Taxable YTD: #{printable[:net_taxable_ytd]}"
92
+ out_str << "\n :Total Cost Employer: #{printable[:total_cost_employer]}"
93
+ out_str << "\n :Total Taxes and Deductions: #{printable[:total_taxes_and_deductions]}"
94
+ out_str
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../parsing'
4
+
5
+ module Mindee
6
+ module Product
7
+ module FR
8
+ module Payslip
9
+ # Information about the pay period.
10
+ class PayslipV3PayPeriod < Mindee::Parsing::Standard::FeatureField
11
+ include Mindee::Parsing::Standard
12
+ # The end date of the pay period.
13
+ # @return [String]
14
+ attr_reader :end_date
15
+ # The month of the pay period.
16
+ # @return [String]
17
+ attr_reader :month
18
+ # The date of payment for the pay period.
19
+ # @return [String]
20
+ attr_reader :payment_date
21
+ # The start date of the pay period.
22
+ # @return [String]
23
+ attr_reader :start_date
24
+ # The year of the pay period.
25
+ # @return [String]
26
+ attr_reader :year
27
+
28
+ # @param prediction [Hash]
29
+ # @param page_id [Integer, nil]
30
+ def initialize(prediction, page_id)
31
+ super(prediction, page_id)
32
+ @end_date = prediction['end_date']
33
+ @month = prediction['month']
34
+ @payment_date = prediction['payment_date']
35
+ @start_date = prediction['start_date']
36
+ @year = prediction['year']
37
+ @page_id = page_id
38
+ end
39
+
40
+ # @return [Hash]
41
+ def printable_values
42
+ printable = {}
43
+ printable[:end_date] = format_for_display(@end_date)
44
+ printable[:month] = format_for_display(@month)
45
+ printable[:payment_date] = format_for_display(@payment_date)
46
+ printable[:start_date] = format_for_display(@start_date)
47
+ printable[:year] = format_for_display(@year)
48
+ printable
49
+ end
50
+
51
+ # @return [String]
52
+ def to_s
53
+ printable = printable_values
54
+ out_str = String.new
55
+ out_str << "\n :End Date: #{printable[:end_date]}"
56
+ out_str << "\n :Month: #{printable[:month]}"
57
+ out_str << "\n :Payment Date: #{printable[:payment_date]}"
58
+ out_str << "\n :Start Date: #{printable[:start_date]}"
59
+ out_str << "\n :Year: #{printable[:year]}"
60
+ out_str
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../parsing'
4
+
5
+ module Mindee
6
+ module Product
7
+ module FR
8
+ module Payslip
9
+ # Detailed information about the earnings.
10
+ class PayslipV3SalaryDetail < Mindee::Parsing::Standard::FeatureField
11
+ include Mindee::Parsing::Standard
12
+ # The amount of the earning.
13
+ # @return [Float]
14
+ attr_reader :amount
15
+ # The base rate value of the earning.
16
+ # @return [Float]
17
+ attr_reader :base
18
+ # The description of the earnings.
19
+ # @return [String]
20
+ attr_reader :description
21
+ # The number of units in the earning.
22
+ # @return [Float]
23
+ attr_reader :number
24
+ # The rate of the earning.
25
+ # @return [Float]
26
+ attr_reader :rate
27
+
28
+ # @param prediction [Hash]
29
+ # @param page_id [Integer, nil]
30
+ def initialize(prediction, page_id)
31
+ super(prediction, page_id)
32
+ @amount = prediction['amount']
33
+ @base = prediction['base']
34
+ @description = prediction['description']
35
+ @number = prediction['number']
36
+ @rate = prediction['rate']
37
+ @page_id = page_id
38
+ end
39
+
40
+ # @return [Hash]
41
+ def printable_values
42
+ printable = {}
43
+ printable[:amount] = @amount.nil? ? '' : Field.float_to_string(@amount)
44
+ printable[:base] = @base.nil? ? '' : Field.float_to_string(@base)
45
+ printable[:description] = format_for_display(@description)
46
+ printable[:number] = @number.nil? ? '' : Field.float_to_string(@number)
47
+ printable[:rate] = @rate.nil? ? '' : Field.float_to_string(@rate)
48
+ printable
49
+ end
50
+
51
+ # @return [Hash]
52
+ def table_printable_values
53
+ printable = {}
54
+ printable[:amount] = @amount.nil? ? '' : Field.float_to_string(@amount)
55
+ printable[:base] = @base.nil? ? '' : Field.float_to_string(@base)
56
+ printable[:description] = format_for_display(@description, 36)
57
+ printable[:number] = @number.nil? ? '' : Field.float_to_string(@number)
58
+ printable[:rate] = @rate.nil? ? '' : Field.float_to_string(@rate)
59
+ printable
60
+ end
61
+
62
+ # @return [String]
63
+ def to_table_line
64
+ printable = table_printable_values
65
+ out_str = String.new
66
+ out_str << format('| %- 13s', printable[:amount])
67
+ out_str << format('| %- 10s', printable[:base])
68
+ out_str << format('| %- 37s', printable[:description])
69
+ out_str << format('| %- 7s', printable[:number])
70
+ out_str << format('| %- 10s', printable[:rate])
71
+ out_str << '|'
72
+ end
73
+
74
+ # @return [String]
75
+ def to_s
76
+ printable = printable_values
77
+ out_str = String.new
78
+ out_str << "\n :Amount: #{printable[:amount]}"
79
+ out_str << "\n :Base: #{printable[:base]}"
80
+ out_str << "\n :Description: #{printable[:description]}"
81
+ out_str << "\n :Number: #{printable[:number]}"
82
+ out_str << "\n :Rate: #{printable[:rate]}"
83
+ out_str
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../parsing'
4
+ require_relative 'indian_passport_v1_document'
5
+ require_relative 'indian_passport_v1_page'
6
+
7
+ module Mindee
8
+ module Product
9
+ module IND
10
+ # Passport - India module.
11
+ module IndianPassport
12
+ # Passport - India API version 1 inference prediction.
13
+ class IndianPassportV1 < Mindee::Parsing::Common::Inference
14
+ @endpoint_name = 'ind_passport'
15
+ @endpoint_version = '1'
16
+
17
+ # @param prediction [Hash]
18
+ def initialize(prediction)
19
+ super
20
+ @prediction = IndianPassportV1Document.new(prediction['prediction'], nil)
21
+ @pages = []
22
+ prediction['pages'].each do |page|
23
+ if page.key?('prediction') && !page['prediction'].nil? && !page['prediction'].empty?
24
+ @pages.push(IndianPassportV1Page.new(page))
25
+ end
26
+ end
27
+ end
28
+
29
+ class << self
30
+ # Name of the endpoint for this product.
31
+ # @return [String]
32
+ attr_reader :endpoint_name
33
+ # Version for this product.
34
+ # @return [String]
35
+ attr_reader :endpoint_version
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,143 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../parsing'
4
+
5
+ module Mindee
6
+ module Product
7
+ module IND
8
+ module IndianPassport
9
+ # Passport - India API version 1.0 document data.
10
+ class IndianPassportV1Document < Mindee::Parsing::Common::Prediction
11
+ include Mindee::Parsing::Standard
12
+ # The first line of the address of the passport holder.
13
+ # @return [Mindee::Parsing::Standard::StringField]
14
+ attr_reader :address1
15
+ # The second line of the address of the passport holder.
16
+ # @return [Mindee::Parsing::Standard::StringField]
17
+ attr_reader :address2
18
+ # The third line of the address of the passport holder.
19
+ # @return [Mindee::Parsing::Standard::StringField]
20
+ attr_reader :address3
21
+ # The birth date of the passport holder, ISO format: YYYY-MM-DD.
22
+ # @return [Mindee::Parsing::Standard::DateField]
23
+ attr_reader :birth_date
24
+ # The birth place of the passport holder.
25
+ # @return [Mindee::Parsing::Standard::StringField]
26
+ attr_reader :birth_place
27
+ # ISO 3166-1 alpha-3 country code (3 letters format).
28
+ # @return [Mindee::Parsing::Standard::StringField]
29
+ attr_reader :country
30
+ # The date when the passport will expire, ISO format: YYYY-MM-DD.
31
+ # @return [Mindee::Parsing::Standard::DateField]
32
+ attr_reader :expiry_date
33
+ # The file number of the passport document.
34
+ # @return [Mindee::Parsing::Standard::StringField]
35
+ attr_reader :file_number
36
+ # The gender of the passport holder.
37
+ # @return [Mindee::Parsing::Standard::ClassificationField]
38
+ attr_reader :gender
39
+ # The given names of the passport holder.
40
+ # @return [Mindee::Parsing::Standard::StringField]
41
+ attr_reader :given_names
42
+ # The identification number of the passport document.
43
+ # @return [Mindee::Parsing::Standard::StringField]
44
+ attr_reader :id_number
45
+ # The date when the passport was issued, ISO format: YYYY-MM-DD.
46
+ # @return [Mindee::Parsing::Standard::DateField]
47
+ attr_reader :issuance_date
48
+ # The place where the passport was issued.
49
+ # @return [Mindee::Parsing::Standard::StringField]
50
+ attr_reader :issuance_place
51
+ # The name of the legal guardian of the passport holder (if applicable).
52
+ # @return [Mindee::Parsing::Standard::StringField]
53
+ attr_reader :legal_guardian
54
+ # The first line of the machine-readable zone (MRZ) of the passport document.
55
+ # @return [Mindee::Parsing::Standard::StringField]
56
+ attr_reader :mrz1
57
+ # The second line of the machine-readable zone (MRZ) of the passport document.
58
+ # @return [Mindee::Parsing::Standard::StringField]
59
+ attr_reader :mrz2
60
+ # The name of the mother of the passport holder.
61
+ # @return [Mindee::Parsing::Standard::StringField]
62
+ attr_reader :name_of_mother
63
+ # The name of the spouse of the passport holder (if applicable).
64
+ # @return [Mindee::Parsing::Standard::StringField]
65
+ attr_reader :name_of_spouse
66
+ # The date of issue of the old passport (if applicable), ISO format: YYYY-MM-DD.
67
+ # @return [Mindee::Parsing::Standard::DateField]
68
+ attr_reader :old_passport_date_of_issue
69
+ # The number of the old passport (if applicable).
70
+ # @return [Mindee::Parsing::Standard::StringField]
71
+ attr_reader :old_passport_number
72
+ # The place of issue of the old passport (if applicable).
73
+ # @return [Mindee::Parsing::Standard::StringField]
74
+ attr_reader :old_passport_place_of_issue
75
+ # The page number of the passport document.
76
+ # @return [Mindee::Parsing::Standard::ClassificationField]
77
+ attr_reader :page_number
78
+ # The surname of the passport holder.
79
+ # @return [Mindee::Parsing::Standard::StringField]
80
+ attr_reader :surname
81
+
82
+ # @param prediction [Hash]
83
+ # @param page_id [Integer, nil]
84
+ def initialize(prediction, page_id)
85
+ super()
86
+ @address1 = StringField.new(prediction['address1'], page_id)
87
+ @address2 = StringField.new(prediction['address2'], page_id)
88
+ @address3 = StringField.new(prediction['address3'], page_id)
89
+ @birth_date = DateField.new(prediction['birth_date'], page_id)
90
+ @birth_place = StringField.new(prediction['birth_place'], page_id)
91
+ @country = StringField.new(prediction['country'], page_id)
92
+ @expiry_date = DateField.new(prediction['expiry_date'], page_id)
93
+ @file_number = StringField.new(prediction['file_number'], page_id)
94
+ @gender = ClassificationField.new(prediction['gender'], page_id)
95
+ @given_names = StringField.new(prediction['given_names'], page_id)
96
+ @id_number = StringField.new(prediction['id_number'], page_id)
97
+ @issuance_date = DateField.new(prediction['issuance_date'], page_id)
98
+ @issuance_place = StringField.new(prediction['issuance_place'], page_id)
99
+ @legal_guardian = StringField.new(prediction['legal_guardian'], page_id)
100
+ @mrz1 = StringField.new(prediction['mrz1'], page_id)
101
+ @mrz2 = StringField.new(prediction['mrz2'], page_id)
102
+ @name_of_mother = StringField.new(prediction['name_of_mother'], page_id)
103
+ @name_of_spouse = StringField.new(prediction['name_of_spouse'], page_id)
104
+ @old_passport_date_of_issue = DateField.new(prediction['old_passport_date_of_issue'], page_id)
105
+ @old_passport_number = StringField.new(prediction['old_passport_number'], page_id)
106
+ @old_passport_place_of_issue = StringField.new(prediction['old_passport_place_of_issue'], page_id)
107
+ @page_number = ClassificationField.new(prediction['page_number'], page_id)
108
+ @surname = StringField.new(prediction['surname'], page_id)
109
+ end
110
+
111
+ # @return [String]
112
+ def to_s
113
+ out_str = String.new
114
+ out_str << "\n:Page Number: #{@page_number}".rstrip
115
+ out_str << "\n:Country: #{@country}".rstrip
116
+ out_str << "\n:ID Number: #{@id_number}".rstrip
117
+ out_str << "\n:Given Names: #{@given_names}".rstrip
118
+ out_str << "\n:Surname: #{@surname}".rstrip
119
+ out_str << "\n:Birth Date: #{@birth_date}".rstrip
120
+ out_str << "\n:Birth Place: #{@birth_place}".rstrip
121
+ out_str << "\n:Issuance Place: #{@issuance_place}".rstrip
122
+ out_str << "\n:Gender: #{@gender}".rstrip
123
+ out_str << "\n:Issuance Date: #{@issuance_date}".rstrip
124
+ out_str << "\n:Expiry Date: #{@expiry_date}".rstrip
125
+ out_str << "\n:MRZ Line 1: #{@mrz1}".rstrip
126
+ out_str << "\n:MRZ Line 2: #{@mrz2}".rstrip
127
+ out_str << "\n:Legal Guardian: #{@legal_guardian}".rstrip
128
+ out_str << "\n:Name of Spouse: #{@name_of_spouse}".rstrip
129
+ out_str << "\n:Name of Mother: #{@name_of_mother}".rstrip
130
+ out_str << "\n:Old Passport Date of Issue: #{@old_passport_date_of_issue}".rstrip
131
+ out_str << "\n:Old Passport Number: #{@old_passport_number}".rstrip
132
+ out_str << "\n:Address Line 1: #{@address1}".rstrip
133
+ out_str << "\n:Address Line 2: #{@address2}".rstrip
134
+ out_str << "\n:Address Line 3: #{@address3}".rstrip
135
+ out_str << "\n:Old Passport Place of Issue: #{@old_passport_place_of_issue}".rstrip
136
+ out_str << "\n:File Number: #{@file_number}".rstrip
137
+ out_str[1..].to_s
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../parsing'
4
+ require_relative 'indian_passport_v1_document'
5
+
6
+ module Mindee
7
+ module Product
8
+ module IND
9
+ module IndianPassport
10
+ # Passport - India API version 1.0 page data.
11
+ class IndianPassportV1Page < Mindee::Parsing::Common::Page
12
+ # @param prediction [Hash]
13
+ def initialize(prediction)
14
+ super(prediction)
15
+ @prediction = IndianPassportV1PagePrediction.new(
16
+ prediction['prediction'],
17
+ prediction['id']
18
+ )
19
+ end
20
+ end
21
+
22
+ # Passport - India V1 page prediction.
23
+ class IndianPassportV1PagePrediction < IndianPassportV1Document
24
+ # @return [String]
25
+ def to_s
26
+ out_str = String.new
27
+ out_str << "\n#{super}"
28
+ out_str
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -6,7 +6,7 @@ require_relative 'invoice_v4_line_item'
6
6
  module Mindee
7
7
  module Product
8
8
  module Invoice
9
- # Invoice API version 4.8 document data.
9
+ # Invoice API version 4.9 document data.
10
10
  class InvoiceV4Document < Mindee::Parsing::Common::Prediction
11
11
  include Mindee::Parsing::Standard
12
12
  # The customer's address used for billing.
@@ -6,7 +6,7 @@ require_relative 'invoice_v4_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module Invoice
9
- # Invoice API version 4.8 page data.
9
+ # Invoice API version 4.9 page data.
10
10
  class InvoiceV4Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -10,7 +10,7 @@ require_relative 'resume_v1_certificate'
10
10
  module Mindee
11
11
  module Product
12
12
  module Resume
13
- # Resume API version 1.0 document data.
13
+ # Resume API version 1.2 document data.
14
14
  class ResumeV1Document < Mindee::Parsing::Common::Prediction
15
15
  include Mindee::Parsing::Standard
16
16
  # The location information of the candidate, including city, state, and country.
@@ -252,6 +252,7 @@ module Mindee
252
252
  out_str << ' '
253
253
  out_str << "+#{char * 17}"
254
254
  out_str << "+#{char * 12}"
255
+ out_str << "+#{char * 38}"
255
256
  out_str << "+#{char * 27}"
256
257
  out_str << "+#{char * 11}"
257
258
  out_str << "+#{char * 10}"
@@ -274,6 +275,7 @@ module Mindee
274
275
  out_str << "\n |"
275
276
  out_str << ' Contract Type |'
276
277
  out_str << ' Department |'
278
+ out_str << ' Description |'
277
279
  out_str << ' Employer |'
278
280
  out_str << ' End Month |'
279
281
  out_str << ' End Year |'
@@ -6,7 +6,7 @@ require_relative 'resume_v1_document'
6
6
  module Mindee
7
7
  module Product
8
8
  module Resume
9
- # Resume API version 1.0 page data.
9
+ # Resume API version 1.2 page data.
10
10
  class ResumeV1Page < Mindee::Parsing::Common::Page
11
11
  # @param prediction [Hash]
12
12
  def initialize(prediction)
@@ -14,6 +14,9 @@ module Mindee
14
14
  # The specific department or division within the company.
15
15
  # @return [String]
16
16
  attr_reader :department
17
+ # The description of the professional experience as written in the document.
18
+ # @return [String]
19
+ attr_reader :description
17
20
  # The name of the company or organization.
18
21
  # @return [String]
19
22
  attr_reader :employer
@@ -39,6 +42,7 @@ module Mindee
39
42
  super(prediction, page_id)
40
43
  @contract_type = prediction['contract_type']
41
44
  @department = prediction['department']
45
+ @description = prediction['description']
42
46
  @employer = prediction['employer']
43
47
  @end_month = prediction['end_month']
44
48
  @end_year = prediction['end_year']
@@ -53,6 +57,7 @@ module Mindee
53
57
  printable = {}
54
58
  printable[:contract_type] = format_for_display(@contract_type)
55
59
  printable[:department] = format_for_display(@department)
60
+ printable[:description] = format_for_display(@description)
56
61
  printable[:employer] = format_for_display(@employer)
57
62
  printable[:end_month] = format_for_display(@end_month)
58
63
  printable[:end_year] = format_for_display(@end_year)
@@ -67,6 +72,7 @@ module Mindee
67
72
  printable = {}
68
73
  printable[:contract_type] = format_for_display(@contract_type, 15)
69
74
  printable[:department] = format_for_display(@department, 10)
75
+ printable[:description] = format_for_display(@description, 36)
70
76
  printable[:employer] = format_for_display(@employer, 25)
71
77
  printable[:end_month] = format_for_display(@end_month, nil)
72
78
  printable[:end_year] = format_for_display(@end_year, nil)
@@ -82,6 +88,7 @@ module Mindee
82
88
  out_str = String.new
83
89
  out_str << format('| %- 16s', printable[:contract_type])
84
90
  out_str << format('| %- 11s', printable[:department])
91
+ out_str << format('| %- 37s', printable[:description])
85
92
  out_str << format('| %- 26s', printable[:employer])
86
93
  out_str << format('| %- 10s', printable[:end_month])
87
94
  out_str << format('| %- 9s', printable[:end_year])
@@ -97,6 +104,7 @@ module Mindee
97
104
  out_str = String.new
98
105
  out_str << "\n :Contract Type: #{printable[:contract_type]}"
99
106
  out_str << "\n :Department: #{printable[:department]}"
107
+ out_str << "\n :Description: #{printable[:description]}"
100
108
  out_str << "\n :Employer: #{printable[:employer]}"
101
109
  out_str << "\n :End Month: #{printable[:end_month]}"
102
110
  out_str << "\n :End Year: #{printable[:end_year]}"