Return stock of cancelled maintenance, throttle the PIN page's password

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]>
This commit is contained in:
2026-11-29 10:10:18 +02:00
co-authored by Claude Sonnet 5.5
parent 6692396a63
commit ef400054b0
11 changed files with 159 additions and 9 deletions
@@ -27,7 +27,7 @@ use App\Modules\Users\Application\Contracts\Clock;
* management; counter usage and maintenance done are recorded by
* anyone using the machine. A maintenance record starts the item's
* intervals again and uses up its stock item; a mistaken record is
* cancelled by management, never deleted.
* cancelled by management, never deleted, and its stock use reversed.
*/
final class MachineMaintenance
{
@@ -169,6 +169,7 @@ final class MachineMaintenance
}
$this->maintenance->cancelRecord($recordId, $actorUserId, $this->clock->now());
$this->materials->returnUseOf($recordId, $actorUserId);
});
}
}