Feature: Expense summary endpoint #75

Merged
bustikiller merged 5 commits from expenses-endpoint into main 2024-10-28 22:46:33 +00:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 0fb50ea59b - Show all commits

View File

@ -8,6 +8,10 @@ class ExpensesController < ApplicationController
@expenses = Expense.all
end
def summary
render json: Expenses::TotalQuery.new.call
end
# GET /expenses/1 or /expenses/1.json
def show
end

View File

@ -6,7 +6,9 @@ Rails.application.routes.draw do
post :import, on: :collection
post :bulk_update, on: :collection
end
resources :expenses
resources :expenses do
get :summary, on: :collection
end
resources :tables_arrangements, only: [:index, :show]
get 'up' => 'rails/health#show', as: :rails_health_check