Cancelling a maintenance record now reverses the stock it used, through Inventory's new ReverseMaintenanceStockUse behind the MaintenanceMaterials port, in the same transaction as the cancellation. The PIN page allows 5 wrong current passwords a minute per user, as the login form does, so a signed-in session cannot be used to guess the password. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
29 lines
699 B
PHP
29 lines
699 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Inventory\Domain\Contracts;
|
|
|
|
use App\Modules\Inventory\Domain\Entities\StockMovement;
|
|
|
|
interface StockMovementRepository
|
|
{
|
|
public function add(StockMovement $movement): StockMovement;
|
|
|
|
public function findById(int $id): ?StockMovement;
|
|
|
|
public function isReversed(int $movementId): bool;
|
|
|
|
/**
|
|
* The ids of a maintenance record's use movements that are not reversed.
|
|
*
|
|
* @return list<int>
|
|
*/
|
|
public function unreversedUseOfMaintenance(int $maintenanceRecordId): array;
|
|
|
|
/**
|
|
* The item's balance in thousandths: the sum of its movements.
|
|
*/
|
|
public function balanceOf(int $itemId): int;
|
|
}
|