<commit_before>/*
 * This script tells us which Stripe subscriptions are inactive
 */

const app = require('../server/index');
import models from '../server/models';
import { retrieveSubscription } from '../server/gateways/stripe';
//const stripeGateway = require('../server/gateways').stripe;

const done = (err) => {
  if (err) console.log('err', err);
  console.log('done!');
  process.exit();
}

function run() {
  let inactiveSubscriptionCount = 0;
  let sumAmount = 0;
  return models.Donation.findAll({
    where: { 
      SubscriptionId: {
        $ne: null
      } 
    },
    include: [
      { model: models.Subscription,
        where: { 
          isActive: true,
          stripeSubscriptionId: {<commit_msg>check for payment method to avoid errors in the script<commit_after>/*
 * This script tells us which Stripe subscriptions are inactive
 */

const app = require('../server/index');
import models from '../server/models';
import { retrieveSubscription } from '../server/gateways/stripe';
//const stripeGateway = require('../server/gateways').stripe;

const done = (err) => {
  if (err) console.log('err', err);
  console.log('done!');
  process.exit();
}

function run() {
  let inactiveSubscriptionCount = 0;
  let sumAmount = 0;
  return models.Donation.findAll({
    where: { 
      SubscriptionId: {
        $ne: null
      },
      PaymentMethodId: {
        $ne: null
      }
    },
    include: [
      { model: models.Subscription,
        where: { 
          isActive: true,
          stripeSubscriptionId: {
{'fraction_non_alphanumeric': 0.14322916666666666, 'fraction_numerical': 0.0026041666666666665, 'mean_word_length': 2.7487804878048783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2221161', 'n_tokens_mistral': 465, 'n_tokens_neox': 457, 'n_words': 120}