mindee 3.16.0 → 3.18.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +4 -4
- data/bin/mindee.rb +20 -8
- data/docs/code_samples/{international_id_v1_async.txt → driver_license_v1_async.txt} +1 -1
- data/docs/code_samples/french_healthcard_v1_async.txt +19 -0
- data/docs/code_samples/{carte_vitale_v1.txt → payslip_fra_v3_async.txt} +2 -2
- data/docs/code_samples/workflow_execution.txt +29 -0
- data/docs/custom_v1.md +1 -1
- data/docs/driver_license_v1.md +156 -0
- data/docs/{carte_vitale_v1.md → french_healthcard_v1.md} +14 -24
- data/docs/getting_started.md +5 -5
- data/docs/payslip_fra_v3.md +319 -0
- data/lib/mindee/client.rb +40 -0
- data/lib/mindee/extraction/tax_extractor/tax_extractor.rb +34 -19
- data/lib/mindee/http/workflow_endpoint.rb +90 -0
- data/lib/mindee/http.rb +1 -0
- data/lib/mindee/input/sources/base64_input_source.rb +31 -0
- data/lib/mindee/input/sources/bytes_input_source.rb +21 -0
- data/lib/mindee/input/sources/file_input_source.rb +20 -0
- data/lib/mindee/input/sources/local_input_source.rb +183 -0
- data/lib/mindee/input/sources/path_input_source.rb +20 -0
- data/lib/mindee/input/sources/url_input_source.rb +127 -0
- data/lib/mindee/input/sources.rb +6 -248
- data/lib/mindee/parsing/common/api_response.rb +22 -1
- data/lib/mindee/parsing/common/execution.rb +73 -0
- data/lib/mindee/parsing/common/execution_file.rb +24 -0
- data/lib/mindee/parsing/common/execution_priority.rb +30 -0
- data/lib/mindee/parsing/common.rb +3 -0
- data/lib/mindee/product/{international_id/international_id_v1.rb → driver_license/driver_license_v1.rb} +9 -9
- data/lib/mindee/product/driver_license/driver_license_v1_document.rb +91 -0
- data/lib/mindee/product/{international_id/international_id_v1_page.rb → driver_license/driver_license_v1_page.rb} +7 -7
- data/lib/mindee/product/fr/{carte_vitale/carte_vitale_v1.rb → health_card/health_card_v1.rb} +9 -9
- data/lib/mindee/product/fr/{carte_vitale/carte_vitale_v1_document.rb → health_card/health_card_v1_document.rb} +6 -6
- data/lib/mindee/product/fr/{carte_vitale/carte_vitale_v1_page.rb → health_card/health_card_v1_page.rb} +7 -7
- data/lib/mindee/product/fr/payslip/payslip_v3.rb +41 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +54 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +166 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_page.rb +34 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +89 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +100 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +66 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +89 -0
- data/lib/mindee/product/resume/resume_v1_document.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_page.rb +1 -1
- data/lib/mindee/product.rb +3 -2
- data/lib/mindee/version.rb +1 -1
- metadata +36 -14
- data/docs/eu_driver_license_v1.md +0 -227
- data/docs/proof_of_address_v1.md +0 -211
- data/docs/us_driver_license_v1.md +0 -272
- data/lib/mindee/product/international_id/international_id_v1_document.rb +0 -109
@@ -0,0 +1,78 @@
|
|
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 employer.
|
10
|
+
class PayslipV3Employer < Mindee::Parsing::Standard::FeatureField
|
11
|
+
include Mindee::Parsing::Standard
|
12
|
+
# The address of the employer.
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :address
|
15
|
+
# The company ID of the employer.
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :company_id
|
18
|
+
# The site of the company.
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :company_site
|
21
|
+
# The NAF code of the employer.
|
22
|
+
# @return [String]
|
23
|
+
attr_reader :naf_code
|
24
|
+
# The name of the employer.
|
25
|
+
# @return [String]
|
26
|
+
attr_reader :name
|
27
|
+
# The phone number of the employer.
|
28
|
+
# @return [String]
|
29
|
+
attr_reader :phone_number
|
30
|
+
# The URSSAF number of the employer.
|
31
|
+
# @return [String]
|
32
|
+
attr_reader :urssaf_number
|
33
|
+
|
34
|
+
# @param prediction [Hash]
|
35
|
+
# @param page_id [Integer, nil]
|
36
|
+
def initialize(prediction, page_id)
|
37
|
+
super(prediction, page_id)
|
38
|
+
@address = prediction['address']
|
39
|
+
@company_id = prediction['company_id']
|
40
|
+
@company_site = prediction['company_site']
|
41
|
+
@naf_code = prediction['naf_code']
|
42
|
+
@name = prediction['name']
|
43
|
+
@phone_number = prediction['phone_number']
|
44
|
+
@urssaf_number = prediction['urssaf_number']
|
45
|
+
@page_id = page_id
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [Hash]
|
49
|
+
def printable_values
|
50
|
+
printable = {}
|
51
|
+
printable[:address] = format_for_display(@address)
|
52
|
+
printable[:company_id] = format_for_display(@company_id)
|
53
|
+
printable[:company_site] = format_for_display(@company_site)
|
54
|
+
printable[:naf_code] = format_for_display(@naf_code)
|
55
|
+
printable[:name] = format_for_display(@name)
|
56
|
+
printable[:phone_number] = format_for_display(@phone_number)
|
57
|
+
printable[:urssaf_number] = format_for_display(@urssaf_number)
|
58
|
+
printable
|
59
|
+
end
|
60
|
+
|
61
|
+
# @return [String]
|
62
|
+
def to_s
|
63
|
+
printable = printable_values
|
64
|
+
out_str = String.new
|
65
|
+
out_str << "\n :Address: #{printable[:address]}"
|
66
|
+
out_str << "\n :Company ID: #{printable[:company_id]}"
|
67
|
+
out_str << "\n :Company Site: #{printable[:company_site]}"
|
68
|
+
out_str << "\n :NAF Code: #{printable[:naf_code]}"
|
69
|
+
out_str << "\n :Name: #{printable[:name]}"
|
70
|
+
out_str << "\n :Phone Number: #{printable[:phone_number]}"
|
71
|
+
out_str << "\n :URSSAF Number: #{printable[:urssaf_number]}"
|
72
|
+
out_str
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,78 @@
|
|
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 employment.
|
10
|
+
class PayslipV3Employment < Mindee::Parsing::Standard::FeatureField
|
11
|
+
include Mindee::Parsing::Standard
|
12
|
+
# The category of the employment.
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :category
|
15
|
+
# The coefficient of the employment.
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :coefficient
|
18
|
+
# The collective agreement of the employment.
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :collective_agreement
|
21
|
+
# The job title of the employee.
|
22
|
+
# @return [String]
|
23
|
+
attr_reader :job_title
|
24
|
+
# The position level of the employment.
|
25
|
+
# @return [String]
|
26
|
+
attr_reader :position_level
|
27
|
+
# The seniority date of the employment.
|
28
|
+
# @return [String]
|
29
|
+
attr_reader :seniority_date
|
30
|
+
# The start date of the employment.
|
31
|
+
# @return [String]
|
32
|
+
attr_reader :start_date
|
33
|
+
|
34
|
+
# @param prediction [Hash]
|
35
|
+
# @param page_id [Integer, nil]
|
36
|
+
def initialize(prediction, page_id)
|
37
|
+
super(prediction, page_id)
|
38
|
+
@category = prediction['category']
|
39
|
+
@coefficient = prediction['coefficient']
|
40
|
+
@collective_agreement = prediction['collective_agreement']
|
41
|
+
@job_title = prediction['job_title']
|
42
|
+
@position_level = prediction['position_level']
|
43
|
+
@seniority_date = prediction['seniority_date']
|
44
|
+
@start_date = prediction['start_date']
|
45
|
+
@page_id = page_id
|
46
|
+
end
|
47
|
+
|
48
|
+
# @return [Hash]
|
49
|
+
def printable_values
|
50
|
+
printable = {}
|
51
|
+
printable[:category] = format_for_display(@category)
|
52
|
+
printable[:coefficient] = format_for_display(@coefficient)
|
53
|
+
printable[:collective_agreement] = format_for_display(@collective_agreement)
|
54
|
+
printable[:job_title] = format_for_display(@job_title)
|
55
|
+
printable[:position_level] = format_for_display(@position_level)
|
56
|
+
printable[:seniority_date] = format_for_display(@seniority_date)
|
57
|
+
printable[:start_date] = format_for_display(@start_date)
|
58
|
+
printable
|
59
|
+
end
|
60
|
+
|
61
|
+
# @return [String]
|
62
|
+
def to_s
|
63
|
+
printable = printable_values
|
64
|
+
out_str = String.new
|
65
|
+
out_str << "\n :Category: #{printable[:category]}"
|
66
|
+
out_str << "\n :Coefficient: #{printable[:coefficient]}"
|
67
|
+
out_str << "\n :Collective Agreement: #{printable[:collective_agreement]}"
|
68
|
+
out_str << "\n :Job Title: #{printable[:job_title]}"
|
69
|
+
out_str << "\n :Position Level: #{printable[:position_level]}"
|
70
|
+
out_str << "\n :Seniority Date: #{printable[:seniority_date]}"
|
71
|
+
out_str << "\n :Start Date: #{printable[:start_date]}"
|
72
|
+
out_str
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../../parsing'
|
4
|
+
require_relative 'payslip_v3_document'
|
5
|
+
|
6
|
+
module Mindee
|
7
|
+
module Product
|
8
|
+
module FR
|
9
|
+
module Payslip
|
10
|
+
# Payslip API version 3.0 page data.
|
11
|
+
class PayslipV3Page < Mindee::Parsing::Common::Page
|
12
|
+
# @param prediction [Hash]
|
13
|
+
def initialize(prediction)
|
14
|
+
super(prediction)
|
15
|
+
@prediction = PayslipV3PagePrediction.new(
|
16
|
+
prediction['prediction'],
|
17
|
+
prediction['id']
|
18
|
+
)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Payslip V3 page prediction.
|
23
|
+
class PayslipV3PagePrediction < PayslipV3Document
|
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
|
@@ -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
|
@@ -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.
|
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.
|
@@ -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.
|
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)
|
data/lib/mindee/product.rb
CHANGED
@@ -6,23 +6,24 @@ require_relative 'product/business_card/business_card_v1'
|
|
6
6
|
require_relative 'product/custom/custom_v1'
|
7
7
|
require_relative 'product/cropper/cropper_v1'
|
8
8
|
require_relative 'product/delivery_note/delivery_note_v1'
|
9
|
+
require_relative 'product/driver_license/driver_license_v1'
|
9
10
|
require_relative 'product/eu/license_plate/license_plate_v1'
|
10
11
|
require_relative 'product/eu/driver_license/driver_license_v1'
|
11
12
|
require_relative 'product/fr/bank_account_details/bank_account_details_v1'
|
12
13
|
require_relative 'product/fr/bank_account_details/bank_account_details_v2'
|
13
14
|
require_relative 'product/fr/bank_statement/bank_statement_v1'
|
14
15
|
require_relative 'product/fr/carte_grise/carte_grise_v1'
|
15
|
-
require_relative 'product/fr/carte_vitale/carte_vitale_v1'
|
16
16
|
require_relative 'product/fr/id_card/id_card_v1'
|
17
17
|
require_relative 'product/fr/id_card/id_card_v2'
|
18
18
|
require_relative 'product/fr/energy_bill/energy_bill_v1'
|
19
|
+
require_relative 'product/fr/health_card/health_card_v1'
|
19
20
|
require_relative 'product/fr/payslip/payslip_v2'
|
21
|
+
require_relative 'product/fr/payslip/payslip_v3'
|
20
22
|
require_relative 'product/financial_document/financial_document_v1'
|
21
23
|
require_relative 'product/generated/generated_v1'
|
22
24
|
require_relative 'product/ind/indian_passport/indian_passport_v1'
|
23
25
|
require_relative 'product/invoice/invoice_v4'
|
24
26
|
require_relative 'product/invoice_splitter/invoice_splitter_v1'
|
25
|
-
require_relative 'product/international_id/international_id_v1'
|
26
27
|
require_relative 'product/international_id/international_id_v2'
|
27
28
|
require_relative 'product/multi_receipts_detector/multi_receipts_detector_v1'
|
28
29
|
require_relative 'product/nutrition_facts_label/nutrition_facts_label_v1'
|