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

#bgs_serviceObject (private)



24
25
26
# File 'lib/bgs/student_school.rb', line 24

def bgs_service
  @service ||= BGS::Service.new(@user)
end

#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