Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions app/services/multi_tenant_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ def filing_years(now = DateTime.now)
if service_type == :ctc || service_type == :state_file
[current_tax_year]
else
years = Rails.configuration.tax_year_filing_seasons.select do |_, (season_start, deadline)|
deadline > now - 3.years && season_start <= now
end.keys.freeze
years = Rails.configuration.tax_year_filing_seasons.select do |_, (season_start, _)|
now > season_start - 3.months
end.keys.sort.reverse.take(3)

years += [years.last - 1] if between_deadline_and_end_of_in_progress_intake?(now)
years
years += [years.last - 1] if now < Rails.configuration.tax_year_filing_seasons[years.first].last

years.freeze
end
end

Expand Down Expand Up @@ -145,7 +146,7 @@ def statefile

def gyr_current_tax_year(time)
Rails.configuration.tax_year_filing_seasons.select do |_year, (open_date, _close_date)|
time > open_date
time > open_date - 3.months
end.keys.max
end
end
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5267,7 +5267,7 @@ en:
body: In accordance with national IRS guidelines, all Personally Identifiable Information (PII) provided by taxpayers to volunteers must be protected. We keep your information safe and secure.
header: Committed to keeping your information secure.
subheader: Claim thousands of dollars through tax credits you're owed! We work with you to get your highest refund.
subheader_offseason: Sign up for the next tax season now! We'll notify you as soon as our service reopens on January 31 at 1pm EST.
subheader_offseason: Sign up for the next tax season now! We'll notify you as soon as our service reopens late January.
subheader_warning: File by %{tax_day} to avoid any penalties.
title: Free tax help from IRS-certified volunteers.
maybe_ineligible:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5240,7 +5240,7 @@ es:
body: De acuerdo con las pautas nacionales del IRS, toda la información de identificación personal (PII, por sus siglas en inglés) que los contribuyentes proporcionan a los voluntarios debe estar protegida. Mantenemos su información segura y protegida.
header: Nos comprometemos a mantener la seguridad de su información.
subheader: "¡Reclama miles de dólares a través de los créditos tributarios que te corresponden! Trabajamos contigo para obtener tu mayor reembolso."
subheader_offseason: "¡Regístrese para la próxima temporada de impuestos ahora! Le notificaremos tan pronto que nuestro servicio vuelva a abrir el 31 de enero a la 1pm EST."
subheader_offseason: "¡Regístrese para la próxima temporada de impuestos ahora! Le notificaremos tan pronto que nuestro servicio vuelva a abrir a finales de enero."
subheader_warning: Envía tu solicitud antes del %{tax_day} para evitar penalizaciones.
title: Ayuda gratuita para declarar sus impuestos ofrecida por voluntarios certificados por el IRS.
maybe_ineligible:
Expand Down
11 changes: 6 additions & 5 deletions spec/services/multi_tenant_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@

it "returns just the current year for ctc and valid filing years for gyr when using DateTime.now" do
fake_time = Rails.configuration.tax_year_filing_seasons[2020][1] + 3.years - 1.day
# this is May 16, 2024 in which the deadline has passes and thus should show 3 years of filing
Timecop.freeze(fake_time) do
expect(described_class.new(:ctc).filing_years).to eq [2023]
expect(described_class.new(:gyr).filing_years).to eq [2023, 2022, 2021, 2020]
expect(described_class.new(:gyr).filing_years).to eq [2023, 2022, 2021]
end
end

Expand All @@ -66,19 +67,19 @@
end
end

context "GYR 2025 after tax deadline before end of in progress intake" do
context "GYR 2025 after tax deadline but before end of login" do
it "returns 2022, 2023, 2024" do
fake_time = DateTime.parse("2025-06-23")

expect(described_class.new(:gyr).filing_years(fake_time)).to eq [2024, 2023, 2022]
end
end

context "GYR 2025 after end of in progress intake" do
it "returns 2022, 2023, 2024" do
context "GYR 2025 after end of login" do
it "returns 2022, 2023, 2024 and 2025" do
fake_time = DateTime.parse("2025-12-21")

expect(described_class.new(:gyr).filing_years(fake_time)).to eq [2024, 2023, 2022]
expect(described_class.new(:gyr).filing_years(fake_time)).to eq [2025, 2024, 2023, 2022]
end
end
end
Expand Down
Loading