Profitability by job and service unit from a period's hours, expenses and the created billing materials of its months. Hours are costed at one internal hourly cost, set on the price list maintenance page; a job of several service units is shared evenly between them. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
58 lines
2.2 KiB
PHP
58 lines
2.2 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\ReportExpenses;
|
|
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\ReportRevenue;
|
|
use App\Modules\Reports\Application\Contracts\ReportSales;
|
|
use App\Modules\Reports\Infrastructure\Adapters\CatalogForReports;
|
|
use App\Modules\Reports\Infrastructure\Adapters\ExpensesForReports;
|
|
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\RevenueForReports;
|
|
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,
|
|
ReportExpenses::class => ExpensesForReports::class,
|
|
ReportRevenue::class => RevenueForReports::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());
|
|
}
|
|
}
|