Report stock usage and value, add material cost to profitability, document phase 5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Modules\Reports\Infrastructure\Providers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Modules\Catalog\Application\Contracts\CatalogQueries;
|
||||
use App\Modules\Reports\Application\Contracts\ReportCatalog;
|
||||
use App\Modules\Reports\Application\Contracts\ReportExpenses;
|
||||
use App\Modules\Reports\Application\Contracts\ReportHours;
|
||||
@@ -10,6 +11,7 @@ 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\Application\Contracts\ReportStock;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\CatalogForReports;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\ExpensesForReports;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\HoursForReports;
|
||||
@@ -17,6 +19,7 @@ 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 App\Modules\Reports\Infrastructure\Adapters\StockForReports;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Livewire\Livewire;
|
||||
@@ -37,6 +40,7 @@ class ReportsServiceProvider extends ServiceProvider
|
||||
ReportCatalog::class => CatalogForReports::class,
|
||||
ReportPeople::class => PeopleForReports::class,
|
||||
ReportSales::class => SalesForReports::class,
|
||||
ReportStock::class => StockForReports::class,
|
||||
ReportExpenses::class => ExpensesForReports::class,
|
||||
ReportRevenue::class => RevenueForReports::class,
|
||||
];
|
||||
@@ -52,6 +56,8 @@ class ReportsServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
// Reports are for admin and management (spec 2.4).
|
||||
Gate::define('reports.stock', fn (User $user): bool => $user->role->seesAllMoney() && app(CatalogQueries::class)->stockServiceUnitIds() !== []);
|
||||
|
||||
Gate::define('reports.view', fn (User $user): bool => $user->role->seesAllMoney());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user