Files
Toiminnanohjaus/app/Modules/Reports/Infrastructure/Providers/ReportsServiceProvider.php
T
petriandClaude Sonnet 5.5 568871c9dc Add the quick sales report
Quick sales of a period by cash day, product, seller and VAT rate, with
credits, open cash days flagged, a chart by day or month and CSV. VAT is
taken out of each day's total of a rate, as on the cash day balance.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 08:44:20 +02:00

52 lines
1.9 KiB
PHP

<?php
namespace App\Modules\Reports\Infrastructure\Providers;
use App\Models\User;
use App\Modules\Reports\Application\Contracts\ReportCatalog;
use App\Modules\Reports\Application\Contracts\ReportHours;
use App\Modules\Reports\Application\Contracts\ReportJobs;
use App\Modules\Reports\Application\Contracts\ReportPeople;
use App\Modules\Reports\Application\Contracts\ReportSales;
use App\Modules\Reports\Infrastructure\Adapters\CatalogForReports;
use App\Modules\Reports\Infrastructure\Adapters\HoursForReports;
use App\Modules\Reports\Infrastructure\Adapters\JobsForReports;
use App\Modules\Reports\Infrastructure\Adapters\PeopleForReports;
use App\Modules\Reports\Infrastructure\Adapters\SalesForReports;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
use Livewire\Livewire;
/**
* Wires the Reports module (management's reports, spec 13) into Laravel:
* the ports to the other modules, routes, the `reports::` Livewire
* namespace and the `reports.view` ability.
*/
class ReportsServiceProvider extends ServiceProvider
{
/**
* @var array<class-string, class-string>
*/
public array $bindings = [
ReportHours::class => HoursForReports::class,
ReportJobs::class => JobsForReports::class,
ReportCatalog::class => CatalogForReports::class,
ReportPeople::class => PeopleForReports::class,
ReportSales::class => SalesForReports::class,
];
public function boot(): void
{
$presentationPath = dirname(__DIR__, 2).'/Presentation';
Livewire::addNamespace('reports', viewPath: $presentationPath.'/Livewire');
if (! $this->app->routesAreCached()) {
$this->loadRoutesFrom($presentationPath.'/Routes/web.php');
}
// Reports are for admin and management (spec 2.4).
Gate::define('reports.view', fn (User $user): bool => $user->role->seesAllMoney());
}
}