Files
Toiminnanohjaus/app/Modules/Inventory/Domain/Contracts/InventoryCountRepository.php
T
2026-11-26 16:34:08 +02:00

38 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Modules\Inventory\Domain\Contracts;
use App\Modules\Inventory\Domain\Entities\InventoryCount;
use DateTimeImmutable;
interface InventoryCountRepository
{
public function findById(int $id): ?InventoryCount;
/**
* The count, locked until the end of the transaction.
*/
public function lockById(int $id): ?InventoryCount;
public function hasOpen(): bool;
public function save(InventoryCount $count): InventoryCount;
/**
* Stores a counted quantity with the book balance of the moment; a
* recount replaces the line.
*/
public function recordLine(int $countId, int $itemId, int $bookMilli, int $countedMilli, int $userId, DateTimeImmutable $at): void;
public function removeLine(int $countId, int $itemId): void;
/**
* @return list<array{itemId: int, bookMilli: int, countedMilli: int}>
*/
public function lines(int $countId): array;
public function setLineUnitCost(int $countId, int $itemId, int $unitCostHundredths): void;
}