Skip to content

Commit

Permalink
Add 1995S form as a copy of 1995 (#3268)
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin McCurdy authored Sep 13, 2019
1 parent b8fdfad commit c21d5f2
Show file tree
Hide file tree
Showing 31 changed files with 1,210 additions and 213 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ GIT

GIT
remote: https://github.com/department-of-veterans-affairs/vets-json-schema
revision: 3bcb70014f04d4ed49fc14625d4298964f80a39c
revision: 8a74f697eba9c4d06951f5f6da4e42af6e21f2d5
branch: master
specs:
vets_json_schema (3.138.8)
vets_json_schema (3.138.11)
multi_json (~> 1.0)
script_utils (= 0.0.4)

Expand Down
4 changes: 3 additions & 1 deletion app/models/education_benefits_claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'attr_encrypted'
class EducationBenefitsClaim < ApplicationRecord
FORM_TYPES = %w[1990 1995 1990e 5490 5495 1990n 0993 0994].freeze
FORM_TYPES = %w[1990 1995 1990e 5490 5495 1990n 0993 0994 1995s].freeze

APPLICATION_TYPES = %w[
chapter33
Expand Down Expand Up @@ -114,6 +114,8 @@ def selected_benefits
return benefits
when '0994'
benefits['vettec'] = true
when '1995s'
benefits['chapter33'] = true
else
benefit = parsed_form['benefit']&.underscore
benefits[benefit] = true if benefit.present?
Expand Down
3 changes: 2 additions & 1 deletion app/models/form_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class FormProfile

MAPPINGS = Dir[Rails.root.join('config', 'form_profile_mappings', '*.yml')].map { |f| File.basename(f, '.*') }

EDU_FORMS = ['22-1990', '22-1990N', '22-1990E', '22-1995', '22-5490',
EDU_FORMS = ['22-1990', '22-1990N', '22-1990E', '22-1995', '22-1995S', '22-5490',
'22-5495', '22-0993', '22-0994', 'FEEDBACK-TOOL'].freeze
EVSS_FORMS = ['21-526EZ'].freeze
HCA_FORMS = ['1010ez'].freeze
Expand All @@ -98,6 +98,7 @@ class FormProfile
'22-1990N' => ::FormProfiles::VA1990n,
'22-1990E' => ::FormProfiles::VA1990e,
'22-1995' => ::FormProfiles::VA1995,
'22-1995S' => ::FormProfiles::VA1995s,
'22-5490' => ::FormProfiles::VA5490,
'22-5495' => ::FormProfiles::VA5495,
'21P-530' => ::FormProfiles::VA21p530,
Expand Down
11 changes: 11 additions & 0 deletions app/models/form_profiles/va1995s.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class FormProfiles::VA1995s < FormProfile
def metadata
{
version: 0,
prefill: true,
returnUrl: '/applicant/information'
}
end
end
5 changes: 5 additions & 0 deletions app/models/saved_claim/education_benefits/va1995s.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

class SavedClaim::EducationBenefits::VA1995s < SavedClaim::EducationBenefits
add_form_and_validation('22-1995S')
end
2 changes: 1 addition & 1 deletion app/swagger/requests/education_benefits_claims.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class EducationBenefitsClaims
parameter do
key :name, :form_type
key :in, :path
key :description, 'Form code. Allowed values: 1990 1995 1990e 5490'
key :description, 'Form code. Allowed values: 1990 1995 1990e 5490 1995s'
key :required, true
key :type, :string
end
Expand Down
2 changes: 1 addition & 1 deletion app/workers/education_form/create_daily_spool_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FormattingError < StandardError
end

class CreateDailySpoolFiles
LIVE_FORM_TYPES = %w[1990 1995 1990e 5490 1990n 5495 0993 0994].map { |t| "22-#{t.upcase}" }.freeze
LIVE_FORM_TYPES = %w[1990 1995 1995s 1990e 5490 1990n 5495 0993 0994].map { |t| "22-#{t.upcase}" }.freeze
include Sidekiq::Worker
include SentryLogging
sidekiq_options queue: 'default',
Expand Down
10 changes: 7 additions & 3 deletions app/workers/education_form/education_facility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,19 @@ def self.region_for(model)
# special case 0994
return :eastern if model.form_type == '0994'

# special case 1995 STEM
return :eastern if model.form_type == '1995' && record.isEdithNourseRogersScholarship
# special case 1995 with STEM / 1995s
return :eastern if check_stem_routing(model, record)

# special case Philippines
return :western if address&.country == 'PHL'

check_area(address)
end

def self.check_stem_routing(model, record)
model.form_type == '1995s' || (model.form_type == '1995' && record.isEdithNourseRogersScholarship)
end

def self.check_area(address)
area = address&.state
case area
Expand Down Expand Up @@ -114,7 +118,7 @@ def self.routing_address(record, form_type:)
record.educationProgram&.address || record.veteranAddress
when '1990E', '5490', '5495'
record.educationProgram&.address || record.relativeAddress
when '1995'
when '1995', '1995s'
record.newSchool&.address || record.veteranAddress
end
end
Expand Down
21 changes: 21 additions & 0 deletions app/workers/education_form/forms/va1995s.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module EducationForm::Forms
class VA1995s < Base
def school
@applicant.newSchool
end

def form_type
'CH33'
end

def form_benefit
'STEM'
end

def header_form_type
'STEM1995'
end
end
end
92 changes: 92 additions & 0 deletions app/workers/education_form/templates/1995s.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<%= header %>
CH33
*START*
VA Form 22-1995
DEC 2016


REQUEST FOR CHANGE OF PROGRAM OR PLACE OF TRAINING
FOR VETERANS, SERVICEPERSONS & MEMBERS OF THE SELECTED RESERVE
-------------------------------------

APPLICANT INFORMATION
---------------------

SSN: <%= value_or_na(@applicant.veteranSocialSecurityNumber) %> VA File Number: <%= value_or_na(@applicant.vaFileNumber) %>

Name: <%= full_name(@applicant.veteranFullName) %>

Address:
<%= full_address(@applicant.veteranAddress) %>

<%= parse_with_template_path('phone_numbers') %>

Email Address: <%= @applicant.email %>
Preferred Method of Contact: <%= @applicant.preferredContactMethod %>

<%= parse_with_template_path('bank_account') %>

TYPE AND PROGRAM OF EDUCATION OR TRAINING
-----------------------------------------

Benefit You Are Receiving: STEM
Are you applying for the Edith Nourse Rogers STEM Scholarship
(Chapter 33)?: <%= yesno(@applicant.isEdithNourseRogersScholarship) %>
Are you enrolled in an undergraduate STEM degree program?: <%= yesno(@applicant.isEnrolledStem) %>
Do you have a STEM undergraduate degree and are now pursuing a
teaching certification?: <%= yesno(@applicant.isPursuingTeachingCert) %>

Type of Education or Training: <%= @applicant.educationType&.titleize %>
Education or Career Goal: <%= @applicant.educationObjective %>

New School or Training Establishment:
<%= school_name_and_addr(@applicant.newSchool) %>

Current/Prior School or Training Establishment:
<%= school_name_and_addr(@applicant.oldSchool) %>

Date You Stopped Training: <%= @applicant.trainingEndDate %>
Reason for Change: <%= @applicant.reasonForChange %>


ACTIVE DUTY SERVICE INFORMATION
-------------------------------

Are you currently on active duty or do you anticipate you will
be going on active duty?: <%= yesno(@applicant.isActiveDuty) %>

Date Entered Date Separated Service Component
<% @applicant&.toursOfDuty&.each do |tour| -%>
<%= to_date(tour.dateRange&.from) %> <%= to_date(tour.dateRange&.to) %> <%= tour.serviceBranch %>
<% end %>


ENTITLEMENT TO AND USAGE OF ADDITIONAL TYPES OF ASSISTANCE
----------------------------------------------------------

For Active Duty Claimants Only. Are you receiving or do you anticipate receiving any money (including but not limited to Federal Tuition Assistance) from the Armed Forces or Public Health Service for the course for which you have applied to the VA for Education Benefits? If you receive such benefits during any part of your training, check 'Yes.' Note: If you are only applying for Tuition Assistance Top-Up, check 'No' to this item. <%= yesno(@applicant.nonVaAssistance) %>

For Civilian Employees of the U.S. Federal Government Only. Are you receiving or do you anticipate receiving any money from your agency (including but not limited to the Government Employees Training Act) for the same period for which you have applied to the VA for Education Benefits? If you will receive such benefits during any part of your training, check Yes. <%= yesno(@applicant.civilianBenefitsAssistance) %>


MARITAL AND DEPENDENCY STATUS
(For Applicants with Military Service Before Jan 1, 1977)
---------------------------------------------------------


<% if @applicant.serviceBefore1977 -%>
Married: <%= yesno(@applicant.serviceBefore1977.married) %>
Has Dependents: <%= yesno(@applicant.serviceBefore1977.haveDependents) %>
Parent Dependent: <%= yesno(@applicant.serviceBefore1977.parentDependent) %>
<% else -%>
N/A
<% end -%>


Certification and Signature of Applicant
Signature of Applicant Date

Certification for Persons on Active Duty
Signature/Title/Branch of Armed Forces Education Service Officer Date

<%= parse_with_template_path('footer') %>
5 changes: 5 additions & 0 deletions config/form_profile_mappings/22-1995S.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
veteranFullName: [identity_information, full_name]
veteranSocialSecurityNumber: [identity_information, ssn]
homePhone: [contact_information, us_phone]
veteranAddress: [contact_information, address]
email: [contact_information, email]
20 changes: 20 additions & 0 deletions spec/factories/va1995s.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

FactoryBot.define do
factory :va1995s, class: SavedClaim::EducationBenefits::VA1995s, parent: :education_benefits do
form({
veteranFullName: {
first: 'Mark',
last: 'Olson'
},
veteranSocialSecurityNumber: '111223334',
benefit: 'transferOfEntitlement',
isEdithNourseRogersScholarship: true,
privacyAgreementAccepted: true
}.to_json)

factory :va1995s_full_form do
form(File.read(Rails.root.join('spec', 'fixtures', 'education_benefits_claims', '1995s', 'kitchen_sink.json')))
end
end
end
76 changes: 76 additions & 0 deletions spec/fixtures/education_benefits_claims/1995s/kitchen_sink.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"veteranFullName": {
"first": "first",
"middle": "middle",
"last": "last"
},
"veteranSocialSecurityNumber": "111223333",
"newSchool": {
"name": "Test School Name",
"address": {
"city": "Milwaukee",
"country": "USA",
"postalCode": "53135",
"state": "WI",
"street": "111 Uni Drive"
}
},
"oldSchool": {
"name": "old school name",
"address": {
"city": "Anytown",
"country": "USA",
"postalCode": "41414",
"state": "MA",
"street": "2222 Uni Drive"
}
},
"preferredContactMethod": "email",
"trainingEndDate": "2007-06-XX",
"reasonForChange": "reason for change",
"vaFileNumber": "c12345678",
"homePhone": "5551110000",
"mobilePhone": "5551110001",
"veteranAddress": {
"city": "Milwaukee",
"country": "USA",
"postalCode": "53130",
"state": "WI",
"street": "123 Main St"
},
"civilianBenefitsAssistance": true,
"email": "[email protected]",
"benefit": "chapter33",
"educationType": "tuitionTopUp",
"educationObjective": "bachelor's degree",
"bankAccountChange": "startUpdate",
"bankAccount": {
"accountNumber": "88888888888",
"accountType": "checking",
"bankName": "First Bank of JSON",
"routingNumber": "123456789"
},
"serviceBefore1977": {
"haveDependents": true,
"married": true,
"parentDependent": false
},
"toursOfDuty": [{
"dateRange": {
"from": "2012-06-26",
"to": "2013-04-10"
},
"serviceBranch": "Army Reserve"
}, {
"dateRange": {
"from": "2013-04-22",
"to": "2013-06-14"
},
"serviceBranch": "navy"
}],
"nonVaAssistance": true,
"remarks": "remarks",
"programName": "program name",
"isEdithNourseRogersScholarship": true,
"privacyAgreementAccepted": true
}
Loading

0 comments on commit c21d5f2

Please sign in to comment.