# Copyright (C) 2024 Manuel Bustillo class ExpensesController < ApplicationController def summary render json: Expenses::TotalQuery.new.call end def index render json: Expense.all.order(pricing_type: :asc, amount: :desc).as_json(only: %i[id name amount pricing_type]) end end