wedding-planner/app/controllers/summary_controller.rb
Manuel Bustillo f68caca5a4
All checks were successful
Check usage of free licenses / check-licenses (pull_request) Successful in 1m15s
Add copyright notice / copyright_notice (pull_request) Successful in 2m8s
Run unit tests / unit_tests (pull_request) Successful in 3m8s
Add copyright notice
2024-12-11 08:03:02 +00:00

30 lines
707 B
Ruby

# Copyright (C) 2024 Manuel Bustillo
class SummaryController < ApplicationController
def index
expense_summary = Expenses::TotalQuery.new(wedding: ActsAsTenant.current_tenant).call
render json: {
expenses: {
projected: {
total: expense_summary['total_projected'],
guests: expense_summary['projected_guests']
},
confirmed: {
total: expense_summary['total_confirmed'],
guests: expense_summary['confirmed_guests']
},
status: {
paid: 0
}
},
guests: {
total: 200,
confirmed: 100,
declined: 50,
tentative: 25,
invited: 25
}
}
end
end