24 lines
587 B
PHP
24 lines
587 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Inventory\Domain\Contracts;
|
|
|
|
use App\Modules\Inventory\Domain\Entities\StockItemGroup;
|
|
|
|
interface StockItemGroupRepository
|
|
{
|
|
public function findById(int $id): ?StockItemGroup;
|
|
|
|
public function save(StockItemGroup $group): StockItemGroup;
|
|
|
|
public function isNameTaken(string $name, ?int $exceptId = null): bool;
|
|
|
|
public function nextSortOrder(): int;
|
|
|
|
/**
|
|
* The group just before ($up) or after it in order, if any.
|
|
*/
|
|
public function neighbour(StockItemGroup $group, bool $up): ?StockItemGroup;
|
|
}
|