<commit_before>require 'active_support/time'

class FinancialStatement
  include Mongoid::Document
  include Mongoid::Timestamps

  TAX_FILING_STATUS_TYPES = %W(tax_filer tax_dependent non_filer)

  field :tax_filing_status, type: String
  field :is_tax_filing_together, type: Boolean

  field :eligibility_determination_id, type: Moped::BSON::ObjectId

  # Has access to employer-sponsored coverage that meets ACA minimum standard value and 
  #   employee responsible premium amount is <= 9.5% of Household income
  field :is_enrolled_for_es_coverage, type: Boolean, default: false
  field :is_without_assistance, type: Boolean, default: true
  field :submitted_date, type: DateTime
  field :is_active, type: Boolean, default: true

  index({submitted_date:  1})

  embedded_in :tax_household_member

  embeds_many :incomes
  accepts_nested_attributes_for :incomes

  embeds_many :deductions
  accepts_nested_attributes_for :deductions

  embeds_many :alternate_benefits
  accepts_nested_attributes_for :alternate_benefits

  validates_presence_of :tax_household_member_id

  validates :tax_filing_status,
    inclusion: { in: TAX_FILING_STATUS_TYPES, message: "%{value} is not a valid tax filing status" },
    allow_blank: true

  def application_group
    return nil unless tax_household_member
    tax_household_member.application_group
  end

  def applicant
    return nil unless tax_household_member<commit_msg>No need to validate this.<commit_after>require 'active_support/time'

class FinancialStatement
  include Mongoid::Document
  include Mongoid::Timestamps

  TAX_FILING_STATUS_TYPES = %W(tax_filer tax_dependent non_filer)

  field :tax_filing_status, type: String
  field :is_tax_filing_together, type: Boolean

  field :eligibility_determination_id, type: Moped::BSON::ObjectId

  # Has access to employer-sponsored coverage that meets ACA minimum standard value and 
  #   employee responsible premium amount is <= 9.5% of Household income
  field :is_enrolled_for_es_coverage, type: Boolean, default: false
  field :is_without_assistance, type: Boolean, default: true
  field :submitted_date, type: DateTime
  field :is_active, type: Boolean, default: true

  index({submitted_date:  1})

  embedded_in :tax_household_member

  embeds_many :incomes
  accepts_nested_attributes_for :incomes

  embeds_many :deductions
  accepts_nested_attributes_for :deductions

  embeds_many :alternate_benefits
  accepts_nested_attributes_for :alternate_benefits

  validates :tax_filing_status,
    inclusion: { in: TAX_FILING_STATUS_TYPES, message: "%{value} is not a valid tax filing status" },
    allow_blank: true

  def application_group
    return nil unless tax_household_member
    tax_household_member.application_group
  end

  def applicant
    return nil unless tax_household_member
{'fraction_non_alphanumeric': 0.057815845824411134, 'fraction_numerical': 0.0021413276231263384, 'mean_word_length': 5.595294117647059, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4990319', 'n_tokens_mistral': 894, 'n_tokens_neox': 862, 'n_words': 231}