2020-07-25 16:18:59 +02:00
|
|
|
class Api::V1::FinancialTransactionsController < Api::V1::BaseController
|
|
|
|
include Concerns::CollectionScope
|
|
|
|
|
2021-03-01 15:27:26 +01:00
|
|
|
before_action -> { doorkeeper_authorize! 'finance:read', 'finance:write' }
|
2020-07-25 16:18:59 +02:00
|
|
|
|
|
|
|
def index
|
|
|
|
render_collection search_scope
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
render json: scope.find(params.require(:id))
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def scope
|
2021-02-08 01:09:01 +01:00
|
|
|
FinancialTransaction.includes(:user, :financial_transaction_type)
|
2020-07-25 16:18:59 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def ransack_auth_object
|
|
|
|
:finance
|
|
|
|
end
|
|
|
|
end
|