2021-06-29 11:14:36 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
json.array!(@user_packs) do |user_pack|
|
2023-01-20 13:57:36 +01:00
|
|
|
json.extract! user_pack, :id, :minutes_used, :expires_at
|
2021-06-29 11:14:36 +02:00
|
|
|
json.prepaid_pack do
|
2023-01-20 13:57:36 +01:00
|
|
|
json.extract! user_pack.prepaid_pack, :minutes, :priceable_type
|
|
|
|
json.priceable do
|
|
|
|
json.extract! user_pack.prepaid_pack.priceable, :name
|
|
|
|
end
|
2021-06-29 11:14:36 +02:00
|
|
|
end
|
2023-03-09 13:23:42 +01:00
|
|
|
if @history
|
|
|
|
json.history user_pack.prepaid_pack_reservations do |ppr|
|
|
|
|
json.extract! ppr, :id, :consumed_minutes, :reservation_id
|
|
|
|
json.reservation_date ppr.reservation.created_at
|
|
|
|
end
|
|
|
|
end
|
2021-06-29 11:14:36 +02:00
|
|
|
end
|