Skip to content

Commit

Permalink
[FYST-1727] special program az (#5473)
Browse files Browse the repository at this point in the history
* adds the concept of a 'special program' to the state information service

* adds a SpecialProgram node to the ReturnHeader section if a special_program_value exists for the state

* nah

* yah this is better; no one but az needs to care about SpecialProgram nodes
  • Loading branch information
jnf authored Jan 30, 2025
1 parent 5084545 commit 5748041
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/lib/submission_builder/ty2022/states/az/az_return_xml.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module SubmissionBuilder
module Ty2022
module States
Expand Down Expand Up @@ -35,6 +36,7 @@ def state_schema_version
end

def build_state_specific_tags(document)
document.at("ReturnHeaderState ReturnType").add_next_sibling(special_program)
if !@submission.data_source.routing_number.nil? && !@submission.data_source.account_number.nil?
document.at("ReturnState").add_child(financial_transaction)
end
Expand Down Expand Up @@ -185,6 +187,10 @@ def schema_file
SchemaFileLoader.load_file("us_states", "unpacked", "AZIndividual2024v2.0", "AZIndividual", "IndividualReturnAZ140.xsd")
end

def special_program
"<SpecialProgram>Direct File</SpecialProgram>"
end

def supported_documents
supported_docs = [
{
Expand All @@ -200,7 +206,7 @@ def supported_documents
{
xml: SubmissionBuilder::Ty2022::States::Az::Documents::Az301,
pdf: PdfFiller::Az301Pdf,
include: @submission.data_source.az321_contributions.present? || @submission.data_source.az322_contributions.present?
include: @submission.data_source.az321_contributions.present? || @submission.data_source.az322_contributions.present?
},
{
xml: SubmissionBuilder::Ty2022::States::Az::Documents::Az321Contribution,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
expect(build_response.errors).not_to be_present
end

it "includes the SpecialProgram node in the RetrunHeaderState" do
expect(xml.document.at('ReturnHeaderState SpecialProgram').text).to eq "Direct File"
end

context "married filing jointly" do
let(:intake) { create(:state_file_az_intake, filing_status: :married_filing_jointly) }

Expand Down

0 comments on commit 5748041

Please sign in to comment.