1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/app/views/open_api/v1/invoices/index.json.jbuilder
2021-05-27 15:58:55 +02:00

19 lines
598 B
Ruby

# frozen_string_literal: true
json.invoices @invoices do |invoice|
json.extract! invoice, :id, :user_id, :reference, :total, :type, :description
if invoice.payment_gateway_object
json.payment_gateway_object do
json.id invoice.payment_gateway_object.gateway_object_id
json.type invoice.payment_gateway_object.gateway_object_type
end
end
json.invoice_url download_open_api_v1_invoice_path(invoice)
json.main_object do
json.type invoice.main_item.object_type
json.id invoice.main_item.object_id
json.created_at invoice.main_item.object.created_at
end
end