Add stock items, groups and movements at a moving average cost
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Inventory\Application\Contracts;
|
||||
|
||||
use App\Modules\Inventory\Application\DTOs\StockGroupSummary;
|
||||
use App\Modules\Inventory\Application\DTOs\StockItemSummary;
|
||||
use App\Modules\Inventory\Application\DTOs\StockMovementSummary;
|
||||
|
||||
/**
|
||||
* Reads stock items, groups and movements. Other modules (machines, quick
|
||||
* sales, jobs' task material) read stock through this contract.
|
||||
*/
|
||||
interface StockQueries
|
||||
{
|
||||
/**
|
||||
* @return list<StockGroupSummary> In order.
|
||||
*/
|
||||
public function groups(bool $includeInactive = true): array;
|
||||
|
||||
/**
|
||||
* Items in group order and then by name. $search matches parts of the
|
||||
* name or code regardless of case and Finnish letters.
|
||||
*
|
||||
* @return list<StockItemSummary>
|
||||
*/
|
||||
public function items(?string $search = null, ?int $groupId = null, bool $onlyReorder = false, bool $includeInactive = false): array;
|
||||
|
||||
public function findItem(int $id): ?StockItemSummary;
|
||||
|
||||
/**
|
||||
* @param list<int> $ids
|
||||
* @return array<int, StockItemSummary> By id.
|
||||
*/
|
||||
public function itemsByIds(array $ids): array;
|
||||
|
||||
/**
|
||||
* The item's movements, newest first, with the balance after each.
|
||||
*
|
||||
* @return list<StockMovementSummary>
|
||||
*/
|
||||
public function movementsOf(int $itemId, int $limit = 200): array;
|
||||
|
||||
public function findMovement(int $id): ?StockMovementSummary;
|
||||
|
||||
/**
|
||||
* The private-disk path of the item's image or its thumbnail.
|
||||
*/
|
||||
public function imagePathOf(int $itemId, bool $thumbnail): ?string;
|
||||
}
|
||||
Reference in New Issue
Block a user