2022-09-12 19:44:13 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-09-20 15:30:44 +02:00
|
|
|
json.extract! @result, :page, :total_pages, :page_size, :total_count
|
2022-09-12 19:44:13 +02:00
|
|
|
json.data @result[:data] do |order|
|
2022-09-14 19:54:24 +02:00
|
|
|
json.extract! order, :id, :statistic_profile_id, :reference, :state, :created_at, :updated_at
|
2022-09-12 19:44:13 +02:00
|
|
|
json.total order.total / 100.0 if order.total.present?
|
2022-09-13 13:03:56 +02:00
|
|
|
json.paid_total order.paid_total / 100.0 if order.paid_total.present?
|
2022-09-12 19:44:13 +02:00
|
|
|
if order&.statistic_profile&.user
|
|
|
|
json.user do
|
|
|
|
json.id order.statistic_profile.user.id
|
|
|
|
json.role order.statistic_profile.user.roles.first.name
|
|
|
|
json.name order.statistic_profile.user.profile.full_name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|