Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FYST-526 Update refund taxes owed UI and add financial information to MD pdf/xml #5007

Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9ce7a6e
Add joint account holder name & bank_authorization_confirmation, remo…
arinchoi03 Nov 19, 2024
32d75ff
Ensure joint_account_holder_name is set to nil if payment method changes
arinchoi03 Nov 21, 2024
3166c36
Merge remote-tracking branch 'origin' into FYST-526-update-refund-tax…
arinchoi03 Nov 21, 2024
f27a562
Remove bank_name from taxes owed/tax_refund
arinchoi03 Nov 21, 2024
8e19444
Reorganize db migration to separate name columns from the one new column
arinchoi03 Nov 21, 2024
c047de8
Ignore bank_name for all models
arinchoi03 Nov 21, 2024
4dcf802
Conditionally show joint account holder name if client indicates they…
arinchoi03 Nov 21, 2024
ad00864
Update migrations to fit data model better and add validations for ac…
arinchoi03 Nov 22, 2024
82e10b0
Address spec failures that reference bank_name
arinchoi03 Nov 22, 2024
75f7eec
Make sure to annotate AZ
arinchoi03 Nov 22, 2024
9f2d157
More spec failures oy
arinchoi03 Nov 22, 2024
5e37860
Address more spec failures
arinchoi03 Nov 22, 2024
6ed6f77
Remove references to bank_name from persona factories
arinchoi03 Nov 22, 2024
8d67efc
Move persona factories out of 2023 folder
arinchoi03 Nov 22, 2024
2c0239a
Add schema-specific validations for first and last name
arinchoi03 Nov 22, 2024
09d242f
Add suffix and middle initial validation/specs
arinchoi03 Nov 22, 2024
233092f
Remove unnecessary blank suffix option
arinchoi03 Nov 22, 2024
fa21585
Use i18n translations for labels
arinchoi03 Nov 22, 2024
526e07f
Style updates to be more in line with designs
arinchoi03 Nov 22, 2024
59268d4
Merge remote-tracking branch 'origin' into FYST-526-update-refund-tax…
arinchoi03 Nov 22, 2024
d307903
Make sure all name fields and bank_authorization_confirmed get set to…
arinchoi03 Nov 22, 2024
836500d
follow rubocop suggestion
arinchoi03 Nov 22, 2024
f9c95ce
Add specs for md tax return page
arinchoi03 Nov 22, 2024
1548841
AuthToDirectDepositInd set on XML & checkbox filled in for 502 PDF
arinchoi03 Nov 22, 2024
3952c13
Add NameOnBankAccount information to 502 xml and pdf
arinchoi03 Nov 22, 2024
bd4d521
Add rest of bank details on MD502 pdf
arinchoi03 Nov 23, 2024
a394bcc
Add line data
arinchoi03 Nov 23, 2024
62e0f95
Fix broken spec
arinchoi03 Nov 23, 2024
1b5ba18
Ignore account_holder_name in MD intakes, ignore df_data_import_faile…
arinchoi03 Nov 23, 2024
a59c336
Do not refer to no longer used account_holder_name
arinchoi03 Nov 24, 2024
34c7c01
Refactor full_name method to be more readable
arinchoi03 Nov 24, 2024
9b3e7ed
Allow values to change their suffix from filled to an empty value
arinchoi03 Nov 24, 2024
f61bdea
Address XML errors due to improper setting of XML node values, move m…
arinchoi03 Nov 24, 2024
d3608b4
Read account holder names values from XML, not directly from intake
arinchoi03 Nov 24, 2024
f14a5e4
Make sure to sanitize has_joint_account_holder when sanitizing bank_d…
arinchoi03 Nov 24, 2024
e9dc7c9
Little cleanup
arinchoi03 Nov 24, 2024
52575f1
Fix typo for df_data_import_failed_at
arinchoi03 Nov 25, 2024
56cccd1
Add label and translation
arinchoi03 Nov 25, 2024
f7479e1
Only include joint account holder information if payment_or_deposit_t…
arinchoi03 Nov 25, 2024
1380324
Rename classname to be more descriptive and make it more isolated to …
arinchoi03 Nov 25, 2024
6ba181f
Reference intake attribute directly from set_line
arinchoi03 Nov 25, 2024
b2219bd
Refactor ignored_columns to inherit and add to and not overwrite
arinchoi03 Nov 25, 2024
8c565ba
Add more specs on account holder names on md502
arinchoi03 Nov 25, 2024
32a3033
Test bank_authorization_confirmed param
arinchoi03 Nov 25, 2024
66c08cb
Set default to 0 for has_joint_account_holder column
arinchoi03 Nov 25, 2024
7fef8f3
Add specs, address xml/pdf failure due to change in AuthToDirectDepos…
arinchoi03 Nov 26, 2024
0d68106
Default null for has_joint_account_holder
arinchoi03 Nov 26, 2024
4d82db6
Rename expectations
arinchoi03 Nov 26, 2024
1778dde
Refactor specs
arinchoi03 Nov 26, 2024
a8d228c
Cover the "no" scenario which shouldnt really occur
arinchoi03 Nov 26, 2024
8461769
Update md502 validations for first and last names of account holders …
arinchoi03 Nov 26, 2024
fd6e3a1
Drop account_holder_name from StateFileMdIntakes
arinchoi03 Nov 27, 2024
0f98c19
Merge remote-tracking branch 'origin' into FYST-526-update-refund-tax…
arinchoi03 Nov 27, 2024
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
2 changes: 1 addition & 1 deletion app/assets/stylesheets/_state-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
padding: 0 1rem;
}

