feat(desfile): cancel entry reservations
This commit is contained in:
@@ -73,6 +73,16 @@ class Inventory extends Model
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function releaseEntry(int $amount): void
|
||||
{
|
||||
if ($amount < 1 || $this->entry_reserved_stock < $amount) {
|
||||
throw new \InvalidArgumentException('La cantidad de entradas reservadas no es válida.');
|
||||
}
|
||||
|
||||
$this->entry_reserved_stock -= $amount;
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function reserve(int $amount, bool $tracksInventory): void
|
||||
{
|
||||
if ($amount < 0) {
|
||||
|
||||
Reference in New Issue
Block a user