2021-04-21 17:38:06 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-04 18:17:50 +02:00
|
|
|
json.invoices @invoices do |invoice|
|
2021-06-24 12:36:16 +02:00
|
|
|
json.extract! invoice, :id, :reference, :total, :type, :description
|
2023-03-03 10:09:07 +01:00
|
|
|
json.user_id invoice.invoicing_profile.user_id
|
2021-04-21 17:38:06 +02:00
|
|
|
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
|
2016-05-04 18:17:50 +02:00
|
|
|
|
|
|
|
json.invoice_url download_open_api_v1_invoice_path(invoice)
|
2021-05-27 15:58:55 +02:00
|
|
|
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
|
2016-05-04 18:17:50 +02:00
|
|
|
end
|
|
|
|
end
|