Count stock and correct the differences on confirmation
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?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;
|
||||
}
|
||||
Reference in New Issue
Block a user