Class: Mindee::V1::Product::FR::BankStatement::BankStatementV2Document
- Inherits:
-
Mindee::V1::Parsing::Common::Prediction
- Object
- Mindee::V1::Parsing::Common::Prediction
- Mindee::V1::Product::FR::BankStatement::BankStatementV2Document
- Includes:
- Mindee::V1::Parsing::Standard
- Defined in:
- lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb
Overview
Bank Statement API version 2.0 document data.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account_number ⇒ Mindee::V1::Parsing::Standard::StringField
readonly
The unique identifier for a customer’s account in the bank’s system.
-
#bank_address ⇒ Mindee::V1::Parsing::Standard::StringField
readonly
The physical location of the bank where the statement was issued.
-
#bank_name ⇒ Mindee::V1::Parsing::Standard::StringField
readonly
The name of the bank that issued the statement.
-
#client_address ⇒ Mindee::V1::Parsing::Standard::StringField
readonly
The address of the client associated with the bank statement.
-
#client_names ⇒ Array<Mindee::V1::Parsing::Standard::StringField>
readonly
The name of the clients who own the bank statement.
-
#closing_balance ⇒ Mindee::V1::Parsing::Standard::AmountField
readonly
The final amount of money in the account at the end of the statement period.
-
#opening_balance ⇒ Mindee::V1::Parsing::Standard::AmountField
readonly
The initial amount of money in an account at the start of the period.
-
#statement_date ⇒ Mindee::V1::Parsing::Standard::DateField
readonly
The date on which the bank statement was generated.
-
#statement_end_date ⇒ Mindee::V1::Parsing::Standard::DateField
readonly
The date when the statement period ends.
-
#statement_start_date ⇒ Mindee::V1::Parsing::Standard::DateField
readonly
The date when the bank statement period begins.
-
#total_credits ⇒ Mindee::V1::Parsing::Standard::AmountField
readonly
The total amount of money deposited into the account.
-
#total_debits ⇒ Mindee::V1::Parsing::Standard::AmountField
readonly
The total amount of money debited from the account.
-
#transactions ⇒ Mindee::V1::Product::FR::BankStatement::BankStatementV2Transactions
readonly
The list of values that represent the financial transactions recorded in a bank statement.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ BankStatementV2Document
constructor
A new instance of BankStatementV2Document.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ BankStatementV2Document
Returns a new instance of BankStatementV2Document.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 57 def initialize(prediction, page_id) super @account_number = Parsing::Standard::StringField.new( prediction['account_number'], page_id ) @bank_address = Parsing::Standard::StringField.new( prediction['bank_address'], page_id ) @bank_name = Parsing::Standard::StringField.new( prediction['bank_name'], page_id ) @client_address = Parsing::Standard::StringField.new( prediction['client_address'], page_id ) @client_names = [] # : Array[Parsing::Standard::StringField] prediction['client_names'].each do |item| @client_names.push(Parsing::Standard::StringField.new(item, page_id)) end @closing_balance = Parsing::Standard::AmountField.new( prediction['closing_balance'], page_id ) @opening_balance = Parsing::Standard::AmountField.new( prediction['opening_balance'], page_id ) @statement_date = Parsing::Standard::DateField.new( prediction['statement_date'], page_id ) @statement_end_date = Parsing::Standard::DateField.new( prediction['statement_end_date'], page_id ) @statement_start_date = Parsing::Standard::DateField.new( prediction['statement_start_date'], page_id ) @total_credits = Parsing::Standard::AmountField.new( prediction['total_credits'], page_id ) @total_debits = Parsing::Standard::AmountField.new( prediction['total_debits'], page_id ) @transactions = Product::FR::BankStatement::BankStatementV2Transactions.new( prediction['transactions'], page_id ) end |
Instance Attribute Details
#account_number ⇒ Mindee::V1::Parsing::Standard::StringField (readonly)
The unique identifier for a customer’s account in the bank’s system.
17 18 19 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 17 def account_number @account_number end |
#bank_address ⇒ Mindee::V1::Parsing::Standard::StringField (readonly)
The physical location of the bank where the statement was issued.
20 21 22 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 20 def bank_address @bank_address end |
#bank_name ⇒ Mindee::V1::Parsing::Standard::StringField (readonly)
The name of the bank that issued the statement.
23 24 25 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 23 def bank_name @bank_name end |
#client_address ⇒ Mindee::V1::Parsing::Standard::StringField (readonly)
The address of the client associated with the bank statement.
26 27 28 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 26 def client_address @client_address end |
#client_names ⇒ Array<Mindee::V1::Parsing::Standard::StringField> (readonly)
The name of the clients who own the bank statement.
29 30 31 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 29 def client_names @client_names end |
#closing_balance ⇒ Mindee::V1::Parsing::Standard::AmountField (readonly)
The final amount of money in the account at the end of the statement period.
32 33 34 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 32 def closing_balance @closing_balance end |
#opening_balance ⇒ Mindee::V1::Parsing::Standard::AmountField (readonly)
The initial amount of money in an account at the start of the period.
35 36 37 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 35 def opening_balance @opening_balance end |
#statement_date ⇒ Mindee::V1::Parsing::Standard::DateField (readonly)
The date on which the bank statement was generated.
38 39 40 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 38 def statement_date @statement_date end |
#statement_end_date ⇒ Mindee::V1::Parsing::Standard::DateField (readonly)
The date when the statement period ends.
41 42 43 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 41 def statement_end_date @statement_end_date end |
#statement_start_date ⇒ Mindee::V1::Parsing::Standard::DateField (readonly)
The date when the bank statement period begins.
44 45 46 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 44 def statement_start_date @statement_start_date end |
#total_credits ⇒ Mindee::V1::Parsing::Standard::AmountField (readonly)
The total amount of money deposited into the account.
47 48 49 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 47 def total_credits @total_credits end |
#total_debits ⇒ Mindee::V1::Parsing::Standard::AmountField (readonly)
The total amount of money debited from the account.
50 51 52 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 50 def total_debits @total_debits end |
#transactions ⇒ Mindee::V1::Product::FR::BankStatement::BankStatementV2Transactions (readonly)
The list of values that represent the financial transactions recorded in a bank statement.
53 54 55 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 53 def transactions @transactions end |
Instance Method Details
#to_s ⇒ String
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/mindee/v1/product/fr/bank_statement/bank_statement_v2_document.rb', line 113 def to_s client_names = @client_names.join("\n #{' ' * 14}") transactions = transactions_to_s out_str = String.new out_str << "\n:Account Number: #{@account_number}".rstrip out_str << "\n:Bank Name: #{@bank_name}".rstrip out_str << "\n:Bank Address: #{@bank_address}".rstrip out_str << "\n:Client Names: #{client_names}".rstrip out_str << "\n:Client Address: #{@client_address}".rstrip out_str << "\n:Statement Date: #{@statement_date}".rstrip out_str << "\n:Statement Start Date: #{@statement_start_date}".rstrip out_str << "\n:Statement End Date: #{@statement_end_date}".rstrip out_str << "\n:Opening Balance: #{@opening_balance}".rstrip out_str << "\n:Closing Balance: #{@closing_balance}".rstrip out_str << "\n:Transactions:" out_str << transactions out_str << "\n:Total Debits: #{@total_debits}".rstrip out_str << "\n:Total Credits: #{@total_credits}".rstrip out_str[1..].to_s end |