app/data_migrations/golden_seed_financial_assistance_helper.rb
def create_and_return_fa_applicant(case_info_hash, is_primary_applicant = nil)
    applicant = case_info_hash[:fa_applicant] || case_info_hash[:fa_application].applicants.build
    target_person = case_info_hash[:person_attributes][:current_target_person]
    applicant.is_primary_applicant = is_primary_applicant
    applicant.is_claimed_as_tax_dependent = truthy_value?(case_info_hash[:person_attributes]["claimed_by"])
    applicant.first_name = target_person.first_name
    applicant.middle_name = target_person.middle_name
    applicant.last_name = target_person.last_name
    applicant.gender = target_person.gender
    applicant.dob = target_person.dob
    applicant.ssn = generate_and_return_unique_ssn
    applicant.has_job_income = case_info_hash[:person_attributes]["income_type"]&.downcase == 'job' || false
    applicant.has_self_employment_income = case_info_hash[:person_attributes]["income_type"]&.downcase == 'self-employment' || false
    applicant.has_other_income = case_info_hash[:person_attributes]["income_type"]&.downcase == 'other' || false
    applicant.has_unemployment_income = false
    applicant.has_deductions = false
    applicant.has_enrolled_health_coverage = false
    applicant.has_eligible_health_coverage = false
    applicant.is_consumer_role = target_person.consumer_role.present?
    applicant.is_joint_tax_filing = case_info_hash[:person_attributes]["tax_filing_status"].downcase == 'joint'
    applicant.is_required_to_file_taxes = ["non_filer", "dependent"].exclude?(
      case_info_hash[:person_attributes]["tax_filing_status"].downcase
    )
    applicant.tax_filer_kind = applicant.is_required_to_file_taxes == false ? 'non_filer' : case_info_hash[:person_attributes]["tax_filing_status"].downcase
    applicant.claimed_as_tax_dependent_by = case_info_hash[:fa_application].applicants.all.detect(&:is_primary_applicant)&.id
    applicant.is_applying_coverage = truthy_value?(case_info_hash[:person_attributes]['applying_for_coverage'])
    # applicant.
    # TODO: Need to refactor this once dc resident is refactored
    applicant.has_fixed_address = target_person&.is_homeless?
    applicant.is_living_in_state = target_person&.is_dc_resident?
    applicant.is_temporarily_out_of_state = target_person&.is_temporarily_out_of_state
    applicant.is_consumer_role = target_person&.consumer_role.present?
    applicant.is_tobacco_user = false
    applicant.is_incarcerated = false
    applicant.is_disabled = false

    applicant.is_physically_disabled = false
    applicant.indian_tribe_member = false
    # TODO: We can enhance this later
    applicant.is_pregnant = truthy_value?(case_info_hash[:person_attributes]['pregnant'])
    applicant.is_post_partum_period = truthy_value?(case_info_hash[:person_attributes]['pregnant_last_60_days'])
    applicant.pregnancy_due_on = TimeKeeper.date_of_record + 2.months if truthy_value?(case_info_hash[:person_attributes]['pregnant'])
    # TODO: Figure out if we want pregnant examples on medicaid
    # This is during pregnancy btw
    applicant.is_enrolled_on_medicaid = false if truthy_value?(case_info_hash[:person_attributes]['pregnant'])
    applicant.is_former_foster_care = false if applicant.age_of_the_applicant > 18 && applicant.age_of_the_applicant < 26
    # Other questions
    applicant.is_student = false
    applicant.is_self_attested_blind = false
    applicant.is_self_attested_disabled = false
    applicant.has_daily_living_help = false
    applicant.need_help_paying_bills = false
    # Health coverage
    # TODO: Not sure how to interpret CSV
    # applicant.has_enrolled_health_coverage = truthy_value?(case_info_hash[:person_attributes]['health_program1'])
    # applicant.has_eligible_health_coverage = truthy_value?(case_info_hash[:person_attributes]['health_program1'])
    applicant.save!
    applicant
  end
