2024-12-11 08:03:02 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2024-12-11 09:00:45 +01:00
|
|
|
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
|