Include real data in the guests summary of the dashboard
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m19s
Check usage of free licenses / check-licenses (pull_request) Successful in 1m30s
Run unit tests / unit_tests (pull_request) Successful in 2m5s

This commit is contained in:
Manuel Bustillo 2024-12-11 23:42:18 +01:00
parent f68caca5a4
commit 4e61ee2f22

View File

@ -3,6 +3,7 @@
class SummaryController < ApplicationController
def index
expense_summary = Expenses::TotalQuery.new(wedding: ActsAsTenant.current_tenant).call
guest_summary = Guest.group(:status).count
render json: {
expenses: {
projected: {
@ -18,11 +19,11 @@ class SummaryController < ApplicationController
}
},
guests: {
total: 200,
confirmed: 100,
declined: 50,
tentative: 25,
invited: 25
total: guest_summary.except('considered').values.sum,
confirmed: guest_summary['confirmed'].to_i,
declined: guest_summary['declined'].to_i,
tentative: guest_summary['tentative'].to_i,
invited: guest_summary['invited'].to_i
}
}
end