<commit_before>module Coinmate::Model
  class Transaction < Base
    
    DEBIT_TRANSACTION_TYPES = %w(SELL QUICK_SELL WITHDRAWAL CREATE_VOUCHER DEBIT)
    
    attr_accessor :transaction_id, :timestamp, :transaction_type,
                  :amount, :amount_currency,
                  :price, :price_currency,
                  :fee, :fee_currency,
                  :description, :status, :order_id, :currency_pair


    def initialize(attributes = {})
      super
      self.timestamp = Time.at(timestamp / 1000.0)
      self.price = BigDecimal.new(price, 8)
      self.amount = BigDecimal.new(amount, 12)
      self.fee = BigDecimal.new(fee, 12) if fee
      if DEBIT_TRANSACTION_TYPES.include?(transaction_type)
        self.amount *= -1<commit_msg>Fix for Transaction model (conversion to BigDecimal)<commit_after>module Coinmate::Model
  class Transaction < Base
    
    DEBIT_TRANSACTION_TYPES = %w(SELL QUICK_SELL WITHDRAWAL CREATE_VOUCHER DEBIT)
    
    attr_accessor :transaction_id, :timestamp, :transaction_type,
                  :amount, :amount_currency,
                  :price, :price_currency,
                  :fee, :fee_currency,
                  :description, :status, :order_id, :currency_pair


    def initialize(attributes = {})
      super
      self.timestamp = Time.at(timestamp / 1000.0)
      self.price = BigDecimal.new(price, 8) if price
      self.amount = BigDecimal.new(amount, 12) if amount
      self.fee = BigDecimal.new(fee, 12) if fee
      if DEBIT_TRANSACTION_TYPES.include?(transaction_type)
        self.amount *= -1
{'fraction_non_alphanumeric': 0.09450830140485313, 'fraction_numerical': 0.0140485312899106, 'mean_word_length': 2.6357308584686776, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '907941', 'n_tokens_mistral': 503, 'n_tokens_neox': 472, 'n_words': 101}