Skip to content

Commit

Permalink
Merge branch 'master' into 97-add_endpoint_for_avg_number_of_days
Browse files Browse the repository at this point in the history
  • Loading branch information
jbackfieldVA authored Apr 15, 2024
2 parents 6c13ce9 + 209b1d7 commit 3513f6c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .github/scripts/check_codeowners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ HEAD_SHA=$(git rev-parse HEAD)
BASE_SHA=$(git rev-parse origin/master)

# Get the list of changed files between the base and head commits
IFS=$'\n' # Change IFS to split only on newlines
CHANGED_FILES=$(git diff --name-only --diff-filter=AMR ${BASE_SHA}...${HEAD_SHA})
echo "Changed files: $CHANGED_FILES"

Expand All @@ -37,7 +38,7 @@ check_in_codeowners() {
return 1
}

for FILE in "${CHANGED_FILES}"; do
for FILE in ${CHANGED_FILES}; do
# Ignore files starting with a dot
if [[ $FILE == .* ]]; then
echo "Ignoring file $FILE"
Expand All @@ -53,3 +54,4 @@ for FILE in "${CHANGED_FILES}"; do
done

echo "All changed files or their parent directories have a CODEOWNERS entry."
IFS=$' \t\n' # Reset IFS after the loop
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ GEM
attr_extras (7.1.0)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.903.0)
aws-sdk-core (3.191.5)
aws-partitions (1.913.0)
aws-sdk-core (3.191.6)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.78.0)
aws-sdk-kms (1.79.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.146.1)
Expand Down Expand Up @@ -474,7 +474,7 @@ GEM
rack (>= 1.4, < 4)
rack-protection (>= 1.5.3, <= 4.0.0)
sanitize (< 7)
foreman (0.87.2)
foreman (0.88.1)
formatador (1.1.0)
fugit (1.9.0)
et-orbi (~> 1, >= 1.2.7)
Expand Down
24 changes: 11 additions & 13 deletions modules/simple_forms_api/app/form_mappings/vba_20_10207.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"form1[0].#subform[3].TelephoneNumber_FirstThreeNumbers[0]": "<%= form.data['veteran_phone']&.gsub('-', '')&.[](0..2) %>",
"form1[0].#subform[3].TelephoneNumber_SecondThreeNumbers[0]": "<%= form.data['veteran_phone']&.gsub('-', '')&.[](3..5) %>",
"form1[0].#subform[3].International_Phone_Number_If_Applicable[0]": "<%= nil %>",
"form1[0].#subform[3].Email_Address[0]": "<%= nil %>",
"form1[0].#subform[3].Email_Address[0]": "<%= form.data['veteran_email_address'] %>",
"form1[0].#subform[3].CurrentMailingAddress_ZIPOrPostalCode_LastFourNumbers[0]": "<%= nil %>",
"form1[0].#subform[3].CurrentMailingAddress_ZIPOrPostalCode_FirstFiveNumbers[0]": "<%= form.data.dig('veteran_mailing_address', 'postal_code') %>",
"form1[0].#subform[3].CurrentMailingAddress_Country[0]": "<%= form.data.dig('veteran_mailing_address', 'country') %>",
Expand All @@ -37,8 +37,8 @@
"form1[0].#subform[3].TelephoneNumber_FirstThreeNumbers[1]": "<%= form.data['non_veteran_phone']&.gsub('-', '')&.[](0..2) %>",
"form1[0].#subform[3].TelephoneNumber_SecondThreeNumbers[1]": "<%= form.data['non_veteran_phone']&.gsub('-', '')&.[](3..5) %>",
"form1[0].#subform[3].International_Phone_Number_If_Applicable[1]": "<%= nil %>",
"form1[0].#subform[3].VA_File_Number_If_Applicable[0]": "<%= nil %>",
"form1[0].#subform[3].Email_Address[2]": "<%= nil %>",
"form1[0].#subform[3].VA_File_Number_If_Applicable[0]": "<%= form.data.dig('non_veteran_id', 'va_file_number') %>",
"form1[0].#subform[3].Email_Address[2]": "<%= form.data['non_veteran_email_address'] %>",
"form1[0].#subform[3].CurrentMailingAddress_ZIPOrPostalCode_LastFourNumbers[1]": "<%= nil %>",
"form1[0].#subform[3].CurrentMailingAddress_ZIPOrPostalCode_FirstFiveNumbers[1]": "<%= form.data.dig('non_veteran_mailing_address', 'postal_code') %>",
"form1[0].#subform[3].CurrentMailingAddress_Country[1]": "<%= form.data.dig('non_veteran_mailing_address', 'country') %>",
Expand All @@ -48,7 +48,7 @@
"form1[0].#subform[3].CurrentMailingAddress_NumberAndStreet[1]": "<%= form.data.dig('non_veteran_mailing_address', 'street') %>",
"form1[0].#subform[3].CheckBox1[1]": "<%= nil %>",
"form1[0].#subform[3].Email_Address[3]": "<%= nil %>",
"form1[0].#subform[3].VA_File_Number_If_Applicable[1]": "<%= nil %>",
"form1[0].#subform[3].VA_File_Number_If_Applicable[1]": "<%= form.data.dig('veteran_id', 'va_file_number') %>",