# TODO: NEED TO DO MEDICAID AND OTHER STUFF
# rubocop:disable Metrics/CyclomaticComplexity
NEED TO DO MEDICAID AND OTHER STUFF
rubocop:disable Metrics/CyclomaticComplexity
NEED TO DO MEDICAID AND OTHER STUFF rubocop : disable Metrics / CyclomaticComplexity
def create_and_return_fa_applicant(case_info_hash, is_primary_applicant = nil)
    applicant = case_info_hash[:fa_applicant] || case_info_hash[:fa_application].applicants.build
    target_person = case_info_hash[:person_attributes][:current_target_person]
    applicant.is_primary_applicant = is_primary_applicant
    applicant.is_claimed_as_tax_dependent = truthy_value?(case_info_hash[:person_attributes]["claimed_by"])
    applicant.first_name = target_person.first_name
    applicant.middle_name = target_person.middle_name
    applicant.last_name = target_person.last_name
    applicant.gender = target_person.gender
    applicant.dob = target_person.dob
    applicant.ssn = generate_and_return_unique_ssn
    applicant.has_job_income = case_info_hash[:person_attributes]["income_type"]&.downcase == 'job' || false
    applicant.has_self_employment_income = case_info_hash[:person_attributes]["income_type"]&.downcase == 'self-employment' || false
    applicant.has_other_income = case_info_hash[:person_attributes]["income_type"]&.downcase == 'other' || false
    applicant.has_unemployment_income = false
    applicant.has_deductions = false
    applicant.has_enrolled_health_coverage = false
    applicant.has_eligible_health_coverage = false
    applicant.is_consumer_role = target_person.consumer_role.present?
    applicant.is_joint_tax_filing = case_info_hash[:person_attributes]["tax_filing_status"].downcase == 'joint'
    applicant.is_required_to_file_taxes = ["non_filer", "dependent"].exclude?(
      case_info_hash[:person_attributes]["tax_filing_status"].downcase
    )
    applicant.tax_filer_kind = applicant.is_required_to_file_taxes == false ? 'non_filer' : case_info_hash[:person_attributes]["tax_filing_status"].downcase
    applicant.claimed_as_tax_dependent_by = case_info_hash[:fa_application].applicants.all.detect(&:is_primary_applicant)&.id
    applicant.is_applying_coverage = truthy_value?(case_info_hash[:person_attributes]['applying_for_coverage'])
    applicant.has_fixed_address = target_person&.is_homeless?
    applicant.is_living_in_state = target_person&.is_dc_resident?
    applicant.is_temporarily_out_of_state = target_person&.is_temporarily_out_of_state
    applicant.is_consumer_role = target_person&.consumer_role.present?
    applicant.is_tobacco_user = false
    applicant.is_incarcerated = false
    applicant.is_disabled = false
    applicant.is_physically_disabled = false
    applicant.indian_tribe_member = false
    applicant.is_pregnant = truthy_value?(case_info_hash[:person_attributes]['pregnant'])
    applicant.is_post_partum_period = truthy_value?(case_info_hash[:person_attributes]['pregnant_last_60_days'])
    applicant.pregnancy_due_on = TimeKeeper.date_of_record + 2.months if truthy_value?(case_info_hash[:person_attributes]['pregnant'])
    applicant.is_enrolled_on_medicaid = false if truthy_value?(case_info_hash[:person_attributes]['pregnant'])
    applicant.is_former_foster_care = false if applicant.age_of_the_applicant > 18 && applicant.age_of_the_applicant < 26
    applicant.is_student = false
    applicant.is_self_attested_blind = false
    applicant.is_self_attested_disabled = false
    applicant.has_daily_living_help = false
    applicant.need_help_paying_bills = false
    has_enrolled_health_coverage = truthy_value?(case_info_hash[:person_attributes]['health_program1'])
    has_eligible_health_coverage = truthy_value?(case_info_hash[:person_attributes]['health_program1'])
    applicant.save!
    applicant
  end
