Class: AqumulateAPI::Transaction
- Defined in:
- lib/aqumulate_api/entities/transaction.rb
Constant Summary collapse
- ATTR_MAP =
{ id: 'TransactionId', account_id: 'AccountId', transaction_type: 'TransactionType', posted_date: 'PostedDate', origination_date: 'OriginationDate', amount: 'Amount', currency: 'CurCode', description: 'Description', code: 'TransactionCode', action: 'TransactionAction', date: 'TransactionDate', commision: 'Commission', ticker: 'Ticker', position_description: 'PosDescription', asset_id: 'AssetID', asset_type: 'AssetIDType', units: 'Units', price: 'Price', check_number: 'CheckNumber', created_on: 'CreatedOn' }
Constants inherited from Entity
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#action ⇒ Object
Returns the value of attribute action.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#asset_id ⇒ Object
Returns the value of attribute asset_id.
-
#asset_type ⇒ Object
Returns the value of attribute asset_type.
-
#check_number ⇒ Object
Returns the value of attribute check_number.
-
#code ⇒ Object
Returns the value of attribute code.
-
#commission ⇒ Object
Returns the value of attribute commission.
-
#created_on ⇒ Object
Returns the value of attribute created_on.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#date ⇒ Object
Returns the value of attribute date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#origination_date ⇒ Object
Returns the value of attribute origination_date.
-
#position_description ⇒ Object
Returns the value of attribute position_description.
-
#posted_date ⇒ Object
Returns the value of attribute posted_date.
-
#price ⇒ Object
Returns the value of attribute price.
-
#ticker ⇒ Object
Returns the value of attribute ticker.
-
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
-
#units ⇒ Object
Returns the value of attribute units.
Class Method Summary collapse
Methods inherited from Entity
Constructor Details
This class inherits a constructor from AqumulateAPI::Entity
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def account_id @account_id end |
#action ⇒ Object
Returns the value of attribute action.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def action @action end |
#amount ⇒ Object
Returns the value of attribute amount.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def amount @amount end |
#asset_id ⇒ Object
Returns the value of attribute asset_id.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def asset_id @asset_id end |
#asset_type ⇒ Object
Returns the value of attribute asset_type.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def asset_type @asset_type end |
#check_number ⇒ Object
Returns the value of attribute check_number.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def check_number @check_number end |
#code ⇒ Object
Returns the value of attribute code.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def code @code end |
#commission ⇒ Object
Returns the value of attribute commission.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def commission @commission end |
#created_on ⇒ Object
Returns the value of attribute created_on.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def created_on @created_on end |
#currency ⇒ Object
Returns the value of attribute currency.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def currency @currency end |
#date ⇒ Object
Returns the value of attribute date.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def date @date end |
#description ⇒ Object
Returns the value of attribute description.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def id @id end |
#origination_date ⇒ Object
Returns the value of attribute origination_date.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def origination_date @origination_date end |
#position_description ⇒ Object
Returns the value of attribute position_description.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def position_description @position_description end |
#posted_date ⇒ Object
Returns the value of attribute posted_date.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def posted_date @posted_date end |
#price ⇒ Object
Returns the value of attribute price.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def price @price end |
#ticker ⇒ Object
Returns the value of attribute ticker.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def ticker @ticker end |
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def transaction_type @transaction_type end |
#units ⇒ Object
Returns the value of attribute units.
27 28 29 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 27 def units @units end |
Class Method Details
.fetch(advisor, account, start_date, end_date) ⇒ Array(Transaction)
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/aqumulate_api/entities/transaction.rb', line 36 def self.fetch(advisor, account, start_date, end_date) body = { 'SessionId' => advisor.session_id, 'AccountId' => account.id, 'AccountType' => account.account_type, 'ExtendedAccountType' => account.account_type_extended, 'StartDate' => start_date.strftime('%m/%d/%Y'), 'EndDate' => end_date.strftime('%m/%d/%Y') } response = AggAccount.advisor_get_transactions_by_date(body) return [] unless response.has_key?('Transactions') response['Transactions'].map { |source| from_source(source) } end |