"form1[0].#subform[4].I_Live_Or_Sleep_In_A_Place_That_Is_Not_Meant_For_Regular_Sleeping[0]": "<%= form.data.dig('living_situation', 'overnight') ? 1 : 0 %>",
"form1[0].#subform[4].I_Live_In_A_Shelter[0]": "<%= form.data.dig('living_situation', 'shelter') ? 1 : 0 %>",
Expand All @@ -60,13 +60,11 @@

"form1[0].#subform[3].CurrentlyHomeless[0]": "<%= form.data.dig('living_situation', 'none') ? 1 : 0 %>",

"form1[0].#subform[3].Other1[0]": "<%= nil %>",
"form1[0].#subform[3].Other1[0]": "<%= form.data['other_housing_risks'] %>",
"form1[0].#subform[4].Veterans_SocialSecurityNumber_LastFourNumbers[1]": "<%= form.data.dig('veteran_id', 'ssn')&.[](5..8) %>",
"form1[0].#subform[4].Veterans_SocialSecurityNumber_SecondTwoNumbers[1]": "<%= form.data.dig('veteran_id', 'ssn')&.[](3..4) %>",
"form1[0].#subform[4].Veterans_SocialSecurityNumber_FirstThreeNumbers[1]": "<%= form.data.dig('veteran_id', 'ssn')&.[](0..2) %>",

"form1[0].#subform[4].Other2[0]": "<%= form.data['other_housing_risks'] %>",

"form1[0].#subform[4].Telephone_Number_Area_Code[0]": "<%= form.data['point_of_contact_phone']&.gsub('-', '')&.[](0..2) %>",
"form1[0].#subform[4].Telephone_Middle_Three_Numbers[0]": "<%= form.data['point_of_contact_phone']&.gsub('-', '')&.[](3..5) %>",
"form1[0].#subform[4].Telephone_Last_Four_Numbers[0]": "<%= form.data['point_of_contact_phone']&.gsub('-', '')&.[](6..9) %>",
Expand All @@ -86,12 +84,12 @@
"form1[0].#subform[4].Month[3]": "<%= form.data['pow_confinement_end_date']&.[](5..6) %>",
"form1[0].#subform[4].Day[3]": "<%= form.data['pow_confinement_end_date']&.[](8..9) %>",
"form1[0].#subform[4].Year[3]": "<%= form.data['pow_confinement_end_date']&.[](0..3) %>",
"form1[0].#subform[4].Month[5]": "<%= form.data['pow_confinement2start_date']&.[](5..6) %>",
"form1[0].#subform[4].Day[5]": "<%= form.data['pow_confinement2start_date']&.[](8..9) %>",
"form1[0].#subform[4].Year[5]": "<%= form.data['pow_confinement2start_date']&.[](0..3) %>",
"form1[0].#subform[4].Month[7]": "<%= form.data['pow_confinement2end_date']&.[](5..6) %>",
"form1[0].#subform[4].Day[7]": "<%= form.data['pow_confinement2end_date']&.[](8..9) %>",
"form1[0].#subform[4].Year[7]": "<%= form.data['pow_confinement2end_date']&.[](0..3) %>",
"form1[0].#subform[4].Month[5]": "<%= form.data['pow_confinement2_start_date']&.[](5..6) %>",
"form1[0].#subform[4].Day[5]": "<%= form.data['pow_confinement2_start_date']&.[](8..9) %>",
"form1[0].#subform[4].Year[5]": "<%= form.data['pow_confinement2_start_date']&.[](0..3) %>",
"form1[0].#subform[4].Month[7]": "<%= form.data['pow_confinement2_end_date']&.[](5..6) %>",
"form1[0].#subform[4].Day[7]": "<%= form.data['pow_confinement2_end_date']&.[](8..9) %>",
"form1[0].#subform[4].Year[7]": "<%= form.data['pow_confinement2_end_date']&.[](0..3) %>",

