Class: Mindee::Product::FR::BankStatement::BankStatementV1Document
- Inherits:
-
Mindee::Parsing::Common::Prediction
- Object
- Mindee::Parsing::Common::Prediction
- Mindee::Product::FR::BankStatement::BankStatementV1Document
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb
Overview
Bank Statement (FR) V1 document prediction.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account_number ⇒ Mindee::Parsing::Standard::StringField
readonly
The unique identifier for a customer's account in the bank's system.
-
#bank_address ⇒ Mindee::Parsing::Standard::StringField
readonly
The physical location of the bank where the statement was issued.
-
#bank_name ⇒ Mindee::Parsing::Standard::StringField
readonly
The name of the bank that issued the statement.
-
#client_address ⇒ Mindee::Parsing::Standard::StringField
readonly
The address of the client associated with the bank statement.
-
#client_name ⇒ Mindee::Parsing::Standard::StringField
readonly
The name of the client who owns the bank statement.
-
#closing_balance ⇒ Mindee::Parsing::Standard::AmountField
readonly
The final amount of money in the account at the end of the statement period.
-
#opening_balance ⇒ Mindee::Parsing::Standard::AmountField
readonly
The initial amount of money in an account at the start of the period.
-
#statement_date ⇒ Mindee::Parsing::Standard::DateField
readonly
The date on which the bank statement was generated.
-
#statement_end_date ⇒ Mindee::Parsing::Standard::DateField
readonly
The date when the statement period ends.
-
#statement_start_date ⇒ Mindee::Parsing::Standard::DateField
readonly
The date when the bank statement period begins.
-
#total_credits ⇒ Mindee::Parsing::Standard::AmountField
readonly
The total amount of money deposited into the account.
-
#total_debits ⇒ Mindee::Parsing::Standard::AmountField
readonly
The total amount of money debited from the account.
-
#transactions ⇒ Array<Mindee::Product::FR::BankStatement::BankStatementV1Transaction>
readonly
The list of values that represent the financial transactions recorded in a bank statement.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ BankStatementV1Document
constructor
A new instance of BankStatementV1Document.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ BankStatementV1Document
Returns a new instance of BankStatementV1Document.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 55 def initialize(prediction, page_id) super() @account_number = StringField.new(prediction['account_number'], page_id) @bank_address = StringField.new(prediction['bank_address'], page_id) @bank_name = StringField.new(prediction['bank_name'], page_id) @client_address = StringField.new(prediction['client_address'], page_id) @client_name = StringField.new(prediction['client_name'], page_id) @closing_balance = AmountField.new(prediction['closing_balance'], page_id) @opening_balance = AmountField.new(prediction['opening_balance'], page_id) @statement_date = DateField.new(prediction['statement_date'], page_id) @statement_end_date = DateField.new(prediction['statement_end_date'], page_id) @statement_start_date = DateField.new(prediction['statement_start_date'], page_id) @total_credits = AmountField.new(prediction['total_credits'], page_id) @total_debits = AmountField.new(prediction['total_debits'], page_id) @transactions = [] prediction['transactions'].each do |item| @transactions.push(BankStatementV1Transaction.new(item, page_id)) end end |
Instance Attribute Details
#account_number ⇒ Mindee::Parsing::Standard::StringField (readonly)
The unique identifier for a customer's account in the bank's system.
15 16 17 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 15 def account_number @account_number end |
#bank_address ⇒ Mindee::Parsing::Standard::StringField (readonly)
The physical location of the bank where the statement was issued.
18 19 20 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 18 def bank_address @bank_address end |
#bank_name ⇒ Mindee::Parsing::Standard::StringField (readonly)
The name of the bank that issued the statement.
21 22 23 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 21 def bank_name @bank_name end |
#client_address ⇒ Mindee::Parsing::Standard::StringField (readonly)
The address of the client associated with the bank statement.
24 25 26 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 24 def client_address @client_address end |
#client_name ⇒ Mindee::Parsing::Standard::StringField (readonly)
The name of the client who owns the bank statement.
27 28 29 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 27 def client_name @client_name end |
#closing_balance ⇒ Mindee::Parsing::Standard::AmountField (readonly)
The final amount of money in the account at the end of the statement period.
30 31 32 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 30 def closing_balance @closing_balance end |
#opening_balance ⇒ Mindee::Parsing::Standard::AmountField (readonly)
The initial amount of money in an account at the start of the period.
33 34 35 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 33 def opening_balance @opening_balance end |
#statement_date ⇒ Mindee::Parsing::Standard::DateField (readonly)
The date on which the bank statement was generated.
36 37 38 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 36 def statement_date @statement_date end |
#statement_end_date ⇒ Mindee::Parsing::Standard::DateField (readonly)
The date when the statement period ends.
39 40 41 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 39 def statement_end_date @statement_end_date end |
#statement_start_date ⇒ Mindee::Parsing::Standard::DateField (readonly)
The date when the bank statement period begins.
42 43 44 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 42 def statement_start_date @statement_start_date end |
#total_credits ⇒ Mindee::Parsing::Standard::AmountField (readonly)
The total amount of money deposited into the account.
45 46 47 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 45 def total_credits @total_credits end |
#total_debits ⇒ Mindee::Parsing::Standard::AmountField (readonly)
The total amount of money debited from the account.
48 49 50 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 48 def total_debits @total_debits end |
#transactions ⇒ Array<Mindee::Product::FR::BankStatement::BankStatementV1Transaction> (readonly)
The list of values that represent the financial transactions recorded in a bank statement.
51 52 53 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 51 def transactions @transactions end |
Instance Method Details
#to_s ⇒ String
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb', line 76 def to_s 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 Name: #{@client_name}".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 |