Compare commits

..

3 Commits

Author SHA1 Message Date
bd5c4f5482 Merge first and last name and expose guest update endpoint
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m42s
Add copyright notice / copyright_notice (pull_request) Successful in 3m5s
Run unit tests / unit_tests (pull_request) Successful in 5m4s
2024-11-11 07:55:03 +01:00
d2974edcc1 Merge pull request 'Define an endpoint to expose the list of expenses' (#116) from expenses-list-endpoints into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Successful in 2m17s
Run unit tests / unit_tests (push) Successful in 5m23s
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Reviewed-on: #116
2024-11-11 06:50:18 +00:00
810d0740f3 Define an endpoint to expose the list of expenses
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 44s
Add copyright notice / copyright_notice (pull_request) Successful in 2m30s
Run unit tests / unit_tests (pull_request) Successful in 6m1s
2024-11-10 20:40:37 +01:00
3 changed files with 4 additions and 4 deletions

View File

@ -4,4 +4,8 @@ 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

View File

@ -1,5 +1,3 @@
# Copyright (C) 2024 Manuel Bustillo
class MergeGuestNames < ActiveRecord::Migration[8.0]
def change
add_column :guests, :name, :string

2
db/schema.rb generated
View File

@ -1,5 +1,3 @@
# Copyright (C) 2024 Manuel Bustillo
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.