.question-with-follow-up__follow-up {
.question-with-follow-up__follow-up:not(.same-card-as-question) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry a little confused about what this is doing, would you mind explaining?

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea sorry, this is unclear.. basically the #joint-account-holder-questions element gets this margin: 0 styling which makes it try to be centered within the container unintentionally. Is there a different way I could achieve this without making it be confusing? I thought same-card-as-question made sense at the time of implementation, but i guess maybe the difference here is just simply "not-centered"? Or inner-question

Screenshot 2024-11-25 at 1 20 22 PM

another element with same styling
Screenshot 2024-11-25 at 1 21 51 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anisharamnani here's the clean up 1380324

margin: 0;

p.form-question {
Expand Down
1 change: 0 additions & 1 deletion app/controllers/flows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ def self.common_attributes
spouse_esigned: "yes",
spouse_esigned_at: 1.minute.ago,
payment_or_deposit_type: "mail",
bank_name: 'bank name',
account_type: 'unfilled',
routing_number: '111111111',
account_number: '2222222222',
Expand Down
36 changes: 30 additions & 6 deletions app/forms/state_file/md_tax_refund_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,29 @@ class MdTaxRefundForm < QuestionsForm
:routing_number,
:account_number,
:account_type,
:bank_name,
:account_holder_name
:account_holder_first_name,
:account_holder_middle_initial,
:account_holder_last_name,
:account_holder_suffix,
:has_joint_account_holder,
:joint_account_holder_first_name,
:joint_account_holder_middle_initial,
:joint_account_holder_last_name,
:joint_account_holder_suffix,
:bank_authorization_confirmed
set_attributes_for :confirmation, :routing_number_confirmation, :account_number_confirmation

validates :payment_or_deposit_type, presence: true

with_options unless: -> { payment_or_deposit_type == "mail" } do
validates :account_holder_name, presence: true
SUFFIX_OPTIONS = %w[JR SR I II III IV V VI VII VIII IX X]

validates :bank_name, presence: true
with_options unless: -> { payment_or_deposit_type == "mail" } do
validates :account_holder_first_name, presence: true
validates :account_holder_last_name, presence: true
validates :account_holder_first_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,15})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.first_name.invalid_format') }}
validates :account_holder_last_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,31})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.last_name.invalid_format') }}
Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ask Tiffany about following schema strictly? (allowing numbers in first/last name)

