1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-11 22:24:21 +01:00
fab-manager/app/views/api/reservations/show.json.jbuilder

19 lines
635 B
Plaintext
Raw Normal View History

# frozen_string_literal: true
2022-06-28 14:59:51 +02:00
json.partial! 'api/reservations/reservation', reservation: @reservation
2016-03-23 18:39:41 +01:00
json.user do
json.id @reservation.user.id
if @reservation.user.subscribed_plan
json.subscribed_plan do
json.partial! 'api/shared/plan', plan: @reservation.user.subscribed_plan
end
end
2016-03-23 18:39:41 +01:00
json.training_credits @reservation.user.training_credits do |tc|
json.training_id tc.creditable_id
end
json.machine_credits @reservation.user.machine_credits do |mc|
json.machine_id mc.creditable_id
json.hours_used mc.users_credits.find_by(user_id: @reservation.statistic_profile.user_id).hours_used
2016-03-23 18:39:41 +01:00
end
end