Class: BGS::StudentSchool

Inherits:
Object
  • Object
show all
Defined in:
lib/bgs/student_school.rb

Instance Method Summary collapse

Constructor Details

#initialize(proc_id:, vnp_participant_id:, payload:, user:) ⇒ StudentSchool

Returns a new instance of StudentSchool.



7
8
9
10
11
12
# File 'lib/bgs/student_school.rb', line 7

def initialize(proc_id:, vnp_participant_id:, payload:, user:)
  @user = user
  @proc_id = proc_id
  @vnp_participant_id = vnp_participant_id
  @dependents_application = payload['dependents_application']
end

Instance Method Details

#createObject



14
15
16
17
18
19
20
# File 'lib/bgs/student_school.rb', line 14

def create
  child_school = BGSDependents::ChildSchool.new(@dependents_application, @proc_id, @vnp_participant_id)
  child_student = BGSDependents::ChildStudent.new(@dependents_application, @proc_id, @vnp_participant_id)

  bgs_service.create_child_school(child_school.params_for_686c)
  bgs_service.create_child_student(child_student.params_for_686c)
end