=begin #SnapTrade #Connect brokerage accounts to your app for live positions and trading The version of the OpenAPI document: 1.0.0 Contact: api@snaptrade.com =end require 'spec_helper' require 'json' # Unit tests for SnapTrade::TransactionsAndReportingApi describe 'TransactionsAndReportingApi' do before do # run before each test @api_instance = SnapTrade::TransactionsAndReportingApi.new end after do # run after each test end describe 'test an instance of TransactionsAndReportingApi' do it 'should create an instance of TransactionsAndReportingApi' do expect(@api_instance).to be_instance_of(SnapTrade::TransactionsAndReportingApi) end end # unit tests for get_activities # Get transaction history for a user # Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. # @param user_id # @param user_secret # @param [Hash] opts the optional parameters # @option opts [Date] :start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`. # @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`. # @option opts [String] :accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter. # @option opts [String] :brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter. # @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. # @return [Array] describe 'get_activities test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for get_reporting_custom_range # Get performance information for a specific timeframe # Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies. # @param start_date # @param end_date # @param user_id # @param user_secret # @param [Hash] opts the optional parameters # @option opts [String] :accounts Optional comma separated list of account IDs used to filter the request on specific accounts # @option opts [Boolean] :detailed Optional, increases frequency of data points for the total value and contribution charts if set to true # @option opts [String] :frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly. # @return [PerformanceCustom] describe 'get_reporting_custom_range test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end