Class: BGSDependents::ChildSchool

Inherits:
Base show all
Defined in:
app/models/bgs_dependents/child_school.rb

Constant Summary

Constants inherited from Base

Base::MILITARY_POST_OFFICE_TYPE_CODES

Instance Attribute Summary

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

Methods inherited from Base

#adjust_address_lines_for!, #adjust_country_name_for!, #create_address_params, #create_person_params, #dependent_address, #format_date, #formatted_boolean, #generate_address, #relationship_type, #serialize_dependent_result

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes

Constructor Details

#initialize(dependents_application, proc_id, vnp_participant_id) ⇒ ChildSchool

Returns a new instance of ChildSchool.



10
11
12
13
14
# File 'app/models/bgs_dependents/child_school.rb', line 10

def initialize(dependents_application, proc_id, vnp_participant_id)
  @proc_id = proc_id
  @vnp_participant_id = vnp_participant_id
  self.attributes = dependents_application
end

Instance Method Details

#params_for_686cObject

rubocop:disable Metrics/MethodLength



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/models/bgs_dependents/child_school.rb', line 17

def params_for_686c
  {
    vnp_proc_id: @proc_id,
    vnp_ptcpnt_id: @vnp_participant_id,
    last_term_start_dt: format_date(last_term_school_information&.dig('term_begin')),
    last_term_end_dt: format_date(last_term_school_information&.dig('date_term_ended')),
    prev_hours_per_wk_num: last_term_school_information&.dig('hours_per_week'),
    prev_sessns_per_wk_num: last_term_school_information&.dig('classes_per_week'),
    prev_school_nm: last_term_school_information&.dig('name'),
    prev_school_cntry_nm: last_term_school_information&.dig('address', 'country_name'),
    prev_school_addrs_one_txt: last_term_school_information&.dig('address', 'address_line1'),
    prev_school_addrs_two_txt: last_term_school_information&.dig('address', 'address_line2'),
    prev_school_addrs_three_txt: last_term_school_information&.dig('address', 'address_line3'),
    prev_school_city_nm: last_term_school_information&.dig('address', 'city'),
    prev_school_postal_cd: last_term_school_information&.dig('address', 'state_code'),
    prev_school_addrs_zip_nbr: last_term_school_information&.dig('address', 'zip_code'),
    curnt_school_nm: school_information&.dig('name'),
    curnt_school_addrs_one_txt: school_information&.dig('address', 'address_line1'),
    curnt_school_addrs_two_txt: school_information&.dig('address', 'address_line2'),
    curnt_school_addrs_three_txt: school_information&.dig('address', 'address_line3'),
    curnt_school_postal_cd: school_information&.dig('address', 'state_code'),
    curnt_school_city_nm: school_information&.dig('address', 'city'),
    curnt_school_addrs_zip_nbr: school_information&.dig('address', 'zip_code'),
    curnt_school_cntry_nm: school_information&.dig('address', 'country_name'),
    course_name_txt: school_information&.dig('training_program'),
    curnt_sessns_per_wk_num: program_information&.dig('classes_per_week'),
    curnt_hours_per_wk_num: program_information&.dig('hours_per_week'),
    school_actual_expctd_start_dt: current_term_dates&.dig('official_school_start_date'),
    school_term_start_dt: format_date(current_term_dates&.dig('expected_student_start_date')),
    gradtn_dt: format_date(current_term_dates&.dig('expected_graduation_date')),
    full_time_studnt_type_cd: school_information&.dig('school_type'),
    part_time_school_subjct_txt: program_information&.dig('course_of_study')
  }
end