object @lesson

if @lesson # is a LessonBooking
  node :lesson do |lesson|
    {
      id: @lesson.id,
      teacher_id: @lesson.teacher_id
     }
  end
end


if @test_drive # is a Sale object
  node :test_drive do |lesson|
    {id: @test_drive.id}
  end
end


if @package
  node :package do |lesson|
    {id: @package.id}
  end
end


if @normal
  node :normal do |lesson|
    {teacher_id: @normal.teacher_id}
  end
end

if @lesson_package_type
  node :lesson_package_type do |lesson_package_type|
    {package_type: @lesson_package_type.package_type, credits: @lesson_package_type.test_drive_count}
  end
end

if @uncollectables
  node :uncollectables do |lesson|
    true
  end
end

