<commit_before># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)<commit_msg>add seeds. avoid having to create a user manually each time<commit_after>### start system setup

categories = Category.create([
  {
    name: 'tv',
    label: 'TV'
  },
  {
    name: 'health_fitness',
    label: 'Health & Fitness'
  },
  {
    name: 'bank',
    label: 'Bank'
  },
  {
    name: 'food_drinks',
    label: 'Food & Drinks'
  }
])

repeat_intervals = RepeatInterval.create([
  {
    years: 0,
    months: 1,
    weeks: 0,
    days: 0,
    interval: '1_month',
    label: 'Monthly'
  },
  {
    years: 1,
    months: 0,
    weeks: 0,
    days: 0,
    interval: '1_year',
    label: 'Yearly'
  },
  {
    years: 0,
    months: 0,
    weeks: 1,
    days: 0,
    interval: '1_week',
    label: 'Weekly'
  },
  {
    years: 0,
    months: 0,
    weeks: 0,
    days: 1,
    interval: '1_day',
    label: 'Daily'
  }
])

### end system setup

### start user data setup
user = User.create({
  first_name: 'James',
  last_name: 'Bond',
  email_address: '<EMAIL>',
  username: 'bond007',
  avatar: 'http://i.imgur.com/4fWZN.jpg',
  phone_number: '9809809801',
  password: '<PASSWORD>'
})

payment_sources = user.payment_sources.create([
  {
    name: 'Secret Service Credit Card',
    type: 'CreditCard'
  },
  {
    name: 'Secret Service Debit Card',
    type: 'DebitCard'
  },
  {
    name: 'Secret Service Super Credit Card',
    type: 'CreditCard'
  }
])

netflix_bill = user.bills.create({
  name: 'Netflix',
  next_due_date: 5.days.since,
  amount: 9.99,
  repeat_interval: repeat_intervals.first, # monthly
  category: categories.first # tv
})

netflix_bill_tags = netflix_bill.tags.create([
  { name: 'tv' }, { name: 'entertainment' }, { name: 'online' }
])

payments = netflix_bill.payments.create([
  {
    amount: 9.99,
    payment_source: payment_sources.first
  },
  {
    amount: 9.99,
    payment_source: payment_sources.last
  }
])

gym_bill = user.bills.create({
  name: '24 Hour Fitness',
  next_due_date: 15.days.since,
  amount: 49.99,
  repeat_interval: repeat_intervals.first, # monthly
  category: categories.second # health_fitness
})

gym_bill_tags = gym_bill.tags.create([
  { name: 'gym' }, { name: 'health' }, { name: 'personal-training' }
])

gym_bill.payments.create([
  {
    amount: 49.99,
    payment_source: payment_sources.last
  },
  {
    amount: 49.99,
    payment_source: payment_sources.second
  }
])


### end user data setup
{'fraction_non_alphanumeric': 0.147918188458729, 'fraction_numerical': 0.02191380569758948, 'mean_word_length': 3.075892857142857, 'pattern_counts': {'":': 0, '<': 5, '<?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': '854062', 'n_tokens_mistral': 1061, 'n_tokens_neox': 999, 'n_words': 245}