<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Services\Reports\ReportService;
use Illuminate\Http\Request;
use Illuminate\View\View;

class ReportController extends Controller
{
    public function overview(Request $request, ReportService $reports): View
    {
        return view('admin.reports.index', $reports->overview($this->business($request), $request));
    }

    public function bookings(Request $request, ReportService $reports): View
    {
        return view('admin.reports.bookings', $reports->bookings($this->business($request), $request));
    }

    public function revenue(Request $request, ReportService $reports): View
    {
        return view('admin.reports.revenue', $reports->revenue($this->business($request), $request));
    }

    public function staff(Request $request, ReportService $reports): View
    {
        return view('admin.reports.staff', $reports->staff($this->business($request), $request));
    }

    public function services(Request $request, ReportService $reports): View
    {
        return view('admin.reports.services', $reports->services($this->business($request), $request));
    }

    public function customers(Request $request, ReportService $reports): View
    {
        return view('admin.reports.customers', $reports->customers($this->business($request), $request));
    }

    public function invoices(Request $request, ReportService $reports): View
    {
        return view('admin.reports.invoices', $reports->invoices($this->business($request), $request));
    }

    public function reminders(Request $request, ReportService $reports): View
    {
        return view('admin.reports.reminders', $reports->reminders($this->business($request), $request));
    }

    private function business(Request $request)
    {
        return $request->attributes->get('current_business');
    }
}
