Include real data in the guests summary of the dashboard
This commit is contained in:
parent
f68caca5a4
commit
4e61ee2f22
@ -3,6 +3,7 @@
|
|||||||
class SummaryController < ApplicationController
|
class SummaryController < ApplicationController
|
||||||
def index
|
def index
|
||||||
expense_summary = Expenses::TotalQuery.new(wedding: ActsAsTenant.current_tenant).call
|
expense_summary = Expenses::TotalQuery.new(wedding: ActsAsTenant.current_tenant).call
|
||||||
|
guest_summary = Guest.group(:status).count
|
||||||
render json: {
|
render json: {
|
||||||
expenses: {
|
expenses: {
|
||||||
projected: {
|
projected: {
|
||||||
@ -18,11 +19,11 @@ class SummaryController < ApplicationController
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
guests: {
|
guests: {
|
||||||
total: 200,
|
total: guest_summary.except('considered').values.sum,
|
||||||
confirmed: 100,
|
confirmed: guest_summary['confirmed'].to_i,
|
||||||
declined: 50,
|
declined: guest_summary['declined'].to_i,
|
||||||
tentative: 25,
|
tentative: guest_summary['tentative'].to_i,
|
||||||
invited: 25
|
invited: guest_summary['invited'].to_i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user