2019-09-24 12:21:19 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
json.extract! plan, :id, :base_name, :name, :interval, :interval_count, :group_id, :training_credit_nb, :is_rolling, :description, :type,
|
2021-06-08 17:26:40 +02:00
|
|
|
:ui_weight, :disabled, :monthly_payment, :plan_category_id
|
2019-09-24 12:21:19 +02:00
|
|
|
json.amount plan.amount / 100.00
|
2016-03-23 18:39:41 +01:00
|
|
|
json.prices plan.prices, partial: 'api/prices/price', as: :price
|
2019-09-24 12:21:19 +02:00
|
|
|
if plan.plan_file
|
|
|
|
json.plan_file_attributes do
|
|
|
|
json.id plan.plan_file.id
|
|
|
|
json.attachment_identifier plan.plan_file.attachment_identifier
|
|
|
|
end
|
|
|
|
end
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2019-09-24 12:21:19 +02:00
|
|
|
if plan.respond_to?(:partners)
|
|
|
|
json.partners plan.partners do |partner|
|
|
|
|
json.first_name partner.first_name
|
|
|
|
json.last_name partner.last_name
|
|
|
|
json.email partner.email
|
|
|
|
end
|
2020-10-27 13:06:37 +01:00
|
|
|
end
|