"form1[0].#subform[4].Name_And_Location_Of_Treatment_Facility1[0]": "<%= form.facility_name(1) %>",
"form1[0].#subform[4].DateOfTreatment_Month1[0]": "<%= form.facility_month(1) %>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(data)

def facility_name(index)
facility = @data['medical_treatments']&.[](index - 1)
"#{facility&.[]('facility_name')}\\n#{facility_address(index)}"
"#{facility&.[]('facility_name')}\\n#{facility_address(index)}" if facility
end

def facility_address(index)
Expand All @@ -39,12 +39,12 @@ def facility_year(index)
end

def requester_signature
@data['statement_of_truth_signature'] if @data['preparer_type'] == 'veteran'
@data['statement_of_truth_signature'] if %w[veteran non-veteran].include? @data['preparer_type']
end

def third_party_signature
@data['statement_of_truth_signature'] if @data['preparer_type'] != 'veteran' &&
@data['third_party_type'] != 'power-of-attorney'
@data['statement_of_truth_signature'] if %w[third-party-veteran
third-party-non-veteran].include? @data['preparer_type']
end

def power_of_attorney_signature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"postal_code": "12345"
},
"veteran_phone": "1234567890",
"veteran_email_address": "[email protected]",
"other_reasons": {
"financial_hardship": true,
"als": true,
Expand Down
7 changes: 4 additions & 3 deletions modules/simple_forms_api/spec/models/vba_20_10207_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
statement_of_truth_signature = 'John Veteran'
[
{ preparer_type: 'veteran', third_party_type: nil, expected: statement_of_truth_signature },
{ preparer_type: 'non-veteran', third_party_type: nil, expected: nil },
{ preparer_type: 'non-veteran', third_party_type: nil, expected: statement_of_truth_signature },
{ preparer_type: 'third-party-non-veteran', third_party_type: 'representative', expected: nil },
{ preparer_type: 'third-party-veteran', third_party_type: 'representative', expected: nil },
{ preparer_type: 'third-party-non-veteran', third_party_type: 'power-of-attorney', expected: nil }
Expand All @@ -78,12 +78,13 @@
statement_of_truth_signature = 'John Veteran'
[
{ preparer_type: 'veteran', third_party_type: nil, expected: nil },
{ preparer_type: 'non-veteran', third_party_type: nil, expected: statement_of_truth_signature },
{ preparer_type: 'non-veteran', third_party_type: nil, expected: nil },
{ preparer_type: 'third-party-non-veteran', third_party_type: 'representative',
expected: statement_of_truth_signature },
{ preparer_type: 'third-party-veteran', third_party_type: 'representative',
expected: statement_of_truth_signature },
{ preparer_type: 'third-party-non-veteran', third_party_type: 'power-of-attorney', expected: nil }
{ preparer_type: 'third-party-non-veteran', third_party_type: 'power-of-attorney',
expected: statement_of_truth_signature }
].each do |data|
preparer_type = data[:preparer_type]
third_party_type = data[:third_party_type]
Expand Down

0 comments on commit 3513f6c

Please sign in to comment.