def create_and_return_fa_applicant ( case_info_hash , is_primary_applicant = nil ) applicant = case_info_hash [ :fa_applicant ] || case_info_hash [ :fa_application ] . applicants . build target_person = case_info_hash [ :person_attributes ] [ :current_target_person ] applicant . is_primary_applicant = is_primary_applicant applicant . is_claimed_as_tax_dependent = truthy_value? ( case_info_hash [ :person_attributes ] [ "claimed_by" ] ) applicant . first_name = target_person . first_name applicant . middle_name = target_person . middle_name applicant . last_name = target_person . last_name applicant . gender = target_person . gender applicant . dob = target_person . dob applicant . ssn = generate_and_return_unique_ssn applicant . has_job_income = case_info_hash [ :person_attributes ] [ "income_type" ] &. downcase == 'job' || false applicant . has_self_employment_income = case_info_hash [ :person_attributes ] [ "income_type" ] &. downcase == 'self-employment' || false applicant . has_other_income = case_info_hash [ :person_attributes ] [ "income_type" ] &. downcase == 'other' || false applicant . has_unemployment_income = false applicant . has_deductions = false applicant . has_enrolled_health_coverage = false applicant . has_eligible_health_coverage = false applicant . is_consumer_role = target_person . consumer_role . present? applicant . is_joint_tax_filing = case_info_hash [ :person_attributes ] [ "tax_filing_status" ] . downcase == 'joint' applicant . is_required_to_file_taxes = [ "non_filer" , "dependent" ] . exclude? ( case_info_hash [ :person_attributes ] [ "tax_filing_status" ] . downcase ) applicant . tax_filer_kind = applicant . is_required_to_file_taxes == false ? 'non_filer' : case_info_hash [ :person_attributes ] [ "tax_filing_status" ] . downcase applicant . claimed_as_tax_dependent_by = case_info_hash [ :fa_application ] . applicants . all . detect ( & :is_primary_applicant ) &. id applicant . is_applying_coverage = truthy_value? ( case_info_hash [ :person_attributes ] [ 'applying_for_coverage' ] ) applicant . has_fixed_address = target_person &. is_homeless? applicant . is_living_in_state = target_person &. is_dc_resident? applicant . is_temporarily_out_of_state = target_person &. is_temporarily_out_of_state applicant . is_consumer_role = target_person &. consumer_role . present? applicant . is_tobacco_user = false applicant . is_incarcerated = false applicant . is_disabled = false applicant . is_physically_disabled = false applicant . indian_tribe_member = false applicant . is_pregnant = truthy_value? ( case_info_hash [ :person_attributes ] [ 'pregnant' ] ) applicant . is_post_partum_period = truthy_value? ( case_info_hash [ :person_attributes ] [ 'pregnant_last_60_days' ] ) applicant . pregnancy_due_on = TimeKeeper . date_of_record + 2 . months if truthy_value? ( case_info_hash [ :person_attributes ] [ 'pregnant' ] ) applicant . is_enrolled_on_medicaid = false if truthy_value? ( case_info_hash [ :person_attributes ] [ 'pregnant' ] ) applicant . is_former_foster_care = false if applicant . age_of_the_applicant > 18 && applicant . age_of_the_applicant < 26 applicant . is_student = false applicant . is_self_attested_blind = false applicant . is_self_attested_disabled = false applicant . has_daily_living_help = false applicant . need_help_paying_bills = false applicant . save! applicant end
TODO: NEED TO DO MEDICAID AND OTHER STUFF
rubocop:disable Metrics/CyclomaticComplexity
TODO : NEED TO DO MEDICAID AND OTHER STUFF rubocop : disable Metrics / CyclomaticComplexity
# applicant. # TODO: Need to refactor this once dc resident is refactored # TODO: We can enhance this later # TODO: Figure out if we want pregnant examples on medicaid # This is during pregnancy btw # Other questions # Health coverage # TODO: Not sure how to interpret CSV # applicant.has_enrolled_health_coverage = truthy_value?(case_info_hash[:person_attributes]['health_program1']) # applicant.has_eligible_health_coverage = truthy_value?(case_info_hash[:person_attributes]['health_program1'])
case_info_hash
is_primary_applicant