<commit_before><commit_msg>Add job which moves club applications to spam<commit_after>class HandleSpamClubApplicationsJob < ApplicationJob
  INBOX_STAGE = '5001'.freeze
  REJECTED_STAGE = '5002'.freeze

  SPAM_COMMENT_MESSAGE = 'Automatically moving box to rejected and marking as '\
    'spam due to our filter thinking this is spam. Note: this does not send '\
    'any  sort of email notification to the applicant letting them know that '\
    "we're rejecting / ignoring them.".freeze

  def perform_now
    ClubApplication
      .where(stage_key: INBOX_STAGE)
      .select(&:spam?)
      .ca do |ca|
        StreakClient::Box.comment(ca, SPAM_COMMENT_MESSAGE)

        ca.stage_key = REJECTED_STAGE
        ca.save
      end
  end
end
{'fraction_non_alphanumeric': 0.07432432432432433, 'fraction_numerical': 0.010810810810810811, 'mean_word_length': 3.308139534883721, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1783395', 'n_tokens_mistral': 238, 'n_tokens_neox': 223, 'n_words': 70}