gruene-seele/app/Repositories/ProductionRepository.php
Kevin Adametz 65f949dd7a Warenwirtschaft: OPT-1 Quick Wins + Entwicklungsplan V6.0
- N+1-Fix Ausschussliste: user.account eager laden (StockDisposalController@index)
- Composite-Indizes stock_entries(entry_type,status,ingredient_id/packaging_item_id) für InventoryService-Aggregationen
- Ungenutzten Eager-Load producedByUser aus ProductionRepository::listForIndex entfernt
- ExampleTest auf assertRedirect umgestellt (Suite 100% grün: 155 Tests)
- Query-Count-Regressionstest für die Ausschussliste
- Plan V6.0 (Code-Verifikation, OPT-Block, geklärte Kundenfragen)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 09:54:24 +00:00

21 lines
431 B
PHP

<?php
namespace App\Repositories;
use App\Models\Production;
use Illuminate\Database\Eloquent\Collection;
class ProductionRepository
{
/**
* @return Collection<int, Production>
*/
public function listForIndex(): Collection
{
return Production::query()
->with(['product', 'location'])
->orderByDesc('produced_at')
->orderByDesc('id')
->get();
}
}