app/data_migrations/golden_seed_helper.rb
# TODO: Consider if this should be removed in non local dev environments
Consider if this should be removed in non local dev environments
Consider if this should be removed in non local dev environments
def create_and_return_ivl_hbx_profile_and_sponsorship
    puts("HBX Profile and Benefit Sponsorship already present.") if !Rails.env.test? && current_hbx_profile && current_hbx_benefit_sponsorship
    return if current_hbx_profile && current_hbx_benefit_sponsorship
    state_abbreviation = EnrollRegistry[:enroll_app].setting(:state_abbreviation).item
    org = Organization.new(
      hbx_id: "200000031",
      legal_name: "#{state_abbreviation} organization",
      dba: "#{state_abbreviation}CL",
      fein: "123123456"
    )
    ol = org.office_locations.build
    address = ol.build_address(
      kind: "mailing",
      address_1: "Main St NE",
      city: EnrollRegistry[:enroll_app].setting(:contact_center_city).item,
      state: state_abbreviation,
      zip: EnrollRegistry[:enroll_app].setting(:contact_center_zip_code).item
    )
    address.save!
    ol.save!
    org.save!
    hbx = org.build_hbx_profile(
      cms_id: "#{state_abbreviation}0",
      us_state_abbreviation: state_abbreviation
    )
    hbx.save!
    benefit_sponsorship = hbx.build_benefit_sponsorship
    benefit_sponsorship.service_markets = ["individual"]
    benefit_sponsorship.save!
    {hbx_profile: hbx, benefit_sponsorship: benefit_sponsorship}
  end
def create_and_return_ivl_hbx_profile_and_sponsorship puts ( "HBX Profile and Benefit Sponsorship already present." ) if ! Rails . env . test? && current_hbx_profile && current_hbx_benefit_sponsorship return if current_hbx_profile && current_hbx_benefit_sponsorship state_abbreviation = EnrollRegistry [ :enroll_app ] . setting ( :state_abbreviation ) . item org = Organization . new ( hbx_id : "200000031" , legal_name : "#{state_abbreviation} organization" , dba : "#{state_abbreviation}CL" , fein : "123123456" ) ol = org . office_locations . build address = ol . build_address ( kind : "mailing" , address_1 : "Main St NE" , city : EnrollRegistry [ :enroll_app ] . setting ( :contact_center_city ) . item , state : state_abbreviation , zip : EnrollRegistry [ :enroll_app ] . setting ( :contact_center_zip_code ) . item ) address . save! ol . save! org . save! hbx = org . build_hbx_profile ( cms_id : "#{state_abbreviation}0" , us_state_abbreviation : state_abbreviation ) hbx . save! benefit_sponsorship = hbx . build_benefit_sponsorship benefit_sponsorship . service_markets = [ "individual" ] benefit_sponsorship . save! { hbx_profile : hbx , benefit_sponsorship : benefit_sponsorship } end
TODO: Consider if this should be removed in non local dev environments
TODO : Consider if this should be removed in non local dev environments