<commit_before>module Tufy
  module Fields
    module Account
      class BuildInterestAndFeesField < BuildField
        expects :raw_data
        promises :transformed_data

        executed do |ctx|
          ctx.transformed_data =
            ctx.transformed_data +
            transform(ctx).upcase
        end

        private

        def self.transform(ctx)
          raw_data = ctx.raw_data

          interest_and_fees = raw_data[:interest_and_fees].to_i
          interest_and_fees = interest_and_fees < 0 ? 0 : interest_and_fees

          BuildAccountSegment::Constants::INTEREST_AND_FEES_TAG +
            FormatStrings::F2TS % interest_and_fees.to_s.size +
              raw_data[:interest_and_fees].to_s
        end
      end
    end
  end
end
<commit_msg>Fix not entirely removal of negative interest and fees<commit_after>module Tufy
  module Fields
    module Account
      class BuildInterestAndFeesField < BuildField
        expects :raw_data
        promises :transformed_data

        executed do |ctx|
          ctx.transformed_data =
            ctx.transformed_data +
            transform(ctx).upcase
        end

        private

        def self.transform(ctx)
          raw_data = ctx.raw_data

          interest_and_fees = raw_data[:interest_and_fees].to_i
          interest_and_fees = interest_and_fees < 0 ? 0 : interest_and_fees

          BuildAccountSegment::Constants::INTEREST_AND_FEES_TAG +
            FormatStrings::F2TS % interest_and_fees.to_s.size +
              interest_and_fees.to_s
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.05407124681933842, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 2.1272365805168985, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3629288', 'n_tokens_mistral': 475, 'n_tokens_neox': 456, 'n_words': 90}