Record used material on tasks and suggest workflow steps' default materials
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -6,15 +6,24 @@ use App\Models\User;
|
||||
use App\Modules\Catalog\Application\Contracts\CatalogQueries;
|
||||
use App\Modules\Inventory\Application\Contracts\StockItemImages;
|
||||
use App\Modules\Inventory\Application\Contracts\StockQueries;
|
||||
use App\Modules\Inventory\Application\Contracts\StockTasks;
|
||||
use App\Modules\Inventory\Application\UseCases\TaskMaterials;
|
||||
use App\Modules\Inventory\Domain\Contracts\StockItemGroupRepository;
|
||||
use App\Modules\Inventory\Domain\Contracts\StockItemRepository;
|
||||
use App\Modules\Inventory\Domain\Contracts\StockMovementRepository;
|
||||
use App\Modules\Inventory\Domain\Contracts\TaskMaterialSuggestionRepository;
|
||||
use App\Modules\Inventory\Infrastructure\Adapters\TasksForStock;
|
||||
use App\Modules\Inventory\Infrastructure\Adapters\TaskUsageWithStock;
|
||||
use App\Modules\Inventory\Infrastructure\Files\StockItemImageFiles;
|
||||
use App\Modules\Inventory\Infrastructure\Persistence\Repositories\EloquentStockItemGroupRepository;
|
||||
use App\Modules\Inventory\Infrastructure\Persistence\Repositories\EloquentStockItemRepository;
|
||||
use App\Modules\Inventory\Infrastructure\Persistence\Repositories\EloquentStockMovementRepository;
|
||||
use App\Modules\Inventory\Infrastructure\Persistence\Repositories\EloquentStockQueries;
|
||||
use App\Modules\Inventory\Infrastructure\Persistence\Repositories\EloquentTaskMaterialSuggestionRepository;
|
||||
use App\Modules\Jobs\Application\Contracts\TaskUsage;
|
||||
use App\Modules\Jobs\Domain\Events\TaskMaterialsSuggested;
|
||||
use App\Modules\Users\Domain\Enums\Role;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Livewire\Livewire;
|
||||
@@ -35,10 +44,20 @@ class InventoryServiceProvider extends ServiceProvider
|
||||
StockMovementRepository::class => EloquentStockMovementRepository::class,
|
||||
StockQueries::class => EloquentStockQueries::class,
|
||||
StockItemImages::class => StockItemImageFiles::class,
|
||||
TaskMaterialSuggestionRepository::class => EloquentTaskMaterialSuggestionRepository::class,
|
||||
StockTasks::class => TasksForStock::class,
|
||||
];
|
||||
|
||||
public function register(): void
|
||||
{
|
||||
// Registered after TimeTracking: a task with material is kept like one with hours.
|
||||
$this->app->extend(TaskUsage::class, fn (TaskUsage $usage): TaskUsage => new TaskUsageWithStock($usage));
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
Event::listen(TaskMaterialsSuggested::class, fn (TaskMaterialsSuggested $event) => app(TaskMaterials::class)->suggest($event->taskId, $event->materials));
|
||||
|
||||
$presentationPath = dirname(__DIR__, 2).'/Presentation';
|
||||
|
||||
Livewire::addNamespace('inventory', viewPath: $presentationPath.'/Livewire');
|
||||
|
||||
Reference in New Issue
Block a user