Tiffany Chang sorry to be super annoying again but on “implement any character-type validations that are present in the schema for this field” for people’s names –

Currently the first and last names have this validation ([A-Za-z0-9'-] ?)*[A-Za-z0-9'-] which means any characters (alphabet, numbers, apostrophes and dash, white space). Do we want the same validation? I’m talking specifically about numbers…do we want to allow numbers here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answered!
https://codeforamerica.atlassian.net/browse/FYST-526?focusedCommentId=13486

Arin Choi great catch--let’s allow alphabet, apostrophes and dash, and white space only. no numbers

validates :account_holder_middle_initial, length: { maximum: 1 }, format: { with: /\A[A-Za-z]\z/.freeze, allow_blank: true }
validates :account_holder_suffix, inclusion: { in: SUFFIX_OPTIONS }, allow_blank: true, if: -> { joint_account_holder_suffix.present? }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like these validations aren't tested?

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done! and they caught an error b/c i had joint_account_holder_suffix.present? here instead of account_holder_suffix.present?

8c565ba

validates :account_type, presence: true

validates :account_number, presence: true, confirmation: true, length: { in: 5..17 }, numericality: true
Expand All @@ -24,9 +37,20 @@ class MdTaxRefundForm < QuestionsForm
validates :routing_number, presence: true, confirmation: true, routing_number: true
validates :routing_number_confirmation, presence: true

validates :bank_authorization_confirmed, acceptance: { accept: 'yes', message: ->(_object, _data) { I18n.t("state_file.questions.md_tax_refund.md_bank_details.bank_authorization_confirmation_error") }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't see anything in the form spec about this field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed 32a3033


with_options if: -> { account_number.present? && routing_number.present? } do
validate :bank_numbers_not_equal
end

with_options if: -> { has_joint_account_holder == 'yes' } do
validates :joint_account_holder_first_name, presence: true
validates :joint_account_holder_last_name, presence: true
validates :joint_account_holder_first_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,15})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.first_name.invalid_format') }}
validates :joint_account_holder_last_name, format: { with: /\A[a-zA-Z]{1}([A-Za-z\-\s']{0,137})\z/.freeze, message: ->(_object, _data) { I18n.t('errors.attributes.last_name.invalid_format') }}
validates :joint_account_holder_middle_initial, length: { maximum: 1 }, format: { with: /\A[A-Za-z]\z/.freeze, allow_blank: true }
validates :joint_account_holder_suffix, inclusion: { in: SUFFIX_OPTIONS }, allow_blank: true, if: -> { joint_account_holder_suffix.present? }
end
end

def save
Expand All @@ -35,7 +59,7 @@ def save

def self.existing_attributes(intake)
attributes = super
attributes.except(:routing_number, :account_number, :routing_number_confirmation, :account_number_confirmation, :bank_name)
attributes.except(:routing_number, :account_number, :routing_number_confirmation, :account_number_confirmation)
end

private
Expand Down
6 changes: 2 additions & 4 deletions app/forms/state_file/tax_refund_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ class TaxRefundForm < QuestionsForm
:payment_or_deposit_type,
:routing_number,
:account_number,
:account_type,
:bank_name
:account_type
set_attributes_for :confirmation, :routing_number_confirmation, :account_number_confirmation

validates :payment_or_deposit_type, presence: true

with_options unless: -> { payment_or_deposit_type == "mail" } do
validates :bank_name, presence: true
validates :account_type, presence: true

validates :account_number, presence: true, confirmation: true, length: { in: 5..17 }, numericality: true
Expand All @@ -32,7 +30,7 @@ def save

def self.existing_attributes(intake)
attributes = super
attributes.except(:routing_number, :account_number, :routing_number_confirmation, :account_number_confirmation, :bank_name)
attributes.except(:routing_number, :account_number, :routing_number_confirmation, :account_number_confirmation)
end

private
Expand Down
1 change: 0 additions & 1 deletion app/forms/state_file/taxes_owed_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class TaxesOwedForm < TaxRefundForm
:routing_number,
:account_number,
:account_type,
:bank_name,
:withdraw_amount

set_attributes_for :confirmation, :routing_number_confirmation, :account_number_confirmation
Expand Down
4 changes: 4 additions & 0 deletions app/lib/efile/line_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ MD502_LINE_27:
label: 'Maryland tax after credits (Add lines 21 and 21a, then subtract line 26.) If less than 0, enter 0.27'
MD502_LINE_40:
label: "40 Total Maryland and local tax withheld"
MD502_AUTHORIZE_DIRECT_DEPOSIT:
label: "Client authorizes the State of Maryland to issue refund by direct deposit (tax refund controller)."
MD502_LINE_51D:
label: "51D Name(s) of Bank Account Holder(s)"
MD502B_LINE_1:
label: '1 Total number of Regular dependents'
MD502B_LINE_2:
Expand Down
5 changes: 5 additions & 0 deletions app/lib/efile/md/md502_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def calculate
set_line(:MD502_LINE_26, :calculate_line_26)
set_line(:MD502_LINE_27, :calculate_line_27)
set_line(:MD502_LINE_40, :calculate_line_40)
set_line(:MD502_AUTHORIZE_DIRECT_DEPOSIT, :calculate_authorize_direct_deposit)

@md502cr.calculate
@lines.transform_values(&:value)
Expand Down Expand Up @@ -420,6 +421,10 @@ def calculate_line_40
@intake.state_file1099_rs.sum { |item| item.state_tax_withheld_amount.round }
end

def calculate_authorize_direct_deposit
@intake.bank_authorization_confirmed_yes? ? "X" : nil
end
Copy link
Contributor

@jenny-heath jenny-heath Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would love to discuss the following, probably on tuple:

i know that the original intent of the calculators was for them to mainly hold values that are numbers or booleans used to calculate other lines. this doesn't look like it's used downstream anywhere so it could just be determined from the xml builder and left out of the calculator. either way i think i'd prefer not to have a calculator method/line set to the string "X" and instead return a boolean that can be converted to "X" in the xml builder (because the only reason for "X" is that it's required by an xml type). hopefully that makes sense!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, update: i went and looked around and i guess this calculator is littered with methods that return "X" lol. i can't think of a reason this functionally matters so idk if i'm going to recommend a refactor? again, we can discuss

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i asked em the same question when we were pairing on review. i was also curious because there's nothing being calculated here. em had said sometimes these methods are used elsewhere in the calculator for actual calculations. that doesn't seem to be the case here.

👀 i'm curious what y'all decide post tuple & discussion!

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upon discussion: let's make this return a boolean & in the XML set X or nil; no refactor of the other methods for now


def filing_status_dependent?
@filing_status == :dependent
end
Expand Down
35 changes: 32 additions & 3 deletions app/lib/pdf_filler/md502_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(submission)
end

def hash_for_pdf
{
answers = {
'Enter 1': @xml_document.at("Form502 Income FederalAdjustedGrossIncome")&.text,
'Enter 1a': @xml_document.at("Form502 Income WagesSalariesAndTips")&.text,
'Enter 1b': @xml_document.at("Form502 Income EarnedIncome")&.text,
Expand Down Expand Up @@ -86,13 +86,24 @@ def hash_for_pdf
'Enter 3': @xml_document.at('Form502 Additions StateRetirementPickup')&.text,
'Enter 6': @xml_document.at('Form502 Additions Total')&.text,
'Enter 7': @xml_document.at('Form502 Additions FedAGIAndStateAdditions')&.text,
"Enter 15": @xml_document.at('Form502 Subtractions Total')&.text,
"Enter 16": @xml_document.at('Form502 Subtractions StateAdjustedGrossIncome')&.text,
'Enter 15': @xml_document.at('Form502 Subtractions Total')&.text,
'Enter 16': @xml_document.at('Form502 Subtractions StateAdjustedGrossIncome')&.text,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubocop told me to make it single quotes 👮‍♂️

'Text Box 30': @xml_document.at('Form502 StateTaxComputation StateIncomeTax')&.text,
'Text Box 36': @xml_document.at('Form502 StateTaxComputation PovertyLevelCredit')&.text,
'Text Box 40': @xml_document.at('Form502 StateTaxComputation TotalCredits')&.text,
'Text Box 42': @xml_document.at('Form502 StateTaxComputation StateTaxAfterCredits')&.text,
'Check Box 39': @xml_document.at('Form502 AuthToDirectDepositInd')&.text == 'X' ? 'Yes' : 'Off',
'Text Box 95': full_names_of_bank_account_holders || ""
}
if @xml_document.at('RefundDirectDeposit').present?
answers.merge!({
'Check Box 41': @xml_document.at('Checking')&.text == "X" ? 'Yes' : 'Off',
'Check Box 42': @xml_document.at('Savings')&.text == "X" ? 'Yes' : 'Off',
'Text Box 93': @xml_document.at('RoutingTransitNumber')&.text,
'Text Box 94': @xml_document.at('BankAccountNumber')&.text,
})
end
answers
end

def spouse_ssn_if_mfs
Expand Down Expand Up @@ -131,6 +142,24 @@ def generate_codes_for_502_su
applicable_codes
end

def full_names_of_bank_account_holders
intake = @submission.data_source
return nil unless intake.payment_or_deposit_type.to_sym == :direct_deposit

if intake.has_joint_account_holder_yes?
account_holder_full_name + " and " + account_holder_full_name(for_joint: true)
else
account_holder_full_name
end
end

def account_holder_full_name(for_joint: false)
attributes = %w[FirstName MiddleInitial LastName NameSuffix]
account_holder_xmls = @xml_document.css('Form502 NameOnBankAccount')
account_holder_xml = for_joint ? account_holder_xmls[1] : account_holder_xmls[0]
attributes.map { |attr| account_holder_xml.at(attr)&.text }.filter_map(&:presence).join(" ")
end

def calculated_fields
@calculated_fields ||= @submission.data_source.tax_calculator.calculate
end
Expand Down
17 changes: 17 additions & 0 deletions app/lib/submission_builder/ty2024/states/md/documents/md502.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,23 @@ def document
end
end
xml.TaxWithheld calculated_fields.fetch(:MD502_LINE_40)
add_element_if_present(xml, "AuthToDirectDepositInd", :MD502_AUTHORIZE_DIRECT_DEPOSIT)
if @intake.payment_or_deposit_type.to_sym == :direct_deposit
arinchoi03 marked this conversation as resolved.
Show resolved Hide resolved
xml.NameOnBankAccount do
xml.FirstName sanitize_for_xml(@intake.account_holder_first_name) if @intake.account_holder_first_name
xml.MiddleInitial sanitize_for_xml(@intake.account_holder_middle_initial) if @intake.account_holder_middle_initial
xml.LastName sanitize_for_xml(@intake.account_holder_last_name) if @intake.account_holder_last_name
xml.NameSuffix @intake.account_holder_suffix if @intake.account_holder_suffix
end
end
if @intake.has_joint_account_holder_yes?
xml.NameOnBankAccount do
xml.FirstName sanitize_for_xml(@intake.joint_account_holder_first_name) if @intake.joint_account_holder_first_name
xml.MiddleInitial sanitize_for_xml(@intake.joint_account_holder_middle_initial) if @intake.joint_account_holder_middle_initial
xml.LastName sanitize_for_xml(@intake.joint_account_holder_last_name) if @intake.joint_account_holder_last_name
xml.NameSuffix @intake.joint_account_holder_suffix if @intake.joint_account_holder_suffix
end
end
xml.DaytimePhoneNumber @direct_file_data.phone_number if @direct_file_data.phone_number.present?
end
end
Expand Down
3 changes: 1 addition & 2 deletions app/models/state_file_az_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# account_type :integer
# armed_forces_member :integer default("unfilled"), not null
# armed_forces_wages_amount :decimal(12, 2)
# bank_name :string
# charitable_cash_amount :decimal(12, 2)
# charitable_contributions :integer default("unfilled"), not null
# charitable_noncash_amount :decimal(12, 2)
Expand Down Expand Up @@ -86,7 +85,7 @@
# index_state_file_az_intakes_on_spouse_state_id_id (spouse_state_id_id)
#
class StateFileAzIntake < StateFileBaseIntake
self.ignored_columns = %w[charitable_cash charitable_noncash household_excise_credit_claimed_amt tribal_wages armed_forces_wages]
self.ignored_columns = %w[charitable_cash charitable_noncash household_excise_credit_claimed_amt tribal_wages armed_forces_wages bank_name df_data_import_failed]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add df_data_import_failed as well in this list of ignored columns?

Copy link
Contributor

@jenny-heath jenny-heath Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the one we actually use/used is called :df_data_import_failed_at. i tried to figure out the provenance of :df_data_import_failed but couldn't really get anywhere with it? it seems like there was a move to replace :df_data_import_failed_at but i'm not sure how :df_data_import_failed was introduced...

Copy link
Contributor Author

@arinchoi03 arinchoi03 Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a typo... 😓 and yes I was trying to clean up the unused column correctly

encrypts :account_number, :routing_number, :raw_direct_file_data, :raw_direct_file_intake_data

has_many :az322_contributions, dependent: :destroy
Expand Down
3 changes: 1 addition & 2 deletions app/models/state_file_base_intake.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class StateFileBaseIntake < ApplicationRecord
self.ignored_columns = [:df_data_import_failed]
self.ignored_columns = [:df_data_import_failed, :bank_name]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we add bank_name to the shared base intake then we don't need to add it for Az right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ i think so too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, the ignored_columns get overwritten by the AZIntakes version. I can refactor to use the existing ignored columns and add the other attributes being ignored in AZ

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor: b2219bd


devise :lockable, :timeoutable, :trackable

Expand Down Expand Up @@ -371,7 +371,6 @@ def self.opted_out_state_file_intakes(email)
def sanitize_bank_details
if (payment_or_deposit_type || "").to_sym != :direct_deposit
self.account_type = "unfilled"
self.bank_name = nil
self.routing_number = nil
self.account_number = nil
self.withdraw_amount = nil
Expand Down
1 change: 0 additions & 1 deletion app/models/state_file_id_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# id :bigint not null, primary key
# account_number :string
# account_type :integer default("unfilled"), not null
# bank_name :string
# consented_to_terms_and_conditions :integer default("unfilled"), not null
# contact_preference :integer default("unfilled"), not null
# current_sign_in_at :datetime
Expand Down
27 changes: 23 additions & 4 deletions app/models/state_file_md_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# Table name: state_file_md_intakes
#
# id :bigint not null, primary key
# account_holder_name :string
# account_holder_first_name :string
# account_holder_last_name :string
# account_holder_middle_initial :string
# account_holder_suffix :string
# account_number :string
# account_type :integer default("unfilled"), not null
# authorize_sharing_of_health_insurance_info :integer default("unfilled"), not null
# bank_name :string
# bank_authorization_confirmed :integer default("unfilled"), not null
# city :string
# confirmed_permanent_address :integer default("unfilled"), not null
# consented_to_terms_and_conditions :integer default("unfilled"), not null
Expand All @@ -30,7 +33,12 @@
# failed_attempts :integer default(0), not null
# federal_return_status :string
# had_hh_member_without_health_insurance :integer default("unfilled"), not null
# has_joint_account_holder :integer
# hashed_ssn :string
# joint_account_holder_first_name :string
# joint_account_holder_last_name :string
# joint_account_holder_middle_initial :string
# joint_account_holder_suffix :string
# last_sign_in_at :datetime
# last_sign_in_ip :inet
# locale :string default("en")
Expand Down Expand Up @@ -96,6 +104,7 @@
# index_state_file_md_intakes_on_spouse_state_id_id (spouse_state_id_id)
#
class StateFileMdIntake < StateFileBaseIntake
self.ignored_columns = [:df_data_import_failed, :account_holder_name, :bank_name]
arinchoi03 marked this conversation as resolved.
Show resolved Hide resolved
include MdResidenceCountyConcern
encrypts :account_number, :routing_number, :raw_direct_file_data, :raw_direct_file_intake_data

Expand All @@ -111,6 +120,8 @@ class StateFileMdIntake < StateFileBaseIntake
enum authorize_sharing_of_health_insurance_info: { unfilled: 0, yes: 1, no: 2}, _prefix: :authorize_sharing_of_health_insurance_info
enum primary_did_not_have_health_insurance: { unfilled: 0, yes: 1, no: 2}, _prefix: :primary_did_not_have_health_insurance
enum spouse_did_not_have_health_insurance: { unfilled: 0, yes: 1, no: 2}, _prefix: :spouse_did_not_have_health_insurance
enum bank_authorization_confirmed: { unfilled: 0, yes: 1, no: 2 }, _prefix: :bank_authorization_confirmed
enum has_joint_account_holder: { unfilled: 0, yes: 1, no: 2 }, _prefix: :has_joint_account_holder

def disqualifying_df_data_reason
w2_states = direct_file_data.parsed_xml.css('W2StateLocalTaxGrp W2StateTaxGrp StateAbbreviationCd')
Expand Down Expand Up @@ -140,12 +151,20 @@ def calculate_age(dob, inclusive_of_jan_1)
def sanitize_bank_details
if (payment_or_deposit_type || "").to_sym != :direct_deposit
self.account_type = "unfilled"
self.bank_name = nil
self.routing_number = nil
self.account_number = nil
self.withdraw_amount = nil
self.date_electronic_withdrawal = nil
self.account_holder_name = nil
self.account_holder_first_name = nil
self.account_holder_middle_initial = nil
self.account_holder_last_name = nil
self.account_holder_suffix = nil
self.joint_account_holder_first_name = nil
self.joint_account_holder_middle_initial = nil
self.joint_account_holder_last_name = nil
self.joint_account_holder_suffix = nil
self.has_joint_account_holder = "unfilled"
self.bank_authorization_confirmed = "unfilled"
end
end

Expand Down
1 change: 0 additions & 1 deletion app/models/state_file_nc_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# id :bigint not null, primary key
# account_number :string
# account_type :integer default("unfilled"), not null
# bank_name :string
# city :string
# consented_to_terms_and_conditions :integer default("unfilled"), not null
# contact_preference :integer default("unfilled"), not null
Expand Down
1 change: 0 additions & 1 deletion app/models/state_file_nj_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# id :bigint not null, primary key
# account_number :string
# account_type :integer default("unfilled"), not null
# bank_name :string
# claimed_as_dep :integer
# claimed_as_eitc_qualifying_child :integer default("unfilled"), not null
# consented_to_terms_and_conditions :integer default("unfilled"), not null
Expand Down
1 change: 0 additions & 1 deletion app/models/state_file_ny_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# id :bigint not null, primary key
# account_number :string
# account_type :integer default("unfilled"), not null
# bank_name :string
# confirmed_permanent_address :integer default("unfilled"), not null
# confirmed_third_party_designee :integer default("unfilled"), not null
# consented_to_terms_and_conditions :integer default("unfilled"), not null
Expand Down
Loading
Loading