<commit_before># frozen_string_literal: true

puts "Creating minimal snap application..."

minimal_application = SnapApplication.
  where(email: "<EMAIL>").
  first_or_create(
    signature: "Minimal Application",
    signed_at: Time.current,
    phone_number: "5551230000",
    sms_consented: false,
    consent_to_terms: true,
    everyone_a_citizen: true,
    anyone_disabled: false,
    anyone_new_mom: false,
    anyone_in_college: false,
    anyone_living_elsewhere: false,
    income_change: false,
    rent_expense: 500,
    property_tax_expense: 0,
    insurance_expense: 0,
    utility_heat: false,
    utility_cooling: false,
    utility_electrity: false,
    utility_water_sewer: false,
    utility_trash: false,
    utility_phone: false,
    utility_other: false,
    dependent_care: false,
    medical: false,
    court_ordered: false,
    money_or_accounts_income: false,
    real_estate_income: false,
    vehicle_income: false,
  )

Address.where(
  snap_application: minimal_application,
  street_address: "123 Main St.",
).first_or_create(
  city: "Flint",
  county: "Genesee",
  state: "MI",
  zip: "48501",
)

Member.where(
  snap_application: minimal_application,
  first_name: "Test",
  last_name: "Client",
).first_or_create(
  marital_status: "Never married",
  sex: "male",
  encrypted_ssn: "D0zKx2AZL9zkT9acqR9a5NDbxmL9c3cNgQ==\n",
  encrypted_ssn_iv: "zlSjtIuRh4/T4gHe\n",
  birthday: 30.years.ago,
  employment_status: "not_employed",
)

puts "Minimal application created (or found) with id: #{minimal_application.id}"

puts "Creating a more complete snap application..."

flint_driver_license =
  "https://shubox-codepen-io.s3.amazonaws.com/s-codepen-io/7d1a2bc9/id.jpg"
complete_application = SnapApplication.
  where(email: "<EMAIL>").
  first_or_create(
    signature: "Complete Testapp",
    signed_at: Time.current,
    documents: [flint_driver_license],
    phone_number: "5550001234",
    sms_consented: true,
    consent_to_terms: true,
    mailing_address_same_as_residential_address: false,
    unstable_housing: true,
    everyone_a_citizen: true,
    anyone_disabled: false,
    anyone_new_mom: false,
    anyone_in_college: false,
    anyone_living_elsewhere: false,
    income_change: true,
    income_change_explanation: "I got a new job.",
    additional_income: ["other"],
    income_other: 200,
    income_pension: nil,
    rent_expense: 400,
    property_tax_expense: 100,
    insurance_expense: 100,
    utility_heat: true,
    utility_cooling: false,
    utility_electrity: false,
    utility_water_sewer: true,
    utility_trash: false,
    utility_phone: true,
    utility_other: false,
    dependent_care: true,
    medical: true,
    court_ordered: false,
    monthly_care_expenses: 400,
    monthly_medical_expenses: 200,
    monthly_court_ordered_expenses: nil,
    care_expenses: ["childcare"],
    medical_expenses: ["health_insurance", "prescriptions"],
    money_or_accounts_income: true,
    real_estate_income: true,
    vehicle_income: true,
    financial_accounts: ["checking_account", "four_oh_one_k"],
    total_money: 2000,
    additional_information: "N/A",
  )

Address.where(
  snap_application: complete_application,
  street_address: "1 Fuller Ave.",
).first_or_create(
  city: "Flint",
  county: "Genesee",
  state: "MI",
  zip: "48503",
  mailing: true,
)

Address.where(
  snap_application: complete_application,
  street_address: "100 Home St.",
).first_or_create(<commit_msg>Update seeds so that records are updated when re-run (#272)<commit_after># frozen_string_literal: true

puts "Creating minimal snap application..."

minimal_application = SnapApplication.find_or_initialize_by(
  email: "<EMAIL>",
)

minimal_application.update!(
  signature: "Minimal Application",
  signed_at: Time.current,
  phone_number: "5551230000",
  sms_consented: false,
  consent_to_terms: true,
  everyone_a_citizen: true,
  anyone_disabled: false,
  anyone_new_mom: false,
  anyone_in_college: false,
  anyone_living_elsewhere: false,
  income_change: false,
  rent_expense: 500,
  property_tax_expense: 0,
  insurance_expense: 0,
  utility_heat: false,
  utility_cooling: false,
  utility_electrity: false,
  utility_water_sewer: false,
  utility_trash: false,
  utility_phone: false,
  utility_other: false,
  dependent_care: false,
  medical: false,
  court_ordered: false,
  money_or_accounts_income: false,
  real_estate_income: false,
  vehicle_income: false,
)

Address.where(
  snap_application: minimal_application,
  street_address: "123 Main St.",
).first_or_create(
  city: "Flint",
  county: "Genesee",
  state: "MI",
  zip: "48501",
)

Member.where(
  snap_application: minimal_application,
  first_name: "Test",
  last_name: "Client",
).first_or_create(
  marital_status: "Never married",
  sex: "male",
  encrypted_ssn: "D0zKx2AZL9zkT9acqR9a5NDbxmL9c3cNgQ==\n",
  encrypted_ssn_iv: "zlSjtIuRh4/T4gHe\n",
  birthday: 30.years.ago,
  employment_status: "not_employed",
)

puts "Minimal application created (or found) with id: #{minimal_application.id}"

puts "Creating a more complete snap application..."

flint_driver_license =
  "https://shubox-codepen-io.s3.amazonaws.com/s-codepen-io/7d1a2bc9/id.jpg"

complete_application = SnapApplication.find_or_initialize_by(
  email: "<EMAIL>",
)

complete_application.update!(
  signature: "Complete Testapp",
  signed_at: Time.current,
  documents: [flint_driver_license],
  phone_number: "5550001234",
  sms_consented: true,
  consent_to_terms: true,
  mailing_address_same_as_residential_address: false,
  unstable_housing: true,
  everyone_a_citizen: true,
  anyone_disabled: false,
  anyone_new_mom: false,
  anyone_in_college: false,
  anyone_living_elsewhere: false,
  income_change: true,
  income_change_explanation: "Someone got a new job.",
  additional_income: ["other", "child_support"],
  income_other: 200,
  income_pension: nil,
  rent_expense: 400,
  property_tax_expense: 100,
  insurance_expense: 100,
  utility_heat: true,
  utility_cooling: false,
  utility_electrity: false,
  utility_water_sewer: true,
  utility_trash: false,
  utility_phone: true,
  utility_other: false,
  dependent_care: true,
  medical: true,
  court_ordered: false,
  monthly_care_expenses: 400,
  monthly_medical_expenses: 200,
  monthly_court_ordered_expenses: nil,
  care_expenses: ["childcare"],
  medical_expenses: ["health_insurance", "prescriptions"],
  money_or_accounts_income: true,
  real_estate_income: true,
  vehicle_income: true,
  financial_accounts: ["checking_account", "four_oh_one_k"],
  total_money: 2000,
  additional_information: "N/A",
)

Address.where(
  snap_application: complete_application,
  street_address: "1 Fuller Ave.",
).first_or_create(
  city: "Flint",
  county: "Genesee",
  state: "MI",
  zip: "48503",
  mailing: true,
)

Address.where(
  snap_application: complete_application,
  street_address: "100 Home St.",
).first_or_create(
{'fraction_non_alphanumeric': 0.10608039471774779, 'fraction_numerical': 0.023944275141488898, 'mean_word_length': 4.9567847882454625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6556277', 'n_tokens_mistral': 2609, 'n_tokens_neox': 2499, 'n_